IBM WebSphere Application ServerTM
Release 7

com.ibm.websphere.management.metadata
Class ManagedObjectMetadataHelper

java.lang.Object
  extended by com.ibm.websphere.management.metadata.ManagedObjectMetadataHelper

public class ManagedObjectMetadataHelper
extends java.lang.Object

This class contains convenience constants and methods to perform queries on base managed object metadata properties.


Field Summary
static java.lang.String BASE_WAS_APP_ACTIVATION_PLANS
          Constant for the property name for the base application activation plans.
static java.lang.String BASE_WAS_PRODUCT_SHORT_NAME
          Constant for the property name for the base product's short name.
static java.lang.String BASE_WAS_PRODUCT_VERSION
          Constant for the property name for the base product version.
static java.lang.String NODE_DEPLOYED_FEATURES
          Constant for the property name for the node deployed features.
static java.lang.String NODE_OS
          Constant for the property name for the operating system of the node associated with a set of metadata.
static java.lang.String NODE_OS_AIX
          Constant for the node operating system property value for AIX.
static java.lang.String NODE_OS_AS400
          Constant for the node operating system property value for OS/400.
static java.lang.String NODE_OS_HPUX
          Constant for the node operating system property value for HP-UX.
static java.lang.String NODE_OS_LINUX
          Constant for the node operating system property value for Linux.
static java.lang.String NODE_OS_SOLARIS
          Constant for the node operating system property value for Solaris.
static java.lang.String NODE_OS_WINDOWS
          Constant for the node operating system property value for Windows.
static java.lang.String NODE_OS_ZOS
          Constant for the node operating system property value for z/OS.
static java.lang.String NODE_SYSPLEX_NAME
          Constant for the property name for the node sysplex name.
 
Constructor Summary
ManagedObjectMetadataHelper(ManagedObjectMetadataAccessor metadataAccessor)
          Constructs a ManagedObjectMetadataHelper instance.
 
Method Summary
 int compareNodeVersion(java.lang.String nodeName, java.lang.String version)
          Compares the WebSphere version for a node with the input version.
 ManagedObjectMetadataAccessor getAccessor()
          This method returns the ManagedObjectMetadataAccessor instance used to construct this helper.
 java.lang.String getNodeBaseProductShortName(java.lang.String nodeName)
          Returns the version of WebSphere Base product installation for a given node.
 java.lang.String getNodeBaseProductVersion(java.lang.String nodeName)
          Returns the version of WebSphere Base product installation for a given node.
 java.util.ArrayList getNodeDeployedFeatures(java.lang.String nodeName)
          Returns the list of features for the given node.
 java.lang.String getNodeMajorVersion(java.lang.String nodeName)
          Returns the major version of WebSphere Base product installation for a given node.
 java.lang.String getNodeMinorVersion(java.lang.String nodeName)
          Returns the minor version of WebSphere installation for a given node.
 java.lang.String getNodePlatformOS(java.lang.String nodeName)
          Returns the operating system name for a given node.
 java.util.Properties getNodeProductsAndVersions(java.lang.String nodeName)
          Obtains all products and versions for installed products on the specified node (which can be a dmgr or a node).
 java.util.SortedMap getNodeProductVersions(java.lang.String nodeName)
          This method combines all product name and product versions contained the set of metadata properties for the specified node and stores them in the form of a map from product name to product version such that the mapping is sorted by product name.
 java.lang.String getNodeServiceVersion(java.lang.String nodeName)
          Returns the service version of WebSphere installation for a given node.
 java.lang.String getNodeSysplexName(java.lang.String nodeName)
          Returns the sysplex name for a given node.
 java.lang.String getNodeUpdateVersion(java.lang.String nodeName)
          Returns the update version of WebSphere installation for a given node.
 boolean isNodeZOS(java.lang.String nodeName)
          Tests whether a given node is running on the z/OS platform.
 java.util.ArrayList listRuntimeComponents(java.lang.String nodeName)
          This method lists all runtime components of a set of node metadata properties for all WebSphere Application Server Base and stack products for the specified node and stores them in the form of ArrayList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_WAS_PRODUCT_VERSION

