Class JeroMQAsyncControlClient
java.lang.Object
dev.getelements.elements.rt.remote.jeromq.JeroMQAsyncControlClient
- All Implemented Interfaces:
AsyncControlClient,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.getelements.elements.rt.remote.AsyncControlClient
AsyncControlClient.Factory, AsyncControlClient.Request, AsyncControlClient.Response<T>, AsyncControlClient.ResponseConsumer<T> -
Constructor Summary
ConstructorsConstructorDescriptionJeroMQAsyncControlClient(AsyncConnectionService<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> service, String instanceConnectAddress, JeroMQSecurity securityChain) JeroMQAsyncControlClient(AsyncConnectionService<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> service, String instanceConnectAddress, JeroMQSecurity jeroMQSecurity, int minConnections, int maxConnections) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this instance ofAsyncControlClient.closeBinding(NodeId nodeId, AsyncControlClient.ResponseConsumer<Void> responseConsumer) Issues the command to close a binding.closeRoutesViaInstance(InstanceId instanceId, String instanceConnectAddress, AsyncControlClient.ResponseConsumer<Void> responseConsumer) Close the routes via theInstanceId.getInstanceStatus(AsyncControlClient.ResponseConsumer<InstanceStatus> responseConsumer) Gets theInstanceIdfor the remote instance.openBinding(NodeId nodeId, AsyncControlClient.ResponseConsumer<InstanceConnectionService.InstanceBinding> responseConsumer) Opens anInstanceConnectionService.InstanceBindingprovided theNodeIdand returns theInstanceConnectionService.InstanceBinding.openRouteToNode(NodeId nodeId, String instanceInvokerAddress, AsyncControlClient.ResponseConsumer<String> responseConsumer) Issues the command to open up a route to the node.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.rt.remote.AsyncControlClient
withDispatch
-
Constructor Details
-
JeroMQAsyncControlClient
public JeroMQAsyncControlClient(AsyncConnectionService<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> service, String instanceConnectAddress, JeroMQSecurity securityChain) -
JeroMQAsyncControlClient
public JeroMQAsyncControlClient(AsyncConnectionService<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> service, String instanceConnectAddress, JeroMQSecurity jeroMQSecurity, int minConnections, int maxConnections)
-
-
Method Details
-
getInstanceStatus
public AsyncControlClient.Request getInstanceStatus(AsyncControlClient.ResponseConsumer<InstanceStatus> responseConsumer) Description copied from interface:AsyncControlClientGets theInstanceIdfor the remote instance.- Specified by:
getInstanceStatusin interfaceAsyncControlClient- Parameters:
responseConsumer- theConsumer<AsyncControlClient.Response<InstanceStatus>>to handle the request- Returns:
- the
AsyncControlClient.Requestfor the instance status
-
openRouteToNode
public AsyncControlClient.Request openRouteToNode(NodeId nodeId, String instanceInvokerAddress, AsyncControlClient.ResponseConsumer<String> responseConsumer) Description copied from interface:AsyncControlClientIssues the command to open up a route to the node.- Specified by:
openRouteToNodein interfaceAsyncControlClient- Parameters:
nodeId- theNodeIdinstanceInvokerAddress- the remote instance invoker addressresponseConsumer- theConsumer<AsyncControlClient.Response<String>>to handle the request- Returns:
- the connect address for the node
-
closeRoutesViaInstance
public AsyncControlClient.Request closeRoutesViaInstance(InstanceId instanceId, String instanceConnectAddress, AsyncControlClient.ResponseConsumer<Void> responseConsumer) Description copied from interface:AsyncControlClientClose the routes via theInstanceId. If no routes are known, then nothing happens.- Specified by:
closeRoutesViaInstancein interfaceAsyncControlClient- Parameters:
instanceId- theInstanceId
-
openBinding
public AsyncControlClient.Request openBinding(NodeId nodeId, AsyncControlClient.ResponseConsumer<InstanceConnectionService.InstanceBinding> responseConsumer) Description copied from interface:AsyncControlClientOpens anInstanceConnectionService.InstanceBindingprovided theNodeIdand returns theInstanceConnectionService.InstanceBinding.- Specified by:
openBindingin interfaceAsyncControlClient- Parameters:
nodeId- theNodeId- Returns:
- the
InstanceConnectionService.InstanceBinding
-
closeBinding
public AsyncControlClient.Request closeBinding(NodeId nodeId, AsyncControlClient.ResponseConsumer<Void> responseConsumer) Description copied from interface:AsyncControlClientIssues the command to close a binding. This will invalidate allInstanceConnectionService.InstanceBindings to thatNodeId.- Specified by:
closeBindingin interfaceAsyncControlClient- Parameters:
nodeId-
-
close
public void close()Description copied from interface:AsyncControlClientCloses this instance ofAsyncControlClient. Any pending tasks will be failed with a callback to any pending responses.- Specified by:
closein interfaceAsyncControlClient- Specified by:
closein interfaceAutoCloseable
-