com.ibm.websphere.management.configservice

Class ConfigServiceProxy

  1. java.lang.Object
  2. extended bycom.ibm.websphere.management.configservice.ConfigServiceProxy
All implemented interfaces:
ConfigService

  1. public class ConfigServiceProxy
  2. extends java.lang.Object
  3. implements ConfigService
This class implements a proxy object of the remote ConfigService MBean in the server. As config service is implemented as a MBean in the server, all the method calls on the MBean have to go through invoke method which is cumbersome and error prone. This the a helper class to allow user using remote config service component more easily.

Constructor Summary

Constructor and Description
ConfigServiceProxy(AdminClient adminClient)
Constructor a proxy object.

Method Summary

Modifier and Type Method and Description
  1. void
addElement(Session inSession,javax.management.ObjectName configData,java.lang.String attribute,java.lang.Object element,int position)
  1. javax.management.ObjectName
createConfigData(Session inSession,javax.management.ObjectName parent,java.lang.String attributeName,java.lang.String type,javax.management.AttributeList attrList)
  1. javax.management.ObjectName
createConfigDataByTemplate(Session inSession,javax.management.ObjectName parent,java.lang.String attributeName,javax.management.AttributeList attrList,javax.management.ObjectName template)
  1. void
deleteConfigData(Session inSession,javax.management.ObjectName configData)
  1. void
discard(Session session)
  1. AdminClient
getAdminClient()
return the AdminClient object that this proxy uses to communicate with remote server.
  1. java.lang.Object
getAttribute(Session inSession,javax.management.ObjectName configData,java.lang.String attribute)
  1. java.lang.Object
getAttribute(Session session,javax.management.ObjectName configData,java.lang.String attribute,boolean recursive)
  1. javax.management.AttributeList
getAttributes(Session inSession,javax.management.ObjectName configData,java.lang.String[] attributes,boolean recursive)
  1. javax.management.AttributeList
getAttributesMetaInfo(java.lang.String configDataType)
  1. java.util.Map
getConflictDocuments(Session session)
  1. javax.management.ObjectName[]
getRelationship(Session inSession,javax.management.ObjectName configData,java.lang.String relationship)
  1. javax.management.AttributeList
getRelationships(Session inSession,javax.management.ObjectName configData,java.lang.String[] relationshipNames)
  1. javax.management.AttributeList
getRelationshipsMetaInfo(java.lang.String configObjectType)
  1. java.lang.String[]
getSupportedConfigObjectTypes()
returns the list of supported Config object types.
  1. java.lang.String[]
getUnsavedChanges(Session session)
  1. javax.management.ObjectName[]
queryConfigObjects(Session inSession,javax.management.ObjectName scope,javax.management.ObjectName name,javax.management.QueryExp query)
  1. javax.management.ObjectName[]
queryConfigObjectsAtCurrentScope(Session inSession,javax.management.ObjectName scope,java.lang.String type)
  1. javax.management.ObjectName[]
queryTemplates(Session inSession,java.lang.String type)
  1. void
removeElement(Session inSession,javax.management.ObjectName configData,java.lang.String attribute,java.lang.Object element)
  1. void
resetAttributes(Session inSession,javax.management.ObjectName configData,javax.management.AttributeList attrList)
  1. javax.management.ObjectName[]
resolve(Session inSession,javax.management.ObjectName scope,java.lang.String containmentPath)
  1. javax.management.ObjectName[]
resolve(Session inSession,java.lang.String containmentPath)
  1. void
save(Session session,boolean overwriteOnConflict)
  1. void
setAttributes(Session inSession,javax.management.ObjectName configData,javax.management.AttributeList attrList)
  1. void
setProperties(Session session,java.util.HashMap props)
  1. void
unsetAttributes(Session inSession,javax.management.ObjectName configData,java.lang.String[] attributes)
  1. ValidationResult
validate(Session session,javax.management.ObjectName scope)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConfigServiceProxy

  1. public ConfigServiceProxy(AdminClient adminClient)
  2. throws javax.management.InstanceNotFoundException
  3. ConnectorException
