Package org.teamapps.cluster.core
Class RemoteNodeImpl
java.lang.Object
org.teamapps.cluster.core.AbstractNode
org.teamapps.cluster.core.RemoteNodeImpl
- All Implemented Interfaces:
ConnectionHandler,Node,RemoteNode
public class RemoteNodeImpl extends AbstractNode implements RemoteNode
-
Constructor Summary
Constructors Constructor Description RemoteNodeImpl(java.net.Socket socket, ClusterHandler clusterHandler, org.teamapps.protocol.schema.ModelRegistry modelRegistry, java.io.File tempDir, java.lang.String clusterSecret)RemoteNodeImpl(HostAddress hostAddress, ClusterHandler clusterHandler, org.teamapps.protocol.schema.ModelRegistry modelRegistry, java.io.File tempDir, java.lang.String clusterSecret) -
Method Summary
Modifier and Type Method Description <REQUEST extends org.teamapps.protocol.schema.MessageObject, RESPONSE extends org.teamapps.protocol.schema.MessageObject>
RESPONSEexecuteServiceMethod(java.lang.String service, java.lang.String serviceMethod, REQUEST request, org.teamapps.protocol.schema.PojoObjectDecoder<RESPONSE> responseDecoder)ClusterInfogetClusterInfo()MessageQueuegetMessageQueue()voidhandleClusterExecutionRequest(java.lang.String serviceName, java.lang.String serviceMethod, org.teamapps.protocol.schema.MessageObject message, long requestId)voidhandleClusterExecutionResult(org.teamapps.protocol.schema.MessageObject message, long requestId)voidhandleClusterInfoUpdate(ClusterInfo clusterInfo)voidhandleConnectionClosed()voidhandleConnectionEstablished(Connection connection, ClusterInfo clusterInfo)voidhandleMessage(org.teamapps.protocol.schema.MessageObject message)booleanisConnected()booleanisOutbound()voidrecycleNode(RemoteNode node)voidsendMessage(org.teamapps.protocol.schema.MessageObject message, boolean resendOnError)voidshutDown()java.lang.StringtoString()Methods inherited from class org.teamapps.cluster.core.AbstractNode
createNodeInfo, getHostAddress, getNodeId, getServices, isExternallyReachable, isLeader, setExternallyReachable, setHostAddress, setLeader, setNodeId, setServicesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.teamapps.cluster.core.Node
createNodeInfo, getHostAddress, getNodeId, getServices, isExternallyReachable, isLeaderMethods inherited from interface org.teamapps.cluster.core.RemoteNode
isLocalNode
-
Constructor Details
-
RemoteNodeImpl
public RemoteNodeImpl(HostAddress hostAddress, ClusterHandler clusterHandler, org.teamapps.protocol.schema.ModelRegistry modelRegistry, java.io.File tempDir, java.lang.String clusterSecret) -
RemoteNodeImpl
public RemoteNodeImpl(java.net.Socket socket, ClusterHandler clusterHandler, org.teamapps.protocol.schema.ModelRegistry modelRegistry, java.io.File tempDir, java.lang.String clusterSecret)
-
-
Method Details
-
getClusterInfo
- Specified by:
getClusterInfoin interfaceConnectionHandler
-
handleConnectionEstablished
- Specified by:
handleConnectionEstablishedin interfaceConnectionHandler
-
handleClusterInfoUpdate
- Specified by:
handleClusterInfoUpdatein interfaceConnectionHandler
-
handleConnectionClosed
public void handleConnectionClosed()- Specified by:
handleConnectionClosedin interfaceConnectionHandler
-
handleMessage
public void handleMessage(org.teamapps.protocol.schema.MessageObject message)- Specified by:
handleMessagein interfaceConnectionHandler
-
handleClusterExecutionRequest
public void handleClusterExecutionRequest(java.lang.String serviceName, java.lang.String serviceMethod, org.teamapps.protocol.schema.MessageObject message, long requestId)- Specified by:
handleClusterExecutionRequestin interfaceConnectionHandler
-
handleClusterExecutionResult
public void handleClusterExecutionResult(org.teamapps.protocol.schema.MessageObject message, long requestId)- Specified by:
handleClusterExecutionResultin interfaceConnectionHandler
-
recycleNode
- Specified by:
recycleNodein interfaceRemoteNode
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceRemoteNode
-
isOutbound
public boolean isOutbound()- Specified by:
isOutboundin interfaceRemoteNode
-
shutDown
public void shutDown()- Specified by:
shutDownin interfaceRemoteNode
-
getMessageQueue
- Specified by:
getMessageQueuein interfaceRemoteNode
-
sendMessage
public void sendMessage(org.teamapps.protocol.schema.MessageObject message, boolean resendOnError)- Specified by:
sendMessagein interfaceRemoteNode
-
executeServiceMethod
public <REQUEST extends org.teamapps.protocol.schema.MessageObject, RESPONSE extends org.teamapps.protocol.schema.MessageObject> RESPONSE executeServiceMethod(java.lang.String service, java.lang.String serviceMethod, REQUEST request, org.teamapps.protocol.schema.PojoObjectDecoder<RESPONSE> responseDecoder)- Specified by:
executeServiceMethodin interfaceRemoteNode
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-