- java.lang.Object
-
- org.praxislive.core.protocols.ContainerProtocol
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.praxislive.core.Protocol
Protocol.Type<T extends Protocol>, Protocol.TypeProvider
-
-
Field Summary
Fields Modifier and Type Field Description static StringADD_CHILDName of the add-child control.static ControlInfoADD_CHILD_INFOInfo for the add-child control.static ComponentInfoAPI_INFOA component info for this protocol.static StringCHILDRENName of the children control.static ControlInfoCHILDREN_INFOInfo for the children control.static StringCONNECTName of the connect control.static ControlInfoCONNECT_INFOInfo for the connect control.static StringCONNECTIONSName of the connections control.static ControlInfoCONNECTIONS_INFOInfo for the connections control.static StringDISCONNECTName of the disconnect control.static ControlInfoDISCONNECT_INFOInfo for the disconnect control.static ContainerProtocolINSTANCEDeprecated.static StringREMOVE_CHILDName of the remove-child control.static ControlInfoREMOVE_CHILD_INFOInfo for the remove-child control.static StringSUPPORTED_TYPESName of the supported-types control.static ControlInfoSUPPORTED_TYPES_INFOInfo for the (optional) supported-types control.
-
Constructor Summary
Constructors Constructor Description ContainerProtocol()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<String>controls()The names of the controls that a component advertising this protocol must provide.ControlInfogetControlInfo(String control)Query the ControlInfo for the provided control name on this protocol.Stream<String>optionalControls()The names of additional controls that a component advertising this protocol might provide.
-
-
-
Field Detail
-
INSTANCE
@Deprecated public static final ContainerProtocol INSTANCE
Deprecated.
-
ADD_CHILD
public static final String ADD_CHILD
Name of the add-child control.- See Also:
- Constant Field Values
-
REMOVE_CHILD
public static final String REMOVE_CHILD
Name of the remove-child control.- See Also:
- Constant Field Values
-
CHILDREN
public static final String CHILDREN
Name of the children control.- See Also:
- Constant Field Values
-
CONNECT
public static final String CONNECT
Name of the connect control.- See Also:
- Constant Field Values
-
DISCONNECT
public static final String DISCONNECT
Name of the disconnect control.- See Also:
- Constant Field Values
-
CONNECTIONS
public static final String CONNECTIONS
Name of the connections control.- See Also:
- Constant Field Values
-
SUPPORTED_TYPES
public static final String SUPPORTED_TYPES
Name of the supported-types control.- See Also:
- Constant Field Values
-
ADD_CHILD_INFO
public static final ControlInfo ADD_CHILD_INFO
Info for the add-child control. It is a function control that accepts two arguments, the child name and the component type. It returns no arguments. It will respond with an error if the child cannot be added.
-
REMOVE_CHILD_INFO
public static final ControlInfo REMOVE_CHILD_INFO
Info for the remove-child control. It is a function control that accepts one argument, the child name. It returns no arguments.
-
CHILDREN_INFO
public static final ControlInfo CHILDREN_INFO
Info for the children control. It is a read-only property control that returns a PArray of child names. The response is equivalent toContainer.children().
-
CONNECT_INFO
public static final ControlInfo CONNECT_INFO
Info for the connect control. It is a function control that accepts four arguments, the first component name, the first port name, the second component name, and the second port name. It returns no arguments. It will response with an error if the connection cannot be made.
-
DISCONNECT_INFO
public static final ControlInfo DISCONNECT_INFO
Info for the disconnect control. It is a function control that accepts four arguments, the first component name, the first port name, the second component name, and the second port name. It returns no arguments.
-
CONNECTIONS_INFO
public static final ControlInfo CONNECTIONS_INFO
Info for the connections control. It is a read-only property that returns a PArray of PArray. Each internal PArray consists of four values, corresponding to the arguments passed to each call to connect.
-
SUPPORTED_TYPES_INFO
public static final ControlInfo SUPPORTED_TYPES_INFO
Info for the (optional) supported-types control. It is a read-only property that returns a PArray consisting of all supportedComponentTypethat can be passed to add-child.A
SupportedTypesimplementation may be registered in the container'sLookupto facilitate implementation of this control by child containers.
-
API_INFO
public static final ComponentInfo API_INFO
A component info for this protocol. Can be used withInfo.ComponentInfoBuilder.merge(org.praxislive.core.ComponentInfo).This does not contain info for optional controls (ie. supported-types) which must be added additionally if required.
-
-
Method Detail
-
controls
public Stream<String> controls()
Description copied from interface:ProtocolThe names of the controls that a component advertising this protocol must provide.
-
optionalControls
public Stream<String> optionalControls()
Description copied from interface:ProtocolThe names of additional controls that a component advertising this protocol might provide. These controls are optional. Any caller should check whether the component info contains the control, or otherwise prepare for the control not to be available.Implementation note : the protocol implementation should support querying the control info via
Protocol.getControlInfo(java.lang.String). The default implementation returns an empty stream.- Specified by:
optionalControlsin interfaceProtocol- Returns:
- stream of optional control names
-
getControlInfo
public ControlInfo getControlInfo(String control)
Description copied from interface:ProtocolQuery the ControlInfo for the provided control name on this protocol. The component implementing this protocol will generally use the control info provided here inside its component info. In exceptional circumstances, the component may extend or adapt the behaviour of the control, as long as it is fully compatible with this control info and the specification.- Specified by:
getControlInfoin interfaceProtocol- Parameters:
control- name of control- Returns:
- control info for named control
-
-