Constructor a proxy object.
Parameters:
adminClient - an AdminClient object that this proxy uses to communicate with remote server.
Throws:
javax.management.InstanceNotFoundException

Method Detail

getAdminClient

  1. public AdminClient getAdminClient( )
return the AdminClient object that this proxy uses to communicate with remote server.

setProperties

  1. public void setProperties(Session session,
  2. java.util.HashMap props)
  3. throws ConfigServiceException
  4. ConnectorException
Description copied from interface: ConfigService
Set properties that associates with the specified session.
Specified by:
Parameters:
session - session id.
props - the session property. SessionPropertyConstants for valid session property key.
Throws:

validate

  1. public ValidationResult validate( Session session,
  2. javax.management.ObjectName scope)
  3. throws ConfigServiceException
  4. ConnectorException
Description copied from interface: ConfigService
Validate the configuration within the specified scope.
Specified by:
validate in interface ConfigService
Parameters:
session - session id.
scope - the scope of validation. Scope can be the ObjectName of a cell, node or server. if null is specified, then whole repository will be validated. If any other type object is specified, use its nearest ancestor that can be a valid scope.
Returns:
the validation result.
Throws:

save

  1. public void save(Session session,
  2. boolean overwriteOnConflict)
  3. throws ConfigServiceException
  4. ConnectorException
Description copied from interface: ConfigService
Save the changes made in the session to config repository.
Specified by:
save in interface ConfigService
Parameters:
session - the session id.
overwriteOnConflict - overwrite if there is any conflict detected during saving.
Throws:

discard

  1. public void discard(Session session)
  2. throws ConfigServiceException
  3. ConnectorException
Description copied from interface: ConfigService
Discard changes made in the session since the last save or discard call.
Specified by:
discard in interface ConfigService
Parameters:
session - the session id.
Throws:

getUnsavedChanges

  1. public java.lang.String[] getUnsavedChanges( Session session)
  2. throws ConfigServiceException
  3. ConnectorException
Description copied from interface: ConfigService
Get all the documents that changed in the session after last save or discard call.
Specified by:
Parameters:
session - the session id.
Returns:
uris of modified documents.
Throws:

getConflictDocuments

  1. public java.util.Map getConflictDocuments( Session session)
  2. throws ConfigServiceException
  3. ConnectorException
Description copied from interface: ConfigService
Get the list of documents that have conflict updates made by other sessions.
Specified by:
Parameters:
session - the session id.
Returns:
a map of conflicted document updates. key is the document uri, and value is one of the integer defined as below:
  • 1 - document is modified by other session.
  • 2 - document is removed by other session.
  • 3 - document is added by other session.
Throws:

getSupportedConfigObjectTypes

  1. public java.lang.String[] getSupportedConfigObjectTypes( )
  2. throws ConfigServiceException
  3. ConnectorException
returns the list of supported Config object types.
Specified by:
Throws:

getAttributesMetaInfo

  1. public javax.management.AttributeList getAttributesMetaInfo( java.lang.String configDataType)
  2. throws ConfigServiceException
  3. ConnectorException
Description copied from interface: ConfigService
Get the meta information about the attributes of specified config data type. Follwing are list of attributes encoded in the returned meta info attribute list.
  • SystemAttributes._ATTRIBUTE_METAINFO_NAME
  • SystemAttributes._ATTRIBUTE_METAINFO_TYPE
  • SystemAttributes._ATTRIBUTE_METAINFO_IS_COLLECTION
  • SystemAttributes._ATTRIBUTE_METAINFO_IS_REQUIRED
  • SystemAttributes._ATTRIBUTE_METAINFO_DEFAULT_VALUE
  • SystemAttributes._ATTRIBUTE_METAINFO_ENUM_INFO
  • SystemAttributes._ATTRIBUTE_METAINFO_IS_OBJECT
  • SystemAttributes._ATTRIBUTE_METAINFO_IS_REFERENCE