public static final java.lang.String BASE_WAS_PRODUCT_VERSION
Constant for the property name for the base product version. Product version values are simple integers delimited by periods which include the major, minor, update, and service versions. For example, in version "6.1.2.3", the major version is "6", the minor version is "1", the update version is "2", and the service version is "3".

The base product version should always contain at least the major version, but lesser versions may not be included if they are not known. A base product version which is not fully qualified is most likely to occur on version 5 nodes which are members of a cell which has been migrated to version 6.

The value for this constant is "com.ibm.websphere.baseProductVersion".

See Also:
Constant Field Values

BASE_WAS_PRODUCT_SHORT_NAME

public static final java.lang.String BASE_WAS_PRODUCT_SHORT_NAME
Constant for the property name for the base product's short name. The short name is more convenient in space-limited applications than the product's full name.

The value for this constant is "com.ibm.websphere.baseProductShortName".

See Also:
Constant Field Values

BASE_WAS_APP_ACTIVATION_PLANS

public static final java.lang.String BASE_WAS_APP_ACTIVATION_PLANS
Constant for the property name for the base application activation plans.

The value for this constant is "com.ibm.websphere.baseRuntimeComponents".

See Also:
Constant Field Values

NODE_OS

public static final java.lang.String NODE_OS
Constant for the property name for the operating system of the node associated with a set of metadata.

The value for this constant is "com.ibm.websphere.nodeOperatingSystem".

See Also:
NODE_OS_AS400, NODE_OS_AIX, NODE_OS_HPUX, NODE_OS_LINUX, NODE_OS_SOLARIS, NODE_OS_WINDOWS, NODE_OS_ZOS, Constant Field Values

NODE_OS_AS400

public static final java.lang.String NODE_OS_AS400
Constant for the node operating system property value for OS/400.

The value for this constant is "os400".

See Also:
NODE_OS, NODE_OS_AIX, NODE_OS_HPUX, NODE_OS_LINUX, NODE_OS_SOLARIS, NODE_OS_WINDOWS, NODE_OS_ZOS, Constant Field Values

NODE_OS_AIX

public static final java.lang.String NODE_OS_AIX
Constant for the node operating system property value for AIX.

The value for this constant is "aix".

See Also:
NODE_OS, NODE_OS_AS400, NODE_OS_HPUX, NODE_OS_LINUX, NODE_OS_SOLARIS, NODE_OS_WINDOWS, NODE_OS_ZOS, Constant Field Values

NODE_OS_HPUX

public static final java.lang.String NODE_OS_HPUX
Constant for the node operating system property value for HP-UX.

The value for this constant is "hpux".

See Also:
NODE_OS, NODE_OS_AS400, NODE_OS_AIX, NODE_OS_LINUX, NODE_OS_SOLARIS, NODE_OS_WINDOWS, NODE_OS_ZOS, Constant Field Values

NODE_OS_LINUX

public static final java.lang.String NODE_OS_LINUX
Constant for the node operating system property value for Linux.

The value for this constant is "linux".

See Also:
NODE_OS, NODE_OS_AS400, NODE_OS_AIX, NODE_OS_HPUX, NODE_OS_SOLARIS, NODE_OS_WINDOWS, NODE_OS_ZOS, Constant Field Values

NODE_OS_SOLARIS

public static final java.lang.String NODE_OS_SOLARIS
Constant for the node operating system property value for Solaris.

The value for this constant is "solaris".

See Also:
NODE_OS, NODE_OS_AS400, NODE_OS_AIX, NODE_OS_HPUX, NODE_OS_LINUX, NODE_OS_WINDOWS, NODE_OS_ZOS, Constant Field Values

NODE_OS_WINDOWS

public static final java.lang.String NODE_OS_WINDOWS
Constant for the node operating system property value for Windows.

The value for this constant is "windows".

See Also:
NODE_OS, NODE_OS_AS400, NODE_OS_AIX, NODE_OS_HPUX, NODE_OS_LINUX, NODE_OS_SOLARIS, NODE_OS_ZOS, Constant Field Values

