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 TypeMethodDescriptiondouble
Retrieves the cpu load.Retrieves the internal host address which uses the HTTP/HTTPS protocol for communications between clients and the context server.long
Retrieves 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.long
Retrieves the node start time in milliseconds.long
Retrieves the uptime.boolean
isData()
Determines whether this ClusterNode locally stores data.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.void
setCpuLoad
(double cpuLoad) Sets the cpu load.void
setData
(boolean data) Specifies whether this ClusterNode locally stores data.void
setInternalHostAddress
(String internalHostAddress) Sets the internal host address which uses the HTTP/HTTPS protocol for communications between clients and the context server.void
setLastHeartbeat
(long lastHeartbeat) Sets the last heartbeat time in milliseconds.void
setLoadAverage
(double[] loadAverage) Sets the load average for the last minute, five minutes and fifteen minutes.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..void
setPublicHostAddress
(String publicHostAddress) Sets the public host address.void
setServerInfo
(ServerInfo serverInfo) Sets the server information.void
setStartTime
(long startTime) Sets the node start time in milliseconds.void
setUptime
(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
double
containing, 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 ofdouble
containing, 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:
true
if this node is a master node,false
otherwise
-
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
-true
if this node is a master node,false
otherwise
-
isData
public boolean isData()Determines whether this ClusterNode locally stores data.- Returns:
true
if this node locally stores data,false
otherwise
-
setData
public void setData(boolean data) Specifies whether this ClusterNode locally stores data.- Parameters:
data
-true
if this node locally stores data,false
otherwise
-
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
-