Specified by:
Parameters:
configDataType - the type of the config data.
Returns:
the attribute information in a format of AttributeList. The attribute name is the attribute name and the attribute value is the detailed attribute meta information in a form of AttributeList.
Throws:

getRelationshipsMetaInfo

  1. public javax.management.AttributeList getRelationshipsMetaInfo( java.lang.String configObjectType)
  2. throws ConfigServiceException
  3. ConnectorException
Description copied from interface: ConfigService
Get the meta information about the relationships of specified config data type, such as the type of the relationship value, the multiplicity of the relationship value etc.
Specified by:
Parameters:
configObjectType - config ojbect type. It must be one of the types returned from getSupportedConfigObjectTypes method.
Returns:
the relationship information in a format of AttributeList. The attribute name is the relationship name and the attribute value is the detailed information regarding to this relationship in a form of AttributeList. Here are list of attributes in the relationship meta info:
  • SystemAttributes._ATTRIBUTE_METAINFO_NAME
  • SystemAttributes._ATTRIBUTE_METAINFO_TYPE
  • SystemAttributes._ATTRIBUTE_METAINFO_IS_COLLECTION
Throws:

queryConfigObjects

  1. public javax.management.ObjectName[] queryConfigObjects( Session inSession,
  2. javax.management.ObjectName scope,
  3. javax.management.ObjectName name,
  4. javax.management.QueryExp query)
  5. throws ConfigServiceException
  6. ConnectorException
Description copied from interface: ConfigService
The query method for config data in the config repository.
Specified by:
scope - the scope of query. It may be an ObjectName of a cell, node or server. Whole repository will be queried if scope is null.
name - the object name pattern that identifies MBeans to be returned. SystemAttributes._WEBSPHERE_CONFIG_DATA_TYPE is required to minimize the scope of query. SystemAttributes._WEBSPHERE_CONFIG_DATA_TYPE must be one the supported config object types it presents
query - The query expression to be applied for selecting config ojbects. If null is specified, no query expression will be applied for selecting config objects. Current implementation only supports null input.
Returns:
ObjecNames of config data that match the specified query criteria. Returns an empty array if no matching config data are found.
Throws:

queryConfigObjectsAtCurrentScope

  1. public javax.management.ObjectName[] queryConfigObjectsAtCurrentScope( Session inSession,
  2. javax.management.ObjectName scope,
  3. java.lang.String type)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
The query method for config data in the config repository
Specified by:
scope - the scope of query. It may be an ObjectName of a cell, node, server or cluster. It only queries the given scope
type - the config object type. It must be one the supported config object type.
Returns:
ObjecNames of config data that match the specified query criteria. Returns an empty array if no matching config data are found.
Throws:

queryTemplates

  1. public javax.management.ObjectName[] queryTemplates( Session inSession,
  2. java.lang.String type)
  3. throws ConfigServiceException
  4. ConnectorException
Description copied from interface: ConfigService
The query method for templates.
Specified by:
Parameters:
inSession - the seesion id.
type - the type of template.
Returns:
the ObjecNames of templates that match the specified type. Returns an empty array if no matching config data is found.
Throws:

resolve

  1. public javax.management.ObjectName[] resolve( Session inSession,
  2. java.lang.String containmentPath)
  3. throws ConfigServiceException
  4. ConnectorException
Description copied from interface: ConfigService
Resolve the config object based on the specified containment path.
Specified by:
resolve in interface ConfigService
Parameters:
inSession - the seesion id.
containmentPath - the containment path of config data. The format this arguemnt is type=name:type=name:... For example, Node=node1:Server=process1:Application=myAppServer. The type is the config data type, name if the config data name. The name field is optional. If name is not specified, then only type is matched. The name field may be double quoted. If the name field is not quoted, then the space around of value field will be trimed.
Returns:
an array of matched config data.
Throws:

resolve

  1. public javax.management.ObjectName[] resolve( Session inSession,
  2. javax.management.ObjectName scope,
  3. java.lang.String containmentPath)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
