- 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 String
ADD_CHILD
Name of the add-child control.static ControlInfo
ADD_CHILD_INFO
Info for the add-child control.static ComponentInfo
API_INFO
A component info for this protocol.static String
CHILDREN
Name of the children control.static ControlInfo
CHILDREN_INFO
Info for the children control.static String
CONNECT
Name of the connect control.static ControlInfo
CONNECT_INFO
Info for the connect control.static String
CONNECTIONS
Name of the connections control.static ControlInfo
CONNECTIONS_INFO
Info for the connections control.static String
DISCONNECT
Name of the disconnect control.static ControlInfo
DISCONNECT_INFO
Info for the disconnect control.static ContainerProtocol
INSTANCE
Deprecated.static String
REMOVE_CHILD
Name of the remove-child control.static ControlInfo
REMOVE_CHILD_INFO
Info for the remove-child control.static String
SUPPORTED_TYPES
Name of the supported-types control.static ControlInfo
SUPPORTED_TYPES_INFO
Info 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.ControlInfo
getControlInfo(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 supportedComponentType
that can be passed to add-child.A
SupportedTypes
implementation may be registered in the container'sLookup
to 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:Protocol
The names of the controls that a component advertising this protocol must provide.
-
optionalControls
public Stream<String> optionalControls()
Description copied from interface:Protocol
The 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:
optionalControls
in interfaceProtocol
- Returns:
- stream of optional control names
-
getControlInfo
public ControlInfo getControlInfo(String control)
Description copied from interface:Protocol
Query 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:
getControlInfo
in interfaceProtocol
- Parameters:
control
- name of control- Returns:
- control info for named control
-
-