com.ibm.websphere.management.configservice

Class ConfigServiceHelper

  1. java.lang.Object
  2. extended bycom.ibm.websphere.management.configservice.ConfigServiceHelper

  1. public class ConfigServiceHelper
  2. extends java.lang.Object
This class provides various helper methods to build data structures that are used by config service component such as ObjectName, ConfigDataId, and manipulate generic AttributeList data structure.

Constructor Summary

Constructor and Description
ConfigServiceHelper()

Method Summary

Modifier and Type Method and Description
  1. static
  2. boolean
checkIfNameValid(java.lang.String aName)
Check if the specified name is a valid object name.
  1. static
  2. ConfigDataId
convertObjectNameToConfigDataId(javax.management.ObjectName on)
Converts an ObjectName of dynamic MBean to the id of its corresponding Config data.
  1. static
  2. javax.management.ObjectName
createObjectName(javax.management.AttributeList attrList)
Create an object name from the specified attribute list, the returned ObjectName can be used to identify the config data represented by the specified attribute list, then be used in subsequent calls to ConfigService to further query or modify this config data.
  1. static
  2. javax.management.ObjectName
createObjectName(ConfigDataId id)
Create an object name from the specified config data id.
  1. static
  2. javax.management.ObjectName
createObjectName(ConfigDataId id,java.lang.String type)
Create an object name from the specified config data id and config data type.
  1. static
  2. javax.management.ObjectName
createObjectName(ConfigDataId id,java.lang.String type,java.lang.String displayName)
Create an object name from specified config data id, type and name.
  1. static
  2. javax.management.ObjectName
createObjectName(java.util.Properties props)
create ObjectName using properties
  1. static
  2. javax.management.ObjectName
createObjectName(java.lang.String domain,java.util.Properties props)
  1. static
  2. java.lang.Object
getAttributeValue(javax.management.AttributeList attrList,java.lang.String name)
Return the value of the named attribute.
  1. static
  2. ConfigDataId
getConfigDataId(javax.management.AttributeList attrList)
Assign the config data id for the specified attribute list.
  1. static
  2. ConfigDataId
getConfigDataId(javax.management.ObjectName objName)
Get the config data id information from the specified ObjectName.
  1. static
  2. java.lang.String
getConfigDataType(javax.management.ObjectName objName)
Get the config data type from specified ObjectName
  1. static
  2. java.lang.String
getDisplayName(javax.management.ObjectName objName)
Get the config data name from specified ObjectName
  1. static
  2. java.util.Properties
getObjectLocation(javax.management.ObjectName objName)
Get the location of the config data.
  1. static
  2. javax.management.AttributeList
lookup(javax.management.AttributeList attrList,ConfigDataId id)
Search through the attribute list recursively and look up the attribute list with the specified config data id.
  1. static
  2. java.lang.Object
removeAttribute(javax.management.AttributeList attrList,java.lang.String name)
Delete the specified attribute from attribute list.
  1. static
  2. void
setAttributeValue(javax.management.AttributeList attrList,java.lang.String name,java.lang.Object value)
Set the attribute value for the specified attribute.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConfigServiceHelper

  1. public ConfigServiceHelper()

Method Detail

getConfigDataId

  1. public static ConfigDataId getConfigDataId( javax.management.AttributeList attrList)
Assign the config data id for the specified attribute list. If the config id attribute exist already then just return the config data id, otherwise this method assign a local ref id.

getAttributeValue

  1. public static java.lang.Object getAttributeValue( javax.management.AttributeList attrList,
  2. java.lang.String name)
  3. throws javax.management.AttributeNotFoundException
Return the value of the named attribute.
Parameters:
attrList - the attribute list.
name - the name of attribute.
Throws:
javax.management.AttributeNotFoundException

setAttributeValue

  1. public static void setAttributeValue( javax.management.AttributeList attrList,
  2. java.lang.String name,
  3. java.lang.Object value)
Set the attribute value for the specified attribute. If the attribute exists, then this method overwrites the attribute value, otherwise it add the attribute to the attribute list.
Parameters:
attrList - the attribute list.
name - the name of attribute.
value - the value of the attribute.

removeAttribute

  1. public static java.lang.Object removeAttribute( javax.management.AttributeList attrList,
  2. java.lang.String name)
Delete the specified attribute from attribute list.
Returns:
the value of the removed attribute.

lookup

  1. public static javax.management.AttributeList lookup( javax.management.AttributeList attrList,
  2. ConfigDataId id)
Search through the attribute list recursively and look up the attribute list with the specified config data id.
Parameters:
attrList - the attribute list to be checked.
id - the config data id.
Returns:
the nested attribute list that matches the id, null if it is not found.

createObjectName

  1. public static javax.management.ObjectName createObjectName( javax.management.AttributeList attrList)
Create an object name from the specified attribute list, the returned ObjectName can be used to identify the config data represented by the specified attribute list, then be used in subsequent calls to ConfigService to further query or modify this config data.

createObjectName

  1. public static javax.management.ObjectName createObjectName( ConfigDataId id)
Create an object name from the specified config data id.

createObjectName

  1. public static javax.management.ObjectName createObjectName( ConfigDataId id,
  2. java.lang.String type)
Create an object name from the specified config data id and config data type.

createObjectName

  1. public static javax.management.ObjectName createObjectName( ConfigDataId id,
  2. java.lang.String type,
  3. java.lang.String displayName)
Create an object name from specified config data id, type and name.

getConfigDataId

  1. public static ConfigDataId getConfigDataId( javax.management.ObjectName objName)
Get the config data id information from the specified ObjectName.

getConfigDataType

  1. public static java.lang.String getConfigDataType( javax.management.ObjectName objName)
Get the config data type from specified ObjectName

getDisplayName

  1. public static java.lang.String getDisplayName( javax.management.ObjectName objName)
Get the config data name from specified ObjectName

checkIfNameValid

  1. public static boolean checkIfNameValid( java.lang.String aName)
Check if the specified name is a valid object name.

getObjectLocation

  1. public static java.util.Properties getObjectLocation( javax.management.ObjectName objName)
Get the location of the config data.
Parameters:
objName - object name of the object.
Returns:
a Properties object holds the location for the config data. The possible keys are "cell", "node", "server", "cluster", "application", "versions", "serverTypes".

convertObjectNameToConfigDataId

  1. public static ConfigDataId convertObjectNameToConfigDataId( javax.management.ObjectName on)
Converts an ObjectName of dynamic MBean to the id of its corresponding Config data. Note this method doesn't check the existance of ObjectName or config data id. This method just does the format conversion. User can call the queryConfigObjects method on ConfigService to verify if the config data really exists.
Parameters:
on - the ObjectName of a dynamic MBean.
Returns:
the id of MBean's Config data which can be used to query its detailed configuration information with ConfigService API.

createObjectName

  1. public static javax.management.ObjectName createObjectName( java.util.Properties props)
  2. throws javax.management.MalformedObjectNameException
create ObjectName using properties
Throws:
javax.management.MalformedObjectNameException

createObjectName

  1. public static javax.management.ObjectName createObjectName( java.lang.String domain,
  2. java.util.Properties props)
  3. throws javax.management.MalformedObjectNameException
Throws:
javax.management.MalformedObjectNameException