public class ClusterRepoItem extends RepositoryItemAbstract implements Cloneable
Modifier and Type | Field and Description |
---|---|
static String |
CPU_USAGE_ATTR |
static String |
CPU_USAGE_LABEL |
static String |
HOSTNAME_ATTR |
static String |
HOSTNAME_LABEL |
static String |
LAST_UPDATE_ATTR |
static String |
LAST_UPDATE_LABEL |
static String |
MEM_USAGE_ATTR |
static String |
MEM_USAGE_LABEL |
static String |
PASSWORD_ATTR |
static String |
PASSWORD_LABEL |
static String |
PASSWORD_PROP_VAL |
static String |
PORT_NO_ATTR |
static String |
PORT_NO_LABEL |
static int |
PORT_NO_PROP_VAL |
static String |
REPO_ITEM_ELEM_NAME |
static String |
SECONDARY_HOSTNAME_ATTR |
static String |
SECONDARY_HOSTNAME_LABEL |
ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL
Constructor and Description |
---|
ClusterRepoItem() |
Modifier and Type | Method and Description |
---|---|
void |
addCommandFields(Packet packet)
The method is used for handling ad-hoc commands.
|
protected Object |
clone() |
float |
getCpuUsage() |
String |
getElemName()
Method description
|
String |
getHostname() |
String |
getKey()
Returns a unique key for the item in the repository.
|
long |
getLastUpdate() |
float |
getMemUsage() |
String |
getPassword() |
int |
getPortNo() |
String |
getSecondaryHostname() |
void |
initFromCommand(Packet packet)
The method used for handling ad-hoc commands.
|
void |
initFromElement(Element elem)
The item can be also initialized from a more complex repositories: XML repository
or SQL database.
|
void |
initFromPropertyString(String propString)
The item can be initialized based on the data loaded from a configuration file.
|
protected void |
setCpuUsage(float cpuUsage) |
protected void |
setHostname(String hostname) |
protected void |
setLastUpdate(long update) |
protected void |
setMemUsage(float memUsage) |
protected void |
setPassword(String password) |
protected void |
setPort(int port) |
protected void |
setSecondaryHostname(String secondaryHostname) |
Element |
toElement()
Item data can be stored in a more complex form than a simple property string.
|
String |
toPropertyString()
The item can be initialized based on the data loaded from a configuration file.
|
String |
toString() |
public static final String CPU_USAGE_ATTR
public static final String CPU_USAGE_LABEL
public static final String HOSTNAME_ATTR
public static final String SECONDARY_HOSTNAME_ATTR
public static final String HOSTNAME_LABEL
public static final String SECONDARY_HOSTNAME_LABEL
public static final String LAST_UPDATE_ATTR
public static final String LAST_UPDATE_LABEL
public static final String MEM_USAGE_ATTR
public static final String MEM_USAGE_LABEL
public static final String PASSWORD_ATTR
public static final String PASSWORD_LABEL
public static final String PASSWORD_PROP_VAL
public static final String PORT_NO_ATTR
public static final String PORT_NO_LABEL
public static final int PORT_NO_PROP_VAL
public static final String REPO_ITEM_ELEM_NAME
public void addCommandFields(Packet packet)
RepositoryItem
addCommandFields
in interface RepositoryItem
addCommandFields
in class RepositoryItemAbstract
packet
- with empty ad-hoc command to fill with fieldspublic void initFromCommand(Packet packet)
RepositoryItem
initFromCommand
in interface RepositoryItem
initFromCommand
in class RepositoryItemAbstract
packet
- with ad-hoc command filled by the user.public void initFromElement(Element elem)
RepositoryItem
initFromElement
in interface RepositoryItem
initFromElement
in class RepositoryItemAbstract
elem
- XML Element with all the item initialization data.public void initFromPropertyString(String propString)
RepositoryItem
initFromPropertyString
in interface RepositoryItem
propString
- is a property string to initialize the RepositoryItem.public Element toElement()
RepositoryItem
toElement
in interface RepositoryItem
toElement
in class RepositoryItemAbstract
public String toPropertyString()
RepositoryItem
toPropertyString
in interface RepositoryItem
public float getCpuUsage()
public String getElemName()
RepositoryItemAbstract
getElemName
in class RepositoryItemAbstract
public String getHostname()
public String getKey()
RepositoryItem
getKey
in interface RepositoryItem
public long getLastUpdate()
public float getMemUsage()
public String getPassword()
public String getSecondaryHostname()
public int getPortNo()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
protected void setCpuUsage(float cpuUsage)
protected void setHostname(String hostname)
protected void setLastUpdate(long update)
protected void setMemUsage(float memUsage)
protected void setPassword(String password)
protected void setSecondaryHostname(String secondaryHostname)
protected void setPort(int port)
Copyright © 2017 "Tigase, Inc.". All rights reserved.