tigase.conf

## Class ConfigItem

- java.lang.Object
- - tigase.db.comp.RepositoryItemAbstract
  - - tigase.conf.ConfigItem

- All Implemented Interfaces:
    RepositoryItem

      public class ConfigItem
      extends RepositoryItemAbstract

  Created: Dec 10, 2009 2:40:26 PM
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ConfigItem.FLAGS` Enum description

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CLUSTER_NODE_ATTR` Field description
    `static String` | `COMPONENT_NAME_ATTR` Field description
    `static String` | `COMPONENT_NAME_LABEL` Field description
    `static String` | `FLAG_ATTR` Field description
    `static String` | `KEY_NAME_ATTR` Field description
    `static String` | `KEY_NAME_LABEL` Field description
    `static String` | `NODE_NAME_ATTR` Field description
    `static String` | `NODE_NAME_LABEL` Field description
    `static String` | `REPO_ITEM_ELEM_NAME` Field description
    `static String` | `VALUE_ATTR` Field description
    `static String` | `VALUE_LABEL` Field description
    `static String` | `VALUE_TYPE_ATTR` Field description

    - ### Fields inherited from class tigase.db.comp.RepositoryItemAbstract

      `ADMINS_ATT, ADMINS_LABEL, OWNER_ATT, OWNER_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigItem()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCommandFields(Packet packet)` The method is used for handling ad-hoc commands.
    `boolean` | `equals(Object o)` Method description
    `String` | `getClusterNode()` Method description
    `String` | `getCompName()` Method description
    `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()` Method description
    `String` | `getElemName()` Method description
    `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()` Method description
    `int` | `hashCode()` Method description
    `void` | `initFromCommand(Packet packet)` The method used for handling ad-hoc commands.
    `void` | `initFromElement(tigase.xml.Element elem)` Method description
    `void` | `initFromPropertyString(String propString)` Method description
    `boolean` | `isCompNodeKey(String comp, String node, String key)` Method description
    `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)` Method description
    `void` | `set(String compName_m, String nodeName_m, String key_m, String value_str_m, char val_type_m, String flag_str_m)` Method description
    `void` | `set(String clusterNode, String compName, String nodeName, String key, Object value)` Method description
    `void` | `set(String clusterNode_m, String compName_m, String nodeName_m, String key_m, Object value_m, ConfigItem.FLAGS flag_m)` Method description
    `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)` Method description
    `void` | `setNodeKey(String clusterNode, String compName, String nodeKey, Object value)` Method description
    `tigase.xml.Element` | `toElement()` Method description
    `String` | `toPropertyString()` Method description
    `String` | `toString()` Method description

    - ### Methods inherited from class tigase.db.comp.RepositoryItemAbstract

      `getAdmins, getOwner, isAdmin, isOwner, setAdmins, setOwner`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### CLUSTER_NODE_ATTR

          public static final String CLUSTER_NODE_ATTR

      Field description
      See Also:
        Constant Field Values

    - #### COMPONENT_NAME_ATTR

          public static final String COMPONENT_NAME_ATTR

      Field description
      See Also:
        Constant Field Values

    - #### COMPONENT_NAME_LABEL

          public static final String COMPONENT_NAME_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### FLAG_ATTR

          public static final String FLAG_ATTR

      Field description
      See Also:
        Constant Field Values

    - #### KEY_NAME_ATTR

          public static final String KEY_NAME_ATTR

      Field description
      See Also:
        Constant Field Values

    - #### KEY_NAME_LABEL

          public static final String KEY_NAME_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### NODE_NAME_ATTR

          public static final String NODE_NAME_ATTR

      Field description
      See Also:
        Constant Field Values

    - #### NODE_NAME_LABEL

          public static final String NODE_NAME_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### REPO_ITEM_ELEM_NAME

          public static final String REPO_ITEM_ELEM_NAME

      Field description
      See Also:
        Constant Field Values

    - #### VALUE_ATTR

          public static final String VALUE_ATTR

      Field description
      See Also:
        Constant Field Values

    - #### VALUE_LABEL

          public static final String VALUE_LABEL

      Field description
      See Also:
        Constant Field Values

    - #### VALUE_TYPE_ATTR

          public static final String VALUE_TYPE_ATTR

      Field description
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ConfigItem

          public ConfigItem()

  - ### Method Detail

    - #### addCommandFields

          public void addCommandFields(Packet packet)

      Description copied from interface: `RepositoryItem`
      The method is used for handling ad-hoc commands. The 'empty' ad-hoc command packet is provided and the Item should fill it with fields for the user.
      Specified by:
        `addCommandFields` in interface `RepositoryItem`
      Overrides:
        `addCommandFields` in class `RepositoryItemAbstract`
      Parameters:
        `packet` - with empty ad-hoc command to fill with fields

    - #### getClusterNode

          public String getClusterNode()

      Method description

    - #### getCompName

          public String getCompName()

      Method description

    - #### getConfigKey

          public String getConfigKey()

      Returns a configuration property key which is constructed in a following way: `nodeName + "/" + keyName`

    - #### getConfigVal

          public Object getConfigVal()

      Returns a configuration property value.

    - #### getConfigValToString

          public String getConfigValToString()

      Method description

    - #### getElemName

          public String getElemName()

      Description copied from class: `RepositoryItemAbstract`
      Method description
      Specified by:
        `getElemName` in class `RepositoryItemAbstract`

    - #### getFlag

          public ConfigItem.FLAGS getFlag()

    - #### getKey

          public String getKey()

      Returns a unique key for the item in the repository. All items are stored in a memory cache which is a Map. And the key returned by this method is the item identifier in the Map.
      Returns ConfigItem key which is constructed in a following way: `compName + "/" + nodeName + "/" + keyName`
      Returns:
        an Item key.

    - #### getKeyName

          public String getKeyName()

      Returns a property key which is constructed in a following way: `keyName`

    - #### getNodeName

          public String getNodeName()

      Method description

    - #### initFromCommand

          public void initFromCommand(Packet packet)

      Description copied from interface: `RepositoryItem`
      The method used for handling ad-hoc commands. After a user fills all given field the ad-hoc command packet is passed back to the item to initialize it with data. Similar method to initFromElement(), but the data source is different.
      Specified by:
        `initFromCommand` in interface `RepositoryItem`
      Overrides:
        `initFromCommand` in class `RepositoryItemAbstract`
      Parameters:
        `packet` - with ad-hoc command filled by the user.

    - #### initFromElement

          public void initFromElement(tigase.xml.Element elem)

      Method description
      Specified by:
        `initFromElement` in interface `RepositoryItem`
      Overrides:
        `initFromElement` in class `RepositoryItemAbstract`
      Parameters:
        `elem` -

    - #### initFromPropertyString

          public void initFromPropertyString(String propString)

      Method description
      Parameters:
        `propString` -

    - #### isCompNodeKey

          public boolean isCompNodeKey(String comp,
                              String node,
                              String key)

      Method description
      Parameters:
        `comp` -
        `node` -
        `key` -

    - #### equals

          public boolean equals(Object o)

      Method description
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` -

    - #### hashCode

          public int hashCode()

      Method description
      Overrides:
        `hashCode` in class `Object`

    - #### isComponent

          public boolean isComponent(String comp)

      Checks if the given component name is equal to this item compName.
      Parameters:
        `comp` -

    - #### isKey

          public boolean isKey(String key)

      Checks if the given key is equal to this item keyName.
      Parameters:
        `key` -

    - #### isNode

          public boolean isNode(String node)

      Checks if the given node is equal to this item nodeName
      Parameters:
        `node` -

    - #### isNodeKey

          public boolean isNodeKey(String node,
                          String key)

      Checks if the given node and key are equal to this item nodeName and keyName. This method call works the same way as following statement: `isNode(node) && isKey(key)`
      Parameters:
        `node` -
        `key` -

    - #### set

          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)

      Method description
      Parameters:
        `clusterNode_m` -
        `compName_m` -
        `nodeName_m` -
        `key_m` -
        `value_str_m` -
        `val_type_m` -
        `flag_str_m` -

    - #### set

          public void set(String clusterNode_m,
                 String compName_m,
                 String nodeName_m,
                 String key_m,
                 Object value_m,
                 ConfigItem.FLAGS flag_m)

      Method description
      Parameters:
        `clusterNode_m` -
        `compName_m` -
        `nodeName_m` -
        `key_m` -
        `value_m` -
        `flag_m` -

    - #### set

          public void set(String compName_m,
                 String nodeName_m,
                 String key_m,
                 String value_str_m,
                 char val_type_m,
                 String flag_str_m)

      Method description
      Parameters:
        `compName_m` -
        `nodeName_m` -
        `key_m` -
        `value_str_m` -
        `val_type_m` -
        `flag_str_m` -

    - #### set

          public void set(String compName,
                 String nodeName,
                 String key,
                 Object value)

      Method description
      Parameters:
        `compName` -
        `nodeName` -
        `key` -
        `value` -

    - #### set

          public void set(String clusterNode,
                 String compName,
                 String nodeName,
                 String key,
                 Object value)

      Method description
      Parameters:
        `clusterNode` -
        `compName` -
        `nodeName` -
        `key` -
        `value` -

    - #### setNodeKey

          public void setNodeKey(String clusterNode,
                        String compName,
                        String nodeKey,
                        Object value)

      Method description
      Parameters:
        `clusterNode` -
        `compName` -
        `nodeKey` -
        `value` -

    - #### toElement

          public tigase.xml.Element toElement()

      Method description
      Specified by:
        `toElement` in interface `RepositoryItem`
      Overrides:
        `toElement` in class `RepositoryItemAbstract`
      Returns:
        an XML Element with all the item initialization data.

    - #### toPropertyString

          public String toPropertyString()

      Method description
      Returns:
        a property string representing the repository item in a simplified form.

    - #### toString

          public String toString()

      Method description
      Overrides:
        `toString` in class `Object`

Copyright © 2015 "Tigase, Inc.". All rights reserved.