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 TypeMethodDescriptionvoid
close()
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 theInstanceId
for the remote instance.openBinding
(NodeId nodeId, AsyncControlClient.ResponseConsumer<InstanceConnectionService.InstanceBinding> responseConsumer) Opens anInstanceConnectionService.InstanceBinding
provided theNodeId
and 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, wait
Methods 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:AsyncControlClient
Gets theInstanceId
for the remote instance.- Specified by:
getInstanceStatus
in interfaceAsyncControlClient
- Parameters:
responseConsumer
- theConsumer<AsyncControlClient.Response<InstanceStatus>>
to handle the request- Returns:
- the
AsyncControlClient.Request
for the instance status
-
openRouteToNode
public AsyncControlClient.Request openRouteToNode(NodeId nodeId, String instanceInvokerAddress, AsyncControlClient.ResponseConsumer<String> responseConsumer) Description copied from interface:AsyncControlClient
Issues the command to open up a route to the node.- Specified by:
openRouteToNode
in interfaceAsyncControlClient
- Parameters:
nodeId
- theNodeId
instanceInvokerAddress
- 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:AsyncControlClient
Close the routes via theInstanceId
. If no routes are known, then nothing happens.- Specified by:
closeRoutesViaInstance
in interfaceAsyncControlClient
- Parameters:
instanceId
- theInstanceId
-
openBinding
public AsyncControlClient.Request openBinding(NodeId nodeId, AsyncControlClient.ResponseConsumer<InstanceConnectionService.InstanceBinding> responseConsumer) Description copied from interface:AsyncControlClient
Opens anInstanceConnectionService.InstanceBinding
provided theNodeId
and returns theInstanceConnectionService.InstanceBinding
.- Specified by:
openBinding
in interfaceAsyncControlClient
- Parameters:
nodeId
- theNodeId
- Returns:
- the
InstanceConnectionService.InstanceBinding
-
closeBinding
public AsyncControlClient.Request closeBinding(NodeId nodeId, AsyncControlClient.ResponseConsumer<Void> responseConsumer) Description copied from interface:AsyncControlClient
Issues the command to close a binding. This will invalidate allInstanceConnectionService.InstanceBinding
s to thatNodeId
.- Specified by:
closeBinding
in interfaceAsyncControlClient
- Parameters:
nodeId
-
-
close
public void close()Description copied from interface:AsyncControlClient
Closes this instance ofAsyncControlClient
. Any pending tasks will be failed with a callback to any pending responses.- Specified by:
close
in interfaceAsyncControlClient
- Specified by:
close
in interfaceAutoCloseable
-