Package org.apache.unomi.api
Class ClusterNode
- java.lang.Object
-
- org.apache.unomi.api.ClusterNode
-
- All Implemented Interfaces:
Serializable
public class ClusterNode extends Object implements Serializable
Information about a cluster node.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClusterNode()Instantiates a new Cluster node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetCpuLoad()Retrieves the cpu load.StringgetInternalHostAddress()Retrieves the internal host address which uses the HTTP/HTTPS protocol for communications between clients and the context server.double[]getLoadAverage()Retrieves the load average for the last minute, five minutes and fifteen minutes.StringgetPublicHostAddress()Retrieves the public host address.longgetUptime()Retrieves the uptime.booleanisData()Determines whether this ClusterNode locally stores data.booleanisMaster()Determines whether this ClusterNode is a master node, i.e.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.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.voidsetPublicHostAddress(String publicHostAddress)Sets the public host address.voidsetUptime(long uptime)Sets the uptime.
-
-
-
Method Detail
-
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
public String getPublicHostAddress()
Retrieves the public host address.- Returns:
- the public host address
-
setPublicHostAddress
public void setPublicHostAddress(String publicHostAddress)
Sets the public host address.- Parameters:
publicHostAddress- the public host address
-
getInternalHostAddress
public String 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
public void setInternalHostAddress(String internalHostAddress)
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
-
-