Class ClusterControl
- java.lang.Object
-
- org.apache.activemq.artemis.core.server.cluster.ClusterControl
-
- All Implemented Interfaces:
AutoCloseable
public class ClusterControl extends Object implements AutoCloseable
handles the communication between a cluster node and the cluster, either the whole cluster or a specific node in the cluster such as a replicating node.
-
-
Constructor Summary
Constructors Constructor Description ClusterControl(ClientSessionFactoryInternal sessionFactory, ActiveMQServer server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidannounceReplicatingBackupToLive(boolean attemptingFailBack, String replicationClusterName)XXX HORNETQ-720voidannounceScaleDown(SimpleString targetNodeId, SimpleString scaledDownNodeId)voidauthorize()authorise this cluster control so it can communicate with the cluster, it will set the cluster channel on a successful authentication.voidclose()close this cluster control and its resourcesChannelcreateReplicationChannel()create a replication channelOptional<Channel>getClusterChannel()StringgetClusterPassword()StringgetClusterUser()ClientSessionFactoryInternalgetSessionFactory()get the session factory used to connect to the clusterbooleanrequestReplicatedBackup(int backupSize, SimpleString nodeID)booleanrequestSharedStoreBackup(int backupSize, String journalDirectory, String bindingsDirectory, String largeMessagesDirectory, String pagingDirectory)voidsendNodeAnnounce(long currentEventID, String nodeID, String backupGroupName, String scaleDownGroupName, boolean isBackup, TransportConfiguration config, TransportConfiguration backupConfig)announce this node to the cluster.
-
-
-
Constructor Detail
-
ClusterControl
public ClusterControl(ClientSessionFactoryInternal sessionFactory, ActiveMQServer server)
-
-
Method Detail
-
authorize
public void authorize() throws ActiveMQExceptionauthorise this cluster control so it can communicate with the cluster, it will set the cluster channel on a successful authentication.- Throws:
ActiveMQException- if authorisation wasn't successful.
-
announceReplicatingBackupToLive
public void announceReplicatingBackupToLive(boolean attemptingFailBack, String replicationClusterName) throws ActiveMQExceptionXXX HORNETQ-720- Parameters:
attemptingFailBack- iftruethen this server wants to trigger a fail-back when up-to-date, that is it wants to take over the role of 'live' from the current 'live' server.- Throws:
ActiveMQException
-
sendNodeAnnounce
public void sendNodeAnnounce(long currentEventID, String nodeID, String backupGroupName, String scaleDownGroupName, boolean isBackup, TransportConfiguration config, TransportConfiguration backupConfig)announce this node to the cluster.- Parameters:
currentEventID- used if multiple announcements about this node are made.nodeID- the node id if the announcing nodebackupGroupName- the backup group name.scaleDownGroupName- the scaledown group nameisBackup- are we a backupconfig- the transports configbackupConfig- the transports backup config
-
createReplicationChannel
public Channel createReplicationChannel()
create a replication channel- Returns:
- the replication channel
-
getSessionFactory
public ClientSessionFactoryInternal getSessionFactory()
get the session factory used to connect to the cluster- Returns:
- the session factory
-
close
public void close()
close this cluster control and its resources- Specified by:
closein interfaceAutoCloseable
-
requestReplicatedBackup
public boolean requestReplicatedBackup(int backupSize, SimpleString nodeID)
-
requestSharedStoreBackup
public boolean requestSharedStoreBackup(int backupSize, String journalDirectory, String bindingsDirectory, String largeMessagesDirectory, String pagingDirectory)
-
announceScaleDown
public void announceScaleDown(SimpleString targetNodeId, SimpleString scaledDownNodeId)
-
getClusterUser
public String getClusterUser()
-
getClusterPassword
public String getClusterPassword()
-
-