Package org.teamapps.cluster.core
Klasse Cluster
java.lang.Object
org.teamapps.cluster.core.Cluster
- Alle implementierten Schnittstellen:
org.teamapps.message.protocol.service.ClusterServiceRegistry
public class Cluster
extends Object
implements org.teamapps.message.protocol.service.ClusterServiceRegistry
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final Stringfinal org.teamapps.commons.event.Event<List<ClusterNodeData>>final org.teamapps.commons.event.Event<ClusterNodeData> -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected voidconnectNode(ClusterNodeData peerNode) <MESSAGE extends org.teamapps.message.protocol.message.Message>
voidexecuteServiceBroadcast(String serviceName, String method, MESSAGE message) <REQUEST extends org.teamapps.message.protocol.message.Message,RESPONSE extends org.teamapps.message.protocol.message.Message>
RESPONSEexecuteServiceMethod(String clusterNodeId, String serviceName, String method, REQUEST request, org.teamapps.message.protocol.model.PojoObjectDecoder<RESPONSE> responseDecoder) <REQUEST extends org.teamapps.message.protocol.message.Message,RESPONSE extends org.teamapps.message.protocol.message.Message>
RESPONSEexecuteServiceMethod(String serviceName, String method, REQUEST request, org.teamapps.message.protocol.model.PojoObjectDecoder<RESPONSE> responseDecoder) getClusterNodeServices(ClusterNode clusterNode) getPeerNodes(boolean connectedOnly) protected ScheduledExecutorServiceprotected voidhandleClusterAvailableServicesUpdate(ClusterAvailableServicesUpdate availableServicesUpdate, ClusterNode clusterNode) protected voidhandleClusterNewLeaderInfo(ClusterNewLeaderInfo newLeaderInfo, ClusterNode clusterNode) protected voidhandleClusterNewPeerInfo(ClusterNewPeerInfo newPeerInfo, ClusterNode clusterNode) protected ClusterConnectionResulthandleConnectionRequest(ClusterConnectionRequest request, ClusterConnection connection) protected voidhandleConnectionResult(ClusterConnectionResult result, ClusterNodeData remoteNode, ClusterConnection connection) protected voidhandleDisconnect(ClusterNode clusterNode) voidhandleServiceBroadcastMessage(ClusterServiceBroadcastMessage broadcastMessage, ClusterNode clusterNode) protected voidhandleServiceMethodExecutionRequest(ClusterServiceMethodRequest methodRequest, ClusterNode clusterNode) protected voidhandleServiceMethodExecutionResult(ClusterServiceMethodResult methodResult, ClusterNode clusterNode) booleanisConnected(ClusterNodeData clusterNodeData) booleanbooleanisServiceAvailable(String serviceName) voidregisterModelCollection(org.teamapps.message.protocol.model.ModelCollection modelCollection) voidregisterService(org.teamapps.message.protocol.service.AbstractClusterService clusterService) voidsendMessage(String nodeId, org.teamapps.message.protocol.message.Message message) voidsendMessage(List<String> nodeIds, org.teamapps.message.protocol.message.Message message) voidshutDown()static Clusterstart()static Clusterstart(ClusterConfig clusterConfig) static ClusterstartClientMember(String clusterSecret, String host, int port) static ClusterstartServerMember(String clusterSecret, int port)
-
Felddetails
-
CLUSTER_SERVICE
- Siehe auch:
-
onLeaderAvailable
-
onAvailableNodesChange
-
-
Methodendetails
-
start
-
startServerMember
-
startClientMember
-
start
-
handleConnectionRequest
protected ClusterConnectionResult handleConnectionRequest(ClusterConnectionRequest request, ClusterConnection connection) -
handleConnectionResult
protected void handleConnectionResult(ClusterConnectionResult result, ClusterNodeData remoteNode, ClusterConnection connection) -
handleServiceMethodExecutionRequest
protected void handleServiceMethodExecutionRequest(ClusterServiceMethodRequest methodRequest, ClusterNode clusterNode) -
handleServiceMethodExecutionResult
protected void handleServiceMethodExecutionResult(ClusterServiceMethodResult methodResult, ClusterNode clusterNode) -
handleClusterNewPeerInfo
-
handleClusterNewLeaderInfo
protected void handleClusterNewLeaderInfo(ClusterNewLeaderInfo newLeaderInfo, ClusterNode clusterNode) -
handleClusterAvailableServicesUpdate
protected void handleClusterAvailableServicesUpdate(ClusterAvailableServicesUpdate availableServicesUpdate, ClusterNode clusterNode) -
handleDisconnect
-
connectNode
-
sendMessage
-
sendMessage
-
registerService
public void registerService(org.teamapps.message.protocol.service.AbstractClusterService clusterService) - Angegeben von:
registerServicein Schnittstelleorg.teamapps.message.protocol.service.ClusterServiceRegistry
-
registerModelCollection
public void registerModelCollection(org.teamapps.message.protocol.model.ModelCollection modelCollection) - Angegeben von:
registerModelCollectionin Schnittstelleorg.teamapps.message.protocol.service.ClusterServiceRegistry
-
isServiceAvailable
- Angegeben von:
isServiceAvailablein Schnittstelleorg.teamapps.message.protocol.service.ClusterServiceRegistry
-
executeServiceMethod
public <REQUEST extends org.teamapps.message.protocol.message.Message,RESPONSE extends org.teamapps.message.protocol.message.Message> RESPONSE executeServiceMethod(String serviceName, String method, REQUEST request, org.teamapps.message.protocol.model.PojoObjectDecoder<RESPONSE> responseDecoder) - Angegeben von:
executeServiceMethodin Schnittstelleorg.teamapps.message.protocol.service.ClusterServiceRegistry
-
executeServiceMethod
public <REQUEST extends org.teamapps.message.protocol.message.Message,RESPONSE extends org.teamapps.message.protocol.message.Message> RESPONSE executeServiceMethod(String clusterNodeId, String serviceName, String method, REQUEST request, org.teamapps.message.protocol.model.PojoObjectDecoder<RESPONSE> responseDecoder) - Angegeben von:
executeServiceMethodin Schnittstelleorg.teamapps.message.protocol.service.ClusterServiceRegistry
-
executeServiceBroadcast
public <MESSAGE extends org.teamapps.message.protocol.message.Message> void executeServiceBroadcast(String serviceName, String method, MESSAGE message) - Angegeben von:
executeServiceBroadcastin Schnittstelleorg.teamapps.message.protocol.service.ClusterServiceRegistry
-
handleServiceBroadcastMessage
public void handleServiceBroadcastMessage(ClusterServiceBroadcastMessage broadcastMessage, ClusterNode clusterNode) -
getScheduledExecutorService
-
shutDown
public void shutDown() -
getLocalNode
-
getClusterConfig
-
getTempDir
-
getPeerNodes
-
getClusterNodes
-
isConnected
-
getClusterNodeServices
-
getLeaderNode
-
isLeaderNode
public boolean isLeaderNode()
-