com.ibm.wsspi.management.metadata
Interface ManagedObjectMetadataCollector
- public interface ManagedObjectMetadataCollector
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.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
ACTION_ADD_EXTENSION
The action constant for augmenting a profile with some WebSphere extension.
|
|
ACTION_COLLECT_METADATA
The action constant for executing a metadata collection.
|
|
ACTION_REMOVE_EXTENSION
The action constant for removing some WebSphere extension from a profile.
|
|
PARAM_EXTENSION_ID
Parameter for ACTION_ADD_EXTENSION and ACTION_REMOVE_EXTENSION actions which
identifies the extension being added or removed.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
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
ACTION_COLLECT_METADATA
- static final java.lang.String ACTION_COLLECT_METADATA
The value of this constant is "Collect Metadata".
ACTION_REMOVE_EXTENSION
- static final java.lang.String ACTION_REMOVE_EXTENSION
The value of this constant is "Remove Extension".
PARAM_EXTENSION_ID
- static final java.lang.String PARAM_EXTENSION_ID
The value of this constant is "param.action.extension.id".
Method Detail
updateMetadata
- void updateMetadata(java.lang.String action,
- java.util.Hashtable actionParameters,
- java.util.Properties metadata)
- throws java.lang.Exception
The collector should recognize and handle the pre-defined actions,
- ManagedObjectMetadataCollector.ACTION_ADD_EXTENSION,
- ManagedObjectMetadataCollector.ACTION_REMOVE_EXTENSION, and
- ManagedObjectMetadataCollector.ACTION_COLLECT_METADATA,
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.
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. java.lang.Exception
- The collector could not complete the action processing successfully.
The value of this constant is "Add Extension".