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
  • Felddetails

    • CLUSTER_SERVICE

      public static final String CLUSTER_SERVICE
      Siehe auch:
    • onLeaderAvailable

      public final org.teamapps.commons.event.Event<ClusterNodeData> onLeaderAvailable
    • onAvailableNodesChange

      public final org.teamapps.commons.event.Event<List<ClusterNodeData>> onAvailableNodesChange
  • Methodendetails

    • start

      public static Cluster start()
    • startServerMember

      public static Cluster startServerMember(String clusterSecret, int port)
    • startClientMember

      public static Cluster startClientMember(String clusterSecret, String host, int port)
    • start

      public static Cluster start(ClusterConfig clusterConfig)
    • 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

      protected void handleClusterNewPeerInfo(ClusterNewPeerInfo newPeerInfo, ClusterNode clusterNode)
    • handleClusterNewLeaderInfo

      protected void handleClusterNewLeaderInfo(ClusterNewLeaderInfo newLeaderInfo, ClusterNode clusterNode)
    • handleClusterAvailableServicesUpdate

      protected void handleClusterAvailableServicesUpdate(ClusterAvailableServicesUpdate availableServicesUpdate, ClusterNode clusterNode)
    • handleDisconnect

      protected void handleDisconnect(ClusterNode clusterNode)
    • connectNode

      protected void connectNode(ClusterNodeData peerNode)
    • sendMessage

      public void sendMessage(String nodeId, org.teamapps.message.protocol.message.Message message)
    • sendMessage

      public void sendMessage(List<String> nodeIds, org.teamapps.message.protocol.message.Message message)
    • registerService

      public void registerService(org.teamapps.message.protocol.service.AbstractClusterService clusterService)
      Angegeben von:
      registerService in Schnittstelle org.teamapps.message.protocol.service.ClusterServiceRegistry
    • registerModelCollection

      public void registerModelCollection(org.teamapps.message.protocol.model.ModelCollection modelCollection)
      Angegeben von:
      registerModelCollection in Schnittstelle org.teamapps.message.protocol.service.ClusterServiceRegistry
    • isServiceAvailable

      public boolean isServiceAvailable(String serviceName)
      Angegeben von:
      isServiceAvailable in Schnittstelle org.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:
      executeServiceMethod in Schnittstelle org.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:
      executeServiceMethod in Schnittstelle org.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:
      executeServiceBroadcast in Schnittstelle org.teamapps.message.protocol.service.ClusterServiceRegistry
    • handleServiceBroadcastMessage

      public void handleServiceBroadcastMessage(ClusterServiceBroadcastMessage broadcastMessage, ClusterNode clusterNode)
    • getScheduledExecutorService

      protected ScheduledExecutorService getScheduledExecutorService()
    • shutDown

      public void shutDown()
    • getLocalNode

      public ClusterNodeData getLocalNode()
    • getClusterConfig

      public ClusterConfig getClusterConfig()
    • getTempDir

      public File getTempDir()
    • getPeerNodes

      public List<ClusterNodeData> getPeerNodes(boolean connectedOnly)
    • getClusterNodes

      public List<ClusterNode> getClusterNodes()
    • isConnected

      public boolean isConnected(ClusterNodeData clusterNodeData)
    • getClusterNodeServices

      public List<String> getClusterNodeServices(ClusterNode clusterNode)
    • getLeaderNode

      public ClusterNodeData getLeaderNode()
    • isLeaderNode

      public boolean isLeaderNode()