public final class ClusterConnectionImpl extends Object implements ClusterConnection, AfterConnectInternalListener
Constructor and Description |
---|
ClusterConnectionImpl(ClusterManager manager,
DiscoveryGroupConfiguration dg,
TransportConfiguration connector,
SimpleString name,
SimpleString address,
int minLargeMessageSize,
long clientFailureCheckPeriod,
long connectionTTL,
long retryInterval,
double retryIntervalMultiplier,
long maxRetryInterval,
int reconnectAttempts,
long callTimeout,
long callFailoverTimeout,
boolean useDuplicateDetection,
boolean routeWhenNoConsumers,
int confirmationWindowSize,
ExecutorFactory executorFactory,
ExecutorService threadPool,
HornetQServer server,
PostOffice postOffice,
ManagementService managementService,
ScheduledExecutorService scheduledExecutor,
int maxHops,
NodeManager nodeManager,
boolean backup,
String clusterUser,
String clusterPassword,
boolean allowDirectConnectionsOnly,
long clusterNotificationInterval,
int clusterNotificationAttempts) |
ClusterConnectionImpl(ClusterManager manager,
TransportConfiguration[] staticTranspConfigs,
TransportConfiguration connector,
SimpleString name,
SimpleString address,
int minLargeMessageSize,
long clientFailureCheckPeriod,
long connectionTTL,
long retryInterval,
double retryIntervalMultiplier,
long maxRetryInterval,
int reconnectAttempts,
long callTimeout,
long callFailoverTimeout,
boolean useDuplicateDetection,
boolean routeWhenNoConsumers,
int confirmationWindowSize,
ExecutorFactory executorFactory,
ExecutorService threadPool,
HornetQServer server,
PostOffice postOffice,
ManagementService managementService,
ScheduledExecutorService scheduledExecutor,
int maxHops,
NodeManager nodeManager,
boolean backup,
String clusterUser,
String clusterPassword,
boolean allowDirectConnectionsOnly,
long clusterNotificationInterval,
int clusterNotificationAttempts) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
void |
addClusterTopologyListener(ClusterTopologyListener listener) |
void |
announceBackup() |
static boolean |
checkoutDupCacheSize(int windowSize,
int idCacheSize) |
String |
describe() |
void |
flushExecutor() |
TransportConfiguration |
getConnector() |
SimpleString |
getName() |
String |
getNodeID() |
Map<String,String> |
getNodes()
Only used for tests?
|
Map<String,MessageFlowRecord> |
getRecords() |
HornetQServer |
getServer() |
Topology |
getTopology() |
void |
informTopology() |
boolean |
isBackupAnnounced() |
boolean |
isNodeActive(String nodeId) |
boolean |
isStarted() |
void |
nodeAnnounced(long uniqueEventID,
String nodeID,
String nodeName,
Pair<TransportConfiguration,TransportConfiguration> connectorPair,
boolean backup) |
void |
nodeDown(long eventUID,
String nodeID)
Triggered when a node leaves the cluster.
|
void |
nodeUP(TopologyMember topologyMember,
boolean last)
Triggered when a node joins the cluster.
|
void |
onConnection(ClientSessionFactoryInternal sf) |
void |
removeClusterTopologyListener(ClusterTopologyListener listener) |
void |
start() |
void |
stop() |
String |
toString() |
boolean |
verify(String clusterUser0,
String clusterPassword0)
Verifies whether user and password match the ones configured for this ClusterConnection.
|
public ClusterConnectionImpl(ClusterManager manager, TransportConfiguration[] staticTranspConfigs, TransportConfiguration connector, SimpleString name, SimpleString address, int minLargeMessageSize, long clientFailureCheckPeriod, long connectionTTL, long retryInterval, double retryIntervalMultiplier, long maxRetryInterval, int reconnectAttempts, long callTimeout, long callFailoverTimeout, boolean useDuplicateDetection, boolean routeWhenNoConsumers, int confirmationWindowSize, ExecutorFactory executorFactory, ExecutorService threadPool, HornetQServer server, PostOffice postOffice, ManagementService managementService, ScheduledExecutorService scheduledExecutor, int maxHops, NodeManager nodeManager, boolean backup, String clusterUser, String clusterPassword, boolean allowDirectConnectionsOnly, long clusterNotificationInterval, int clusterNotificationAttempts) throws Exception
staticTranspConfigs
- notice if null
this is a cluster which won't connect to
anyone, but that can still accept incoming connections.clusterNotificationInterval
- Exception
public ClusterConnectionImpl(ClusterManager manager, DiscoveryGroupConfiguration dg, TransportConfiguration connector, SimpleString name, SimpleString address, int minLargeMessageSize, long clientFailureCheckPeriod, long connectionTTL, long retryInterval, double retryIntervalMultiplier, long maxRetryInterval, int reconnectAttempts, long callTimeout, long callFailoverTimeout, boolean useDuplicateDetection, boolean routeWhenNoConsumers, int confirmationWindowSize, ExecutorFactory executorFactory, ExecutorService threadPool, HornetQServer server, PostOffice postOffice, ManagementService managementService, ScheduledExecutorService scheduledExecutor, int maxHops, NodeManager nodeManager, boolean backup, String clusterUser, String clusterPassword, boolean allowDirectConnectionsOnly, long clusterNotificationInterval, int clusterNotificationAttempts) throws Exception
dg
- discovery group, notice if null
this is a cluster which won't connect to
anyone, but that can still accept incoming connections.clusterNotificationInterval
- Exception
public void start() throws Exception
start
in interface HornetQComponent
Exception
public void flushExecutor()
flushExecutor
in interface ClusterConnection
public void stop() throws Exception
stop
in interface HornetQComponent
Exception
public boolean isBackupAnnounced()
isBackupAnnounced
in interface ClusterConnection
public void announceBackup()
announceBackup
in interface ClusterConnection
public void addClusterTopologyListener(ClusterTopologyListener listener)
addClusterTopologyListener
in interface ClusterConnection
public void removeClusterTopologyListener(ClusterTopologyListener listener)
removeClusterTopologyListener
in interface ClusterConnection
public Topology getTopology()
getTopology
in interface ClusterConnection
public void nodeAnnounced(long uniqueEventID, String nodeID, String nodeName, Pair<TransportConfiguration,TransportConfiguration> connectorPair, boolean backup)
nodeAnnounced
in interface ClusterConnection
public void onConnection(ClientSessionFactoryInternal sf)
onConnection
in interface AfterConnectInternalListener
public boolean isStarted()
isStarted
in interface HornetQComponent
public SimpleString getName()
getName
in interface ClusterConnection
public String getNodeID()
getNodeID
in interface ClusterConnection
public HornetQServer getServer()
getServer
in interface ClusterConnection
public boolean isNodeActive(String nodeId)
isNodeActive
in interface ClusterConnection
public Map<String,String> getNodes()
ClusterConnection
getNodes
in interface ClusterConnection
public void activate() throws Exception
activate
in interface ClusterConnection
Exception
public TransportConfiguration getConnector()
getConnector
in interface ClusterConnection
public void nodeDown(long eventUID, String nodeID)
ClusterTopologyListener
nodeDown
in interface ClusterTopologyListener
nodeID
- the id of the node leaving the clusterpublic void nodeUP(TopologyMember topologyMember, boolean last)
ClusterTopologyListener
nodeUP
in interface ClusterTopologyListener
last
- if the whole cluster topology is being transmitted (after adding the listener to
the cluster connection) this parameter will be true
for the last topology
member.public void informTopology()
informTopology
in interface ClusterConnection
public static boolean checkoutDupCacheSize(int windowSize, int idCacheSize)
public Map<String,MessageFlowRecord> getRecords()
public String describe()
describe
in interface ClusterConnection
public boolean verify(String clusterUser0, String clusterPassword0)
ClusterConnection
verify
in interface ClusterConnection
true
if username and password match, false
otherwise.Copyright © 2018 JBoss by Red Hat. All rights reserved.