Resolve the config object based on the specified containment path.
Specified by:
resolve in interface ConfigService
Parameters:
inSession - the seesion id.
scope - the scope of resolve. It may be an ObjectName of a cell, node or server. Whole repository will be queried if scope is null
containmentPath - the containment path of config data. The format this arguemnt is type=name:type=name:... For example, Node=node1:Server=process1:Application=myAppServer. The type is the config data type, name if the config data name. The name field is optional. If name is not specified, then only type is matched. The name field may be double quoted. If the name field is not quoted, then the space around of value field will be trimed.
Returns:
an array of matched config data.
Throws:

createConfigDataByTemplate

  1. public javax.management.ObjectName createConfigDataByTemplate( Session inSession,
  2. javax.management.ObjectName parent,
  3. java.lang.String attributeName,
  4. javax.management.AttributeList attrList,
  5. javax.management.ObjectName template)
  6. throws ConfigServiceException
  7. ConnectorException
Description copied from interface: ConfigService
Create a config data based on specified template. If the attribute is a collection type attribute, this method will create the object and add the created object at the end of list. Note unlike the createConfigData method, we don't allow user specify type in this method as the type of template will be the type of created object.
Specified by:
Parameters:
inSession - the seesion id.
parent - the ObjectName of the parent config data.
attributeName - - the name of the relationship or attribute name between the parent and child config data.
attrList - - the AttributeList of created config object.
template - - the template to be used during creation. Use system default template if null is supplied. The template can be one of the template returned from queryTemplates call, but it can be a config object or data in the repository.
Returns:
the config data id of created config data.
Throws:

createConfigData

  1. public javax.management.ObjectName createConfigData( Session inSession,
  2. javax.management.ObjectName parent,
  3. java.lang.String attributeName,
  4. java.lang.String type,
  5. javax.management.AttributeList attrList)
  6. throws ConfigServiceException
  7. ConnectorException
Description copied from interface: ConfigService
create a Config Data. If the attribute is a collection type attribute, this method will create the object and add the newly created object at the end of list.
Specified by:
Parameters:
inSession - the seesion id.
parent - the id of the parent config data.
attributeName - the name of the relationship or attribute between the parent and child config data.
type - the type of created config data. The type can be the type of the attribute specified in the attribute meta info, it can also be one of the subtypes listed in the attribute _ATTRIBUTE_METAINFO_SUBTYPES in the meta info of the attribute.
attrList - the AttributeList of created config object.
Returns:
the config data id of created config object or config data.
Throws:

setAttributes

  1. public void setAttributes(Session inSession,
  2. javax.management.ObjectName configData,
  3. javax.management.AttributeList attrList)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
Modify attributes of the specified config data. Note this method does not change the attributes that are not specified in the attribute list.

Specified by:
Parameters:
inSession - the seesion id.
configData - - the ObjectName of the config data.
attrList - - the AttributeList that contains the list of attributes to be modified.
Throws:

addElement

  1. public void addElement(Session inSession,
  2. javax.management.ObjectName configData,
  3. java.lang.String attribute,
  4. java.lang.Object element,
  5. int position)
  6. throws ConfigServiceException
  7. ConnectorException
Description copied from interface: ConfigService
Add an element into a collection type attribute of a config data.
Specified by:
addElement in interface ConfigService
Parameters:
inSession - the seesion id.
configData - the ObjectName of the config data.
attribute - the name of the attribute.
element - the value of the element. It might be a primary data type, an attribute list or a object reference.
position - the position added in the list. Element will be appended at the end if -1.
Throws:

removeElement

  1. public void removeElement(Session inSession,
  2. javax.management.ObjectName configData,
  3. java.lang.String attribute,
  4. java.lang.Object element)
  5. throws ConfigServiceException
  6. ConnectorException
Description copied from interface: ConfigService
Remove an element from collection type attribute of a config data.
Specified by:
Parameters:
inSession - the seesion id
configData - the ObjectName of the config data.
attribute - the name of the attribute.
element - the ObjectName of the element. In case of primitive data type, it should be the element value itself.
Throws:

unsetAttributes

  1. public void unsetAttributes(Session inSession,
  2. javax.management.ObjectName configData,
  3. java.lang.String[] attributes)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
Clear the specified attributes from the config data.
Specified by:
Parameters:
inSession - the seesion id.
configData - the object name of the config data.
attributes - an array of attributes to be cleared.
Throws:

resetAttributes

  1. public void resetAttributes(Session inSession,
  2. javax.management.ObjectName configData,
  3. javax.management.AttributeList attrList)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
Reset the attributes for the config data. This method is basically do the same thing as the setAttributes call except that this method clears all the attributes value before call the setAttributes method.
Specified by:
Parameters:
inSession - the seesion id.
configData - the ObjectName of the config object.
attrList - the value of attribute list.
Throws:

getAttributes

  1. public javax.management.AttributeList getAttributes( Session inSession,
  2. javax.management.ObjectName configData,
  3. java.lang.String[] attributes,
  4. boolean recursive)
  5. throws ConfigServiceException
  6. ConnectorException
Description copied from interface: ConfigService
Get the attribute values of the config data.
Specified by:
Parameters:
inSession - the seesion id.
configData - ObjectName of config data.
attributes - an array of attribute names whose value should be returned. null means all the attributes.
recursive - returns a nested attribute list as the value of nested config data attribute if set to be true; return the ObjectName of nested config data as the value of nested config data attribute if set to be false.
Returns:
the attribute values of specified attributes in a form of AttributeList.
Throws:

getAttribute

  1. public java.lang.Object getAttribute( Session inSession,
  2. javax.management.ObjectName configData,
  3. java.lang.String attribute)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
Get the attribute value of the specified config data.
Specified by:
Parameters:
inSession - the seesion id.
configData - the ObjectName of the config data.
attribute - an attribute name.
Returns:
the attribute values of specified attribute.
Throws:

getAttribute

  1. public java.lang.Object getAttribute( Session session,
  2. javax.management.ObjectName configData,
  3. java.lang.String attribute,
  4. boolean recursive)
  5. throws ConfigServiceException
  6. ConnectorException
Description copied from interface: ConfigService
Get the attribute value of the specified config data.
Specified by:
Parameters:
session - the seesion id.
configData - the ObjectName of the config data.
attribute - an attribute name.
recursive - returns a attribute values as the value of nested config data attribute if set to be true; return the Object of config data if set to be false.
Returns:
the attribute values of specified attribute.
Throws:

deleteConfigData

  1. public void deleteConfigData(Session inSession,
  2. javax.management.ObjectName configData)
  3. throws ConfigServiceException
  4. ConnectorException
Description copied from interface: ConfigService
Delete the specified config data and its children. Also remove the reference from or to the config data to keep the integrity of the reference.
Specified by:
Parameters:
inSession - the seesion id.
configData - ObjectName of the config data.
Throws:

getRelationships

  1. public javax.management.AttributeList getRelationships( Session inSession,
  2. javax.management.ObjectName configData,
  3. java.lang.String[] relationshipNames)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
Get the named relationship values of specified config object.

This method skips invalid relationship name instead of throwing exception like getAttributes.

Specified by:
Parameters:
inSession - the seesion id.
configData - ObjectName of the config data.
relationshipNames - an array of the relationship names.
Returns:
the value of the specified relationship on the object as an AttributeList. The name of the Attribute is a relationship name and the value of the the Attribute is the value of the relationship which is represented in a form of ObjectName.
Throws:

getRelationship

  1. public javax.management.ObjectName[] getRelationship( Session inSession,
  2. javax.management.ObjectName configData,
  3. java.lang.String relationship)
  4. throws ConfigServiceException
  5. ConnectorException
Description copied from interface: ConfigService
Get the relationship value of the specified config object and relationship name.
Specified by:
Parameters:
inSession - the seesion id.
configData - ObjectName of the config data.
relationship - the name of the relationship.
Returns:
the value of the specified relationship on the object. The value of the relationship is represented as an array of ObjectName.
Throws: