IBM WebSphere Application ServerTM
Release 8

com.ibm.wsspi.management.metadata
Interface ManagedObjectMetadataCollector

All Known Implementing Classes:
ManagedObjectMetadataCollectorImplBase

public interface ManagedObjectMetadataCollector

Instances of the ManagedObjectMetadataCollector interface are invoked by the Managed Object Metadata Collector Manager in order to gather all of the relevant information about this node. A ManagedObjectMetadataCollector implementation must be registered with the collector manager in order for it to participate in the metadata collection process.

The collector manager expects registered implementations of ManagedObjectMetadataCollector to have a constructor which accepts a java.util.Properties object. The Properties object will be populated with properties defined in the ManagedObjectMetadataCollectorManager interface. Collector implementations may need some of this information, such as the pathname to the WebSphere install root directory, the WebSphere profile root directory, the cell name, and the node name for which metadata is to be collected.

A WebSphere extension product can register a ManagedObjectMetadataCollector implementation by defining an extension point in the plugin.xml file for the Eclipse plug-in which contains the implementation. The format of a metadata collector extension point is shown below:

 <extension
       id="some arbitrary unique id"
       point="com.ibm.wsspi.extension.managed-object-metadata-collector">
       <metadata-collector>
          <collector-class>som.package.prefix.SomeCollectorImpl</collector-class>
       </metadata-collector>
 </extension>
 

A metadata collector is invoked in the context of some action. A collector is passed an action, action-specific parameters, and the working set of metadata properties. The set of metadata properties is associated with a specific profile. To process the action, the collector adds, updates, or deletes the properties it manages according to the action. It must not modify the setting for any property that is managed by another collector. The action originates from the caller of the collector manager. The collector manager does not do anything action-specific.

There are some pre-defined actions, but any WebSphere extension can define its own actions and initiate a collection in the context of those actions. If a metadata collector does not recognize an action, it should simply return without updating the metadata. All metadata collector implementations should recognize and properly handle the pre-defined actions.

Property name patterns

In order to avoid conflicts and to provide a grouping mechanism in the set of metadata properties for a node, the following property pattern is suggested:
<package prefix>.<property name>

where:

<package prefix>
is prefix for the product in the style of a Java package prefix, for example, com.ibm.websphere.
<property name>
is the specific property name. It can be any property name required by the product. For example, it could be a property setting queried by the product's Administrative Console plug-in.

An example of a fully-formed property name is:

com.ibm.websphere.nodeOperatingSystem

Note that some required properties are defined with a slightly different pattern. The property name for those properties is prefixed with a product prefix. Refer to the section on required properties for more details.

Required properties

There are two properties which must be created and managed by each metadata collector:
com.ibm.websphere.<product prefix>ProductVersion=<product version>
com.ibm.websphere.<product prefix>ProductShortName=<product short name>

where:

<product prefix>
is the product prefix used for property name formation. For example, the base product uses a prefix of "base". By convention, the prefix is composed of only lower-case characters.
<product version>
is the version number for the WebSphere extension product associated with a collector. The version number typically is composed of four whole numbers each separated by a period (for example, 6.0.1.2).
<product short name>
is the short name for the WebSphere extension product associated with a collector. The name should be the shortest name approved for the product because the name appears in Administrative Console panels where minumum usage of panel space is desired.

For example, the product version property name for the Base WebSphere product is:

com.ibm.websphere.baseProductVersion

If these properties are not set by a collector, the extension product's name and version number will not appear in Administrative Console panels which display this information.

Deployed features

The metadata property, com.ibm.websphere.deployed.features, is a list property read by the Administrative Console to determine which features have console plug-in's. The collector for each WebSphere extension product which implements a console plug-in should append an entry to this list property when it is invoked with an action of ManagedObjectMetadataCollector.ACTION_ADD_EXTENSION. Conversely, entries for an extension should be deleted from the list property when the action is ManagedObjectMetadataCollector.ACTION_REMOVE_EXTENSION.

