public class ConfigItem extends RepositoryItemAbstract
Modifier and Type | Class and Description |
---|---|
static class |
ConfigItem.FLAGS |
Modifier and Type | Field and Description |
---|---|
static String |
CLUSTER_NODE_ATTR |
static String |
COMPONENT_NAME_ATTR |
static String |
COMPONENT_NAME_LABEL |
static String |
FLAG_ATTR |
static String |
KEY_NAME_ATTR |
static String |
KEY_NAME_LABEL |
static String |
NODE_NAME_ATTR |
static String |
NODE_NAME_LABEL |
static String |
REPO_ITEM_ELEM_NAME |
static String |
VALUE_ATTR |
static String |
VALUE_LABEL |
static String |
VALUE_TYPE_ATTR |
ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL
Constructor and Description |
---|
ConfigItem() |
Modifier and Type | Method and Description |
---|---|
void |
addCommandFields(Packet packet)
The method is used for handling ad-hoc commands.
|
boolean |
equals(Object o) |
String |
getClusterNode() |
String |
getCompName() |
String |
getConfigKey()
Returns a configuration property key which is constructed in a following way:
nodeName + "/" + keyName
|
Object |
getConfigVal()
Returns a configuration property value.
|
String |
getConfigValToString() |
String |
getElemName() |
ConfigItem.FLAGS |
getFlag() |
String |
getKey()
Returns a unique key for the item in the repository.
|
String |
getKeyName()
Returns a property key which is constructed in a following way:
keyName |
String |
getNodeName() |
int |
hashCode() |
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.
|
boolean |
isCompNodeKey(String comp,
String node,
String key) |
boolean |
isComponent(String comp)
Checks if the given component name is equal to this item compName.
|
boolean |
isKey(String key)
Checks if the given key is equal to this item keyName.
|
boolean |
isNode(String node)
Checks if the given node is equal to this item nodeName
|
boolean |
isNodeKey(String node,
String key)
Checks if the given node and key are equal to this item nodeName and keyName.
|
void |
set(String compName,
String nodeName,
String key,
Object value) |
void |
set(String compName_m,
String nodeName_m,
String key_m,
String value_str_m,
char val_type_m,
String flag_str_m) |
void |
set(String clusterNode,
String compName,
String nodeName,
String key,
Object value) |
void |
set(String clusterNode_m,
String compName_m,
String nodeName_m,
String key_m,
Object value_m,
ConfigItem.FLAGS flag_m) |
void |
set(String clusterNode_m,
String compName_m,
String nodeName_m,
String key_m,
String value_str_m,
char val_type_m,
String flag_str_m) |
protected void |
setKey(String key) |
void |
setNodeKey(String clusterNode,
String compName,
String nodeKey,
Object value) |
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 CLUSTER_NODE_ATTR
public static final String COMPONENT_NAME_ATTR
public static final String COMPONENT_NAME_LABEL
public static final String FLAG_ATTR
public static final String KEY_NAME_ATTR
public static final String KEY_NAME_LABEL
public static final String NODE_NAME_ATTR
public static final String NODE_NAME_LABEL
public static final String REPO_ITEM_ELEM_NAME
public static final String VALUE_ATTR
public static final String VALUE_LABEL
public static final String VALUE_TYPE_ATTR
public void addCommandFields(Packet packet)
RepositoryItem
addCommandFields
in interface RepositoryItem
addCommandFields
in class RepositoryItemAbstract
packet
- with empty ad-hoc command to fill with fieldspublic String getClusterNode()
public String getCompName()
public String getConfigKey()
nodeName + "/" + keyName
public Object getConfigVal()
public String getConfigValToString()
public String getElemName()
getElemName
in class RepositoryItemAbstract
public ConfigItem.FLAGS getFlag()
public String getKey()
compName + "/" + nodeName + "/" +
keyName
protected void setKey(String key)
setKey
in class RepositoryItemAbstract
public String getKeyName()
keyName
public String getNodeName()
public 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
propString
- is a property string to initialize the RepositoryItem.public boolean isComponent(String comp)
public boolean isKey(String key)
public boolean isNode(String node)
public boolean isNodeKey(String node, String key)
isNode(node) && isKey(key)
public void set(String clusterNode_m, String compName_m, String nodeName_m, String key_m, String value_str_m, char val_type_m, String flag_str_m)
public void set(String clusterNode_m, String compName_m, String nodeName_m, String key_m, Object value_m, ConfigItem.FLAGS flag_m)
public void set(String compName_m, String nodeName_m, String key_m, String value_str_m, char val_type_m, String flag_str_m)
public void setNodeKey(String clusterNode, String compName, String nodeKey, Object value)
public Element toElement()
RepositoryItem
toElement
in interface RepositoryItem
toElement
in class RepositoryItemAbstract
public String toPropertyString()
RepositoryItem
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.