NODE_OS_ZOS

public static final java.lang.String NODE_OS_ZOS
Constant for the node operating system property value for z/OS.

The value for this constant is "os390".

See Also:
NODE_OS, NODE_OS_AS400, NODE_OS_AIX, NODE_OS_HPUX, NODE_OS_LINUX, NODE_OS_SOLARIS, NODE_OS_WINDOWS, Constant Field Values

NODE_SYSPLEX_NAME

public static final java.lang.String NODE_SYSPLEX_NAME
Constant for the property name for the node sysplex name. This value applies only to nodes which are running on the z/OS operating system platform. This property is not defined if the node operating system is anything other than z/OS.

The value for this constant is "com.ibm.websphere.nodeSysplexName".

See Also:
Constant Field Values

NODE_DEPLOYED_FEATURES

public static final java.lang.String NODE_DEPLOYED_FEATURES
Constant for the property name for the node deployed features. The value for this property is a comma-separated list of features that have been deployed on the corresponding node.

The value for this constant is "com.ibm.websphere.deployed.features".

See Also:
Constant Field Values
Constructor Detail

ManagedObjectMetadataHelper

public ManagedObjectMetadataHelper(ManagedObjectMetadataAccessor metadataAccessor)
                            throws AdminException
Constructs a ManagedObjectMetadataHelper instance. The instance uses the specified ManagedObjectMetadataAccessor reference to obtain the required metadata properties.

Parameters:
metadataAccessor - Managed object metadata accessor.
Throws:
AdminException - Could not create a ManagedObjectMetadataHelper, most likely due to an invalid argument.
Method Detail

getAccessor

public ManagedObjectMetadataAccessor getAccessor()
                                          throws AdminException
This method returns the ManagedObjectMetadataAccessor instance used to construct this helper.

Returns:
metadataAccessor Managed object metadata accessor used by this helper.
Throws:
AdminException - Could not complete requested operation.

getNodeMajorVersion

public java.lang.String getNodeMajorVersion(java.lang.String nodeName)
                                     throws AdminException
Returns the major version of WebSphere Base product installation for a given node.

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
WebSphere major version for the node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Either the base node version metadata does not exist in the set of metadata properties for the specified node, or the major version is not specified in the base node version metadata.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodeMinorVersion

public java.lang.String getNodeMinorVersion(java.lang.String nodeName)
                                     throws AdminException
Returns the minor version of WebSphere installation for a given node.

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
WebSphere minor version for the node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Either the base node version metadata does not exist in the set of metadata properties for the specified node, or the minor version is not specified in the base node version metadata.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodeUpdateVersion

public java.lang.String getNodeUpdateVersion(java.lang.String nodeName)
                                      throws AdminException
Returns the update version of WebSphere installation for a given node. For example, in a base product version of 6.1.2.3, the update version is "2".

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
WebSphere update version for the node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Either the base node version metadata does not exist in the set of metadata properties for the specified node, or the update version is not specified in the base node version metadata.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodeServiceVersion

public java.lang.String getNodeServiceVersion(java.lang.String nodeName)
                                       throws AdminException
Returns the service version of WebSphere installation for a given node. For example, in a base product version of 6.1.2.3, the update version is "3".

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
WebSphere service version for the node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Either the base node version metadata does not exist in the set of metadata properties for the specified node, or the service version is not specified in the base node version metadata.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodeBaseProductVersion

public java.lang.String getNodeBaseProductVersion(java.lang.String nodeName)
                                           throws AdminException
Returns the version of WebSphere Base product installation for a given node. This is concatenation of major and minor versions.

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
WebSphere version for the node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Requested metadata does not exist in the set of metadata properties for the specified node.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodeBaseProductShortName

public java.lang.String getNodeBaseProductShortName(java.lang.String nodeName)
                                             throws AdminException
Returns the version of WebSphere Base product installation for a given node. This is concatenation of major and minor versions.

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
WebSphere version for the node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Requested metadata does not exist in the set of metadata properties for the specified node.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

compareNodeVersion

public int compareNodeVersion(java.lang.String nodeName,
                              java.lang.String version)
                       throws AdminException
Compares the WebSphere version for a node with the input version.

Parameters:
nodeName - The name of the node for the metadata used by this method.
version - A String value of the WebSphere version to be compared.
Returns:
0 if node version matches the input version,
-1 if node version is smaller than the input version,
+1 is node version is higher than the input version.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Metadata required by this method does not exist in the set of metadata properties for the specified node.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

isNodeZOS

public boolean isNodeZOS(java.lang.String nodeName)
                  throws AdminException
Tests whether a given node is running on the z/OS platform.

Parameters:
nodeName - The name of the node for the metadata used by this method.
Returns:
true if node operating system is z/OS, false otherwise.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Metadata required by this method does not exist in the set of metadata properties for the specified node.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodePlatformOS

public java.lang.String getNodePlatformOS(java.lang.String nodeName)
                                   throws AdminException
Returns the operating system name for a given node.

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
The OS name of the given node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Requested metadata does not exist in the set of metadata properties for the specified node.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodeSysplexName

public java.lang.String getNodeSysplexName(java.lang.String nodeName)
                                    throws AdminException
Returns the sysplex name for a given node. This property only applies to nodes running on the z/OS operating system platform.

Parameters:
nodeName - The name of the node for the metadata returned by this method.
Returns:
The sysplex name of the given node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Requested metadata does not exist in the set of metadata properties for the specified node.
AdminException - The metadata for the specified node could not be obtained or an input value was invalid.

getNodeProductVersions

public java.util.SortedMap getNodeProductVersions(java.lang.String nodeName)
                                           throws AdminException
This method combines all product name and product versions contained the set of metadata properties for the specified node and stores them in the form of a map from product name to product version such that the mapping is sorted by product name.

Parameters:
nodeName - The name of the node for the version list returned by this method.
Returns:
A sorted map of product name to product version for all product names and versions in the metadata for the specified node.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Requested metadata does not exist in the set of metadata properties for the specified node.
AdminException - Metadata for the specified node could not be obtained or an input value was invalid.

getNodeDeployedFeatures

public java.util.ArrayList getNodeDeployedFeatures(java.lang.String nodeName)
                                            throws AdminException
Returns the list of features for the given node.

Parameters:
nodeName - The name of the node for the features list returned by this method.
Returns:
The features list for the specified node. Each feature is a String and is a separate element in the ArrayList.
Throws:
com.ibm.websphere.management.exception.MetadataNotAvailableException - Requested metadata does not exist in the set of metadata properties for the specified node.
AdminException - The metadata for the specified node could not be obtained or an input value was invalid.

getNodeProductsAndVersions

public java.util.Properties getNodeProductsAndVersions(java.lang.String nodeName)
                                                throws AdminException
Obtains all products and versions for installed products on the specified node (which can be a dmgr or a node). A product is the "short name" used in the product version field of node- metadata.properties and it becomes the key for a Properties object. For example, the product key for the field instance com.ibm.websphere.WebServicesFeaturePackProductVersion is "WebServices". The product version has the form "X.X.X.X".

Parameters:
nodeName - The name of the node for which data is to be retrieved.
Returns:
Properties. A Properties object. The key is the product name, and the associated value is the product version. These are the products installed on the node. Both the key and its associated value are String objects. The Properties object may he empty.
Throws:
AdminException - Metadata for specified node could not be obtained

listRuntimeComponents

public java.util.ArrayList listRuntimeComponents(java.lang.String nodeName)
                                          throws AdminException
This method lists all runtime components of a set of node metadata properties for all WebSphere Application Server Base and stack products for the specified node and stores them in the form of ArrayList.

Parameters:
nodeName - The name of the node for the runtime components list returned by this method.
Returns:
The runtime components list for all WebSphere Application Server Base and Stack products in the node metadata properties for the specified node. Each runtime component is a String and is a separate element in the ArrayList. An emptry ArrayList is returned if there is no runtime component found.
Throws:
AdminException - The metadata for the specified node could not be obtained or an input value was invalid.

IBM WebSphere Application ServerTM
Release 7