Class ManagedObjectMetadataHelper
- java.lang.Object
-
- 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
Fields Modifier and Type Field and Description 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.static java.lang.String
PASSWORDUTIL_ALGORITHM
Contants for the property name for the AES password encryption support.static java.lang.String
PASSWORDUTIL_ALGORITHM_ATTR_AES
static java.lang.String
PLUGGABLE_SDK_ATTR_BITS
Constants for the SDK bits.static java.lang.String
PLUGGABLE_SDK_ATTR_LOCATION
Constants for the SDK location.static java.lang.String
PLUGGABLE_SDK_ATTR_PLATFORM
Constants for the SDK platform.static java.lang.String
PLUGGABLE_SDK_ATTR_VERSION
Constants for the SDK version.static java.lang.String
PLUGGABLE_SDK_PREFIX
Constant for the node pluggable SDK property prefix.
-
Constructor Summary
Constructors Constructor and Description ManagedObjectMetadataHelper(ManagedObjectMetadataAccessor metadataAccessor)
Constructs a ManagedObjectMetadataHelper instance.
-
Method Summary
Methods Modifier and Type Method and Description 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[]
getAvailableSDKsOnNode(java.lang.String nodeName)
This method lists names for all available SDKs.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.java.lang.String
getSDKBits(java.lang.String nodeName, java.lang.String sdkName)
This method obtains the bit information of a given SDK for a given node The method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.java.lang.String
getSDKLocation(java.lang.String nodeName, java.lang.String sdkName)
This method obtains the location of a given SDK for a given node The method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.java.util.Properties
getSDKPropertiesOnNode(java.lang.String nodeName, java.lang.String sdkName, java.lang.String[] sdkAttributes)
This method returns a list of the SDK properties available for the node specified.java.lang.String
getSDKVersion(java.lang.String nodeName, java.lang.String sdkName)
This method obtains the version of a given SDK for a given node The method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.boolean
isNodeOS400(java.lang.String nodeName)
Tests whether a given node is running on the OS/400 platform.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.
-
-
-
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".
-
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".
-
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".
-
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".
-
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".
-
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".
-
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".
-
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".
-
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
-
PLUGGABLE_SDK_PREFIX
public static final java.lang.String PLUGGABLE_SDK_PREFIX
Constant for the node pluggable SDK property prefix.The value for this constant is "com.ibm.websphere.sdk".
- See Also:
- Constant Field Values
-
PLUGGABLE_SDK_ATTR_VERSION
public static final java.lang.String PLUGGABLE_SDK_ATTR_VERSION
Constants for the SDK version.The value for this constant is "version".
- See Also:
- Constant Field Values
-
PLUGGABLE_SDK_ATTR_BITS
public static final java.lang.String PLUGGABLE_SDK_ATTR_BITS
Constants for the SDK bits.The value for this constant is "bits".
- See Also:
- Constant Field Values
-
PLUGGABLE_SDK_ATTR_LOCATION
public static final java.lang.String PLUGGABLE_SDK_ATTR_LOCATION
Constants for the SDK location.The value for this constant is "location".
- See Also:
- Constant Field Values
-
PLUGGABLE_SDK_ATTR_PLATFORM
public static final java.lang.String PLUGGABLE_SDK_ATTR_PLATFORM
Constants for the SDK platform.The value for this constant is "platform".
- See Also:
- Constant Field Values
-
PASSWORDUTIL_ALGORITHM
public static final java.lang.String PASSWORDUTIL_ALGORITHM
Contants for the property name for the AES password encryption support.The value for this constant is "aes".
- See Also:
- Constant Field Values
-
PASSWORDUTIL_ALGORITHM_ATTR_AES
public static final java.lang.String PASSWORDUTIL_ALGORITHM_ATTR_AES
- 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.
-
isNodeOS400
public boolean isNodeOS400(java.lang.String nodeName) throws AdminException
Tests whether a given node is running on the OS/400 platform.- Parameters:
nodeName
- The name of the node for the metadata used by this method.- Returns:
- true if node operating system is os400, 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.
-
getAvailableSDKsOnNode
public java.lang.String[] getAvailableSDKsOnNode(java.lang.String nodeName) throws AdminException
This method lists names for all available SDKs. Only those SDKs whose com.ibm.websphere.sdk.location properties points to a valid SDK installation are considered as a available SDK.The method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.
- Parameters:
nodeName
- The name of the node for the available SDKs properties returned by this method.- Returns:
- The names for all available SDKs 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
- The metadata for the specified node could not be obtained or an input value was invalid.
-
getSDKPropertiesOnNode
public java.util.Properties getSDKPropertiesOnNode(java.lang.String nodeName, java.lang.String sdkName, java.lang.String[] sdkAttributes) throws AdminException
This method returns a list of the SDK properties available for the node specified. The SDK properties returned can also be for a given SDK name or SDK attributes or both if a sdkName or sdkAttributes, or both are given.More than one SDK attributes can be specified and the valid SDK attributes are "version" "location" "bits" "platform"
The method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.
- Parameters:
nodeName
- The name of the node for the available SDKs properties returned by this method.sdkName
- The name of the SDK whose properties are returned by this method. For a null or empty string value, the method returns all properties for all available SDKs for a given node; otherwise, only the properties for the given SDK are returnedsdkAttributes
- The list of the SDK attributes. With a null or empty string value, the method returns all properties for all available SDKs for a given node; otherwise only the properties for the specified sdkAttributes are returned.- Returns:
- The properties for all installed and available SDKs for the specified node or null if no such property is found per the given filters.
- 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.
-
getSDKLocation
public java.lang.String getSDKLocation(java.lang.String nodeName, java.lang.String sdkName) throws AdminException
This method obtains the location of a given SDK for a given nodeThe method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.
- Parameters:
nodeName
- The name of the node for the SDK's location returned by this method.sdkName
- The name of the SDK for the SDK's location returned by this method.- Returns:
- returns the location of a given SDK or null if there is no such SDK found for a 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
- The metadata for the specified node could not be obtained or an input value was invalid.
-
getSDKVersion
public java.lang.String getSDKVersion(java.lang.String nodeName, java.lang.String sdkName) throws AdminException
This method obtains the version of a given SDK for a given nodeThe method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.
- Parameters:
nodeName
- The name of the node for the SDK's version returned by this method.sdkName
- The name of the SDK for the SDK's version returned by this method.- Returns:
- returns the version of a given SDK or null if there is no such SDK found for a 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
- The metadata for the specified node could not be obtained or an input value was invalid.
-
getSDKBits
public java.lang.String getSDKBits(java.lang.String nodeName, java.lang.String sdkName) throws AdminException
This method obtains the bit information of a given SDK for a given nodeThe method throws MetadataNotAvailableException for a Pre-V8 node on OS400 as there is no SDK property available for such a node.
- Parameters:
nodeName
- The name of the node for the SDK's bits returned by this method.sdkName
- The name of the SDK for the SDK's bits returned by this method.- Returns:
- returns the bit information (31 bits for zOS, 32 bits, or 64 bits) of a given SDK or null if there is no such SDK found for a 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
- The metadata for the specified node could not be obtained or an input value was invalid.
-
-