A collector only needs to append to this property when the profile is for the deployment manager or for a standalone base node, but it does not hurt to simply append to the property unconditionally.

The format of the com.ibm.websphere.deployed.features property value is a list of feature directory names, each separated by a comma. An example of a value is:

com.ibm.ws.base_6.0.0.0,com.ibm.ws.j2ee_6.0.0.0,com.ibm.ws.uddi_6.0.0.0

A feature directory name is the directory name for a feature under the directory, WebSphereInstallRoot/features. In that directory, the feature.xml file should contain one or more Administrative Console plug-in declarations.

See Also:
ManagedObjectMetadataCollectorManager

Field Summary
static java.lang.String ACTION_ADD_EXTENSION
          The action constant for augmenting a profile with some WebSphere extension.
static java.lang.String ACTION_COLLECT_METADATA
          The action constant for executing a metadata collection.
static java.lang.String ACTION_REMOVE_EXTENSION
          The action constant for removing some WebSphere extension from a profile.
static java.lang.String PARAM_EXTENSION_ID
          Parameter for ACTION_ADD_EXTENSION and ACTION_REMOVE_EXTENSION actions which identifies the extension being added or removed.
 
Method Summary
 void updateMetadata(java.lang.String action, java.util.Hashtable actionParameters, java.util.Properties metadata)
          Updates the given set of metadata properties according to the specified action.
 

Field Detail

ACTION_ADD_EXTENSION

static final java.lang.String ACTION_ADD_EXTENSION
The action constant for augmenting a profile with some WebSphere extension. The pre-defined parameters for this action include PARAM_EXTENSION_ID. Typically, only the metadata collector for the specified extension will respond to this action by updating the node metadata. All other collectors will most likely ignore the call and simply return because the action does not affect the metadata for their extension.

The value of this constant is "Add Extension".

See Also:
Constant Field Values

ACTION_COLLECT_METADATA

static final java.lang.String ACTION_COLLECT_METADATA
The action constant for executing a metadata collection. There are no pre-defined parameters for this action.

The value of this constant is "Collect Metadata".

See Also:
Constant Field Values

ACTION_REMOVE_EXTENSION

static final java.lang.String ACTION_REMOVE_EXTENSION
The action constant for removing some WebSphere extension from a profile. The pre-defined parameters for this action include PARAM_EXTENSION_ID. Typically, only the metadata collector for the specified extension will respond to this action by updating the node metadata. All other collectors will most likely ignore the call and simply return because the action does not affect the metadata for their extension.

The value of this constant is "Remove Extension".

See Also:
Constant Field Values

PARAM_EXTENSION_ID

static final java.lang.String PARAM_EXTENSION_ID
Parameter for ACTION_ADD_EXTENSION and ACTION_REMOVE_EXTENSION actions which identifies the extension being added or removed. The parameter value is supplied by the extension when it invokes the Managed Object Metadata Collector Manager as a profile action during the installation or uninstallation process.

The value of this constant is "param.action.extension.id".

See Also:
Constant Field Values
Method Detail

updateMetadata

void updateMetadata(java.lang.String action,
                    java.util.Hashtable actionParameters,
                    java.util.Properties metadata)
                    throws java.lang.Exception
Updates the given set of metadata properties according to the specified action. The collector should update only those properties that it manages. It must not update properties managed by other collectors.

The collector should recognize and handle the pre-defined actions,

but any action value can be passed in. A collector should ignore any actions it does not recognize and simply return without updating the metadata. Similarly, a collector should do nothing if the extension id on an "add extension" or "remove extension" action does not match its extension ID.

Parameters:
action - The action being performed.
actionParameters - Any parameters specific to the action. A null value indicates that there are no action parameters set.
metadata - The node metadata to update according to the specified action.
Throws:
java.lang.Exception - The collector could not complete the action processing successfully.
See Also:
ACTION_ADD_EXTENSION, ACTION_REMOVE_EXTENSION, ACTION_COLLECT_METADATA

IBM WebSphere Application ServerTM
Release 8