Package org.apache.unomi.api
Class ClusterNode
java.lang.Object
org.apache.unomi.api.Item
org.apache.unomi.api.ClusterNode
- All Implemented Interfaces:
Serializable
Information about a cluster node.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleRetrieves the cpu load.Retrieves the internal host address which uses the HTTP/HTTPS protocol for communications between clients and the context server.longRetrieves the last heartbeat time in milliseconds.double[]Retrieves the load average for the last minute, five minutes and fifteen minutes.Retrieves the public host address.Gets the server information.longRetrieves the node start time in milliseconds.longRetrieves the uptime.booleanisData()Determines whether this ClusterNode locally stores data.booleanisMaster()Determines whether this ClusterNode is a master node, i.e. this node doesn't store any data but is only focused on cluster management operations.voidsetCpuLoad(double cpuLoad) Sets the cpu load.voidsetData(boolean data) Specifies whether this ClusterNode locally stores data.voidsetInternalHostAddress(String internalHostAddress) Sets the internal host address which uses the HTTP/HTTPS protocol for communications between clients and the context server.voidsetLastHeartbeat(long lastHeartbeat) Sets the last heartbeat time in milliseconds.voidsetLoadAverage(double[] loadAverage) Sets the load average for the last minute, five minutes and fifteen minutes.voidsetMaster(boolean master) Specifies whether this ClusterNode is a master node, i.e. this node doesn't store any data but is only focused on cluster management operations..voidsetPublicHostAddress(String publicHostAddress) Sets the public host address.voidsetServerInfo(ServerInfo serverInfo) Sets the server information.voidsetStartTime(long startTime) Sets the node start time in milliseconds.voidsetUptime(long uptime) Sets the uptime.Methods inherited from class org.apache.unomi.api.Item
equals, getItemId, getItemType, getItemType, getScope, getSystemMetadata, getVersion, hashCode, setItemId, setItemType, setScope, setSystemMetadata, setVersion
-
Field Details
-
ITEM_TYPE
- See Also:
-
-
Constructor Details
-
ClusterNode
public ClusterNode()Instantiates a new Cluster node.
-
-
Method Details
-
getCpuLoad
public double getCpuLoad()Retrieves the cpu load.- Returns:
- the cpu load
-
setCpuLoad
public void setCpuLoad(double cpuLoad) Sets the cpu load.- Parameters:
cpuLoad- the cpu load
-
getPublicHostAddress
Retrieves the public host address.- Returns:
- the public host address
-
setPublicHostAddress
Sets the public host address.- Parameters:
publicHostAddress- the public host address
-
getInternalHostAddress
Retrieves the internal host address which uses the HTTP/HTTPS protocol for communications between clients and the context server.- Returns:
- the internal host address
-
setInternalHostAddress
Sets the internal host address which uses the HTTP/HTTPS protocol for communications between clients and the context server.- Parameters:
internalHostAddress- the internal host address
-
getLoadAverage
public double[] getLoadAverage()Retrieves the load average for the last minute, five minutes and fifteen minutes.- Returns:
- an array of
doublecontaining, in order and starting from index0, the load average for the last minute, last five minutes and last fifteen minutes
-
setLoadAverage
public void setLoadAverage(double[] loadAverage) Sets the load average for the last minute, five minutes and fifteen minutes.- Parameters:
loadAverage- an array ofdoublecontaining, in order and starting from index0, the load average for the last minute, last five minutes and last fifteen minutes
-
getUptime
public long getUptime()Retrieves the uptime.- Returns:
- the uptime
-
setUptime
public void setUptime(long uptime) Sets the uptime.- Parameters:
uptime- the uptime
-
isMaster
public boolean isMaster()Determines whether this ClusterNode is a master node, i.e. this node doesn't store any data but is only focused on cluster management operations.- Returns:
trueif this node is a master node,falseotherwise
-
setMaster
public void setMaster(boolean master) Specifies whether this ClusterNode is a master node, i.e. this node doesn't store any data but is only focused on cluster management operations..- Parameters:
master-trueif this node is a master node,falseotherwise
-
isData
public boolean isData()Determines whether this ClusterNode locally stores data.- Returns:
trueif this node locally stores data,falseotherwise
-
setData
public void setData(boolean data) Specifies whether this ClusterNode locally stores data.- Parameters:
data-trueif this node locally stores data,falseotherwise
-
getStartTime
public long getStartTime()Retrieves the node start time in milliseconds.- Returns:
- the start time
-
setStartTime
public void setStartTime(long startTime) Sets the node start time in milliseconds.- Parameters:
startTime- the start time
-
getLastHeartbeat
public long getLastHeartbeat()Retrieves the last heartbeat time in milliseconds.- Returns:
- the last heartbeat time
-
setLastHeartbeat
public void setLastHeartbeat(long lastHeartbeat) Sets the last heartbeat time in milliseconds.- Parameters:
lastHeartbeat- the last heartbeat time
-
getServerInfo
Gets the server information.- Returns:
- the server information
-
setServerInfo
Sets the server information.- Parameters:
serverInfo- the server information
-