Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
log |
Constructor and Description |
---|
ClusterNodesManager() |
Modifier and Type | Method and Description |
---|---|
void |
deregister(Long nodeId)
Deregister the node from the table.
|
Long |
getCurrentNodeId() |
String |
getCurrentNodeIpAddress() |
protected String |
getIPAddress()
Return the IP address for the default interface.
|
ClusterNode |
getNodeById(Long id)
Returns a cluster node instance for a given identifier.
|
ClusterNode |
getNodeByIpAddress(String ip)
Returns a cluster node instance for a given IP address.
|
List<ClusterNode> |
getNodeByStatus(ClusterNode.ClusterNodeStatus status)
Returns a cluster node/s instance for a given status.
|
Priority |
getPriority()
Use highest priority to register the nodes and their statuses as quick as possible on startup.
|
void |
setCurrentNodeStatus(ClusterNode.ClusterNodeStatus newStatus)
Sets a status for current node.
|
void |
setNodeStatus(Long nodeId,
ClusterNode.ClusterNodeStatus newStatus)
Sets a status for a node.
|
boolean |
shouldInstallModules()
Check if another node is currently installing initial modules.
|
void |
start()
Register the node into the table.
|
public Priority getPriority()
HibernateInitializer
in order to have a valid Hibernate session.getPriority
in interface Startable
public void start() throws Exception
public void deregister(Long nodeId) throws Exception
Exception
- Error deregistering node.public List<ClusterNode> getNodeByStatus(ClusterNode.ClusterNodeStatus status) throws Exception
status
- The status for the node.null
if there is no match.Exception
- Error searching for a cluster node by status.public ClusterNode getNodeById(Long id) throws Exception
id
- The identifier for the node.null
if there is no match.Exception
- Error searching for a cluster node by identifier.public ClusterNode getNodeByIpAddress(String ip) throws Exception
ip
- The ip address for the node.null
if there is no match.Exception
- Error searching for a cluster node by ip address.protected String getIPAddress() throws SocketException
SocketException
- Error reading socket.public void setNodeStatus(Long nodeId, ClusterNode.ClusterNodeStatus newStatus) throws Exception
nodeId
- The node identifier.newStatus
- The new status to set.Exception
public boolean shouldInstallModules() throws Exception
Exception
public void setCurrentNodeStatus(ClusterNode.ClusterNodeStatus newStatus) throws Exception
newStatus
- The new status to set.Exception
public Long getCurrentNodeId()
public String getCurrentNodeIpAddress()
Copyright © 2012–2017 JBoss by Red Hat. All rights reserved.