CloudioEndpointService
public class CloudioEndpoint extends java.lang.Object implements CloudioEndpointService
Constructor | Description |
---|---|
CloudioEndpoint(java.lang.String uuid) |
Constructs a new Endpoint object using the given UUID.
|
CloudioEndpoint(java.lang.String uuid,
java.util.Properties properties) |
Constructs a new CloudioEndpoint object using the given UUID and properties.
|
CloudioEndpoint(java.lang.String uuid,
java.util.Properties properties,
CloudioEndpointListener listener) |
Constructs a new CloudioEndpoint object using the given UUID and properties.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addEndpointListener(CloudioEndpointListener listener) |
Adds the given listener to the endpoint service.
|
void |
addNode(java.lang.String nodeName,
CloudioNode node) |
Adds the given node to the endpoint.
|
<T extends CloudioNode> |
addNode(java.lang.String nodeName,
java.lang.Class<T> nodeClass) |
Adds a new node instance of the given node class to the endpoint.
|
void |
close() |
|
<T extends CloudioNode> |
getNode(java.lang.String nodeName) |
Returns the node with the given name that was registered within cloud.iO or null if no such node is present.
|
boolean |
isOnline() |
Returns true if the endpoint is connected to the central message broker, otherwise false.
|
void |
removeEndpointListener(CloudioEndpointListener listener) |
Removes the given listener from the endpoint service.
|
void |
removeNode(CloudioNode node) |
Removes the given node from the endpoint if the node actually is part of the endpoint.
|
void |
removeNode(java.lang.String nodeName) |
Removes the node with the given name from the endpoint if the node actually is part of the endpoint.
|
public CloudioEndpoint(java.lang.String uuid) throws InvalidUuidException, InvalidPropertyException, CloudioEndpointInitializationException
uuid
- Unique ID of the endpoint.InvalidUuidException
- If the given UUID is invalid.InvalidPropertyException
- Either a mandatory property is missing or a property has an invalid
value.CloudioEndpointInitializationException
- The endpoint could not be initialized. This might be caused by invalid
parameters, invalid certificates or any other runtime errors.public CloudioEndpoint(java.lang.String uuid, java.util.Properties properties) throws InvalidUuidException, InvalidPropertyException, CloudioEndpointInitializationException
uuid
- Unique ID of the endpoint.properties
- Properties containing the endpoint configuration parameters.InvalidUuidException
- If the given UUID is invalid.InvalidPropertyException
- Either a mandatory property is missing or a property has an invalid
value.CloudioEndpointInitializationException
- The endpoint could not be initialized. This might be caused by invalid
parameters, invalid certificates or any other runtime errors.public CloudioEndpoint(java.lang.String uuid, java.util.Properties properties, CloudioEndpointListener listener) throws InvalidUuidException, InvalidPropertyException, CloudioEndpointInitializationException
uuid
- Unique ID of the endpoint.properties
- Properties containing the endpoint configuration parameters.listener
- Reference to the listener receiving status updates.InvalidUuidException
- If the given UUID is invalid.InvalidPropertyException
- Either a mandatory property is missing or a property has an invalid
value.CloudioEndpointInitializationException
- The endpoint could not be initialized. This might be caused by invalid
parameters, invalid certificates or any other runtime errors.public void close()
public boolean isOnline()
CloudioEndpointService
isOnline
in interface CloudioEndpointService
public void addEndpointListener(CloudioEndpointListener listener)
CloudioEndpointService
addEndpointListener
in interface CloudioEndpointService
listener
- Listener to add.public void removeEndpointListener(CloudioEndpointListener listener)
CloudioEndpointService
removeEndpointListener
in interface CloudioEndpointService
listener
- Listener to add.public void addNode(java.lang.String nodeName, CloudioNode node) throws DuplicateNamedItemException
CloudioEndpointService
DuplicateNamedItemException
.addNode
in interface CloudioEndpointService
nodeName
- Name to give to the node.node
- Reference to the node instance to add.DuplicateNamedItemException
- If a node with the given name already exists.public <T extends CloudioNode> T addNode(java.lang.String nodeName, java.lang.Class<T> nodeClass) throws InvalidCloudioNodeException, DuplicateNamedItemException
CloudioEndpointService
DuplicateNamedItemException
. Note that the node class must dispose
a default constructor in order to let the method create an instance of the class.addNode
in interface CloudioEndpointService
T
- Type of the node class.nodeName
- Name to give to the node.nodeClass
- The class of the node to instantiate.DuplicateNamedItemException
- If a node with the given name already exists.InvalidCloudioNodeException
public void removeNode(CloudioNode node)
CloudioEndpointService
removeNode
in interface CloudioEndpointService
node
- Node to remove.public void removeNode(java.lang.String nodeName)
CloudioEndpointService
removeNode
in interface CloudioEndpointService
nodeName
- Name of the node to remove.public <T extends CloudioNode> T getNode(java.lang.String nodeName) throws java.lang.ClassCastException
CloudioEndpointService
getNode
in interface CloudioEndpointService
T
- Subclass of node.nodeName
- Name of the node to return a reference to.java.lang.ClassCastException
- If the node could not be casted to the target type