Package org.teamapps.cluster.network
Class RemoteClusterNode
java.lang.Object
org.teamapps.cluster.network.ClusterNode
org.teamapps.cluster.network.RemoteClusterNode
- All Implemented Interfaces:
ConnectionHandler
public class RemoteClusterNode extends ClusterNode implements ConnectionHandler
-
Constructor Summary
Constructors Constructor Description RemoteClusterNode(ClusterNodeMessageHandler clusterNodeMessageHandler, java.net.Socket socket)RemoteClusterNode(ClusterNodeMessageHandler clusterNodeMessageHandler, NodeAddress nodeAddress) -
Method Summary
Modifier and Type Method Description ClusterNodeDatagetClusterNodeData()ConnectiongetConnection()NodeAddressgetNodeAddress()voidhandleConnectionClosed()voidhandleMessage(byte[] bytes)booleanisConnected()booleanisOutgoing()voidmerge(RemoteClusterNode clusterNode)voidsendMessage(byte[] bytes)booleansendMessageAsync(byte[] bytes)voidsetClusterNodeData(ClusterNodeData nodeData)voidsetConnected(boolean connected)voidshutDown()java.lang.StringtoString()Methods inherited from class org.teamapps.cluster.network.ClusterNode
getNodeId, getServices, setNodeId, setServicesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
RemoteClusterNode
public RemoteClusterNode(ClusterNodeMessageHandler clusterNodeMessageHandler, java.net.Socket socket) -
RemoteClusterNode
public RemoteClusterNode(ClusterNodeMessageHandler clusterNodeMessageHandler, NodeAddress nodeAddress)
-
-
Method Details
-
merge
-
sendMessage
public void sendMessage(byte[] bytes) -
sendMessageAsync
public boolean sendMessageAsync(byte[] bytes) -
handleMessage
public void handleMessage(byte[] bytes)- Specified by:
handleMessagein interfaceConnectionHandler
-
handleConnectionClosed
public void handleConnectionClosed()- Specified by:
handleConnectionClosedin interfaceConnectionHandler
-
isOutgoing
public boolean isOutgoing() -
isConnected
public boolean isConnected() -
setConnected
public void setConnected(boolean connected) -
getNodeAddress
-
getConnection
-
setClusterNodeData
-
getClusterNodeData
-
shutDown
public void shutDown() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-