javax.cim

Class CIMObjectPath

public class CIMObjectPath extends Object implements Serializable

This class represents the CIM Object Path as defined by the Distributed Management Task Force (DMTF) CIM Infrastructure Specification (DSP004). In order to uniquely identify a given object, a CIM object path includes the namespace, object name and keys (if the object is an instance).

For example, the object path:

http://myserver/root/cimv2:My_ComputerSystem.Name=mycomputer, CreationClassName=My_ComputerSystem

has two parts:

Constructor Summary
CIMObjectPath(String pObjectPath)
Constructs a CIM Object Path referencing a CIM element.
CIMObjectPath(String pObjectName, String pNamespace)
Constructs a CIM Object Path referencing a CIM element along in the specified namespace.
CIMObjectPath(String pObjectName, String pNamespace, CIMProperty<?>[] pKeys)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace and identified by the given key properties and their corresponding values.

NOTE: When using this API against OpenPegasus CIMOM, do not provide the preceding '/' in the namespace parameter.
CIMObjectPath(String pHost, String pNamespace, String pObjectName, CIMProperty<?>[] pKeys)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace on the specified host and identified by the given key properties and their corresponding values.

NOTE: When using this API against OpenPegasus CIMOM, do not provide the preceding '/' in the namespace parameter.
CIMObjectPath(String pScheme, String pHost, String pPort, String pNamespace, String pObjectName, CIMProperty<?>[] pKeys)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace on the specified host and identified by the given key properties and their corresponding values.
CIMObjectPath(String pScheme, String pHost, String pPort, String pNamespace, String pObjectName, CIMProperty<?>[] pKeys, String pXmlSchemaName)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace on the specified host and identified by the given key properties and their corresponding values.
Method Summary
booleanequalsModelPath(CIMObjectPath pModelPath)
Compares this model path with the specified model path for equality.
StringgetHost()
Gets the host.
CIMProperty<?>getKey(String pName)
Gets a key property by name.
CIMProperty<?>[]getKeys()
Gets all key properties.
StringgetNamespace()
Gets the namespace.
StringgetObjectName()
Gets the object name.
StringgetPort()
Gets the the port on the host to which the connection was established.
StringgetScheme()
Get the connection scheme.
StringgetXmlSchemaName()
Get the XML Schema for this object (optional).

Constructor Detail

CIMObjectPath

public CIMObjectPath(String pObjectPath)
Constructs a CIM Object Path referencing a CIM element. The name can refer to a class name or a qualifier type name, depending on the particular CIM element identified. In order to refer to an instance, the key properties and their corresponding values must be set.

Should be able to handle strings, like:
http://myserver.org:5066/root/cimv2:My_ComputerSystem.Name="mycmp",CreationClassName="My_ComputerSystem"
http://myserver.org/root/cimv2:My_ComputerSystem.Name="mycmp",CreationClassName="My_ComputerSystem"
//myserver.org/root/cimv2:My_ComputerSystem
/root/cimv2:My_ComputerSystem

Parameters: pObjectPath The string representation of an object path for a CIM element that will be parsed and used to initialize the object.

CIMObjectPath

public CIMObjectPath(String pObjectName, String pNamespace)
Constructs a CIM Object Path referencing a CIM element along in the specified namespace. The name can refer to a class name or a qualifier type name, depending on the particular CIM element identified. In order to refer to an instance, key properties and their corresponding values must be set.

NOTE: When using this API against OpenPegasus CIMOM, do not provide the preceding '/' in the namespace parameter. For example, OpenPegasus will accept "root/cimv2" as a namespace but will not accept "/root/cimv2".

Parameters: pObjectName The name of a CIM element. pNamespace The namespace relative to the current namespace.

CIMObjectPath

public CIMObjectPath(String pObjectName, String pNamespace, CIMProperty<?>[] pKeys)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace and identified by the given key properties and their corresponding values.

NOTE: When using this API against OpenPegasus CIMOM, do not provide the preceding '/' in the namespace parameter. For example, OpenPegasus will accept "root/cimv2" as a namespace but will not accept "/root/cimv2".

Parameters: pObjectName The name of the CIM element referenced. pNamespace The namespace in which the CIM element is defined. pKeys The keys and their corresponding values that identify an instance of the CIM element.

CIMObjectPath

public CIMObjectPath(String pHost, String pNamespace, String pObjectName, CIMProperty<?>[] pKeys)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace on the specified host and identified by the given key properties and their corresponding values.

NOTE: When using this API against OpenPegasus CIMOM, do not provide the preceding '/' in the namespace parameter. For example, OpenPegasus will accept "root/cimv2" as a namespace but will not accept "/root/cimv2".

Parameters: pHost The host name or IP Address. pNamespace The namepace in which the CIM element is defined. pObjectName The name of the CIM element referenced. pKeys The keys and their corresponding values that identify an instance of the CIM element.

CIMObjectPath

public CIMObjectPath(String pScheme, String pHost, String pPort, String pNamespace, String pObjectName, CIMProperty<?>[] pKeys)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace on the specified host and identified by the given key properties and their corresponding values. Note that the connection mechanism and the port number to which a client connection is established are also specified.

NOTE: When using this API against OpenPegasus CIMOM, do not provide the preceding '/' in the namespace parameter. For example, OpenPegasus will accept "root/cimv2" as a namespace but will not accept "/root/cimv2".

Parameters: pScheme The connection scheme to the host (e.g. http, https, ...) pHost The host name or IP Address. pPort The port on the host to which the connection was established. pNamespace The namepace in which the CIM element is defined. pObjectName The name of the CIM element referenced. pKeys The keys and their corresponding values that identify an instance of the CIM element.

CIMObjectPath

public CIMObjectPath(String pScheme, String pHost, String pPort, String pNamespace, String pObjectName, CIMProperty<?>[] pKeys, String pXmlSchemaName)
Constructs a CIM Object Path referencing an instance of the specified CIM element as defined in the specified namespace on the specified host and identified by the given key properties and their corresponding values. Note that the connection mechanism and the port number to which a client connection is established are also specified.

NOTE: When using this API against OpenPegasus CIMOM, do not provide the preceding '/' in the namespace parameter. For example, OpenPegasus will accept "root/cimv2" as a namespace but will not accept "/root/cimv2".

Parameters: pScheme The connection scheme to the host (e.g. http, https, ...) pHost The host name or IP Address. pPort The port on the host to which the connection was established. pNamespace The namepace in which the CIM element is defined. pObjectName The name of the CIM element referenced. pKeys The keys and their corresponding values that identify an instance of the CIM element. pXmlSchemaName The name of the XML Schema for this object. This is only needed for protocols that require this information.

Method Detail

equalsModelPath

public boolean equalsModelPath(CIMObjectPath pModelPath)
Compares this model path with the specified model path for equality.

Parameters: pModelPath The object to compare.

Returns: true if the specified path references the same object, otherwise false.

getHost

public String getHost()
Gets the host.

Returns: The name of the host.

getKey

public CIMProperty<?> getKey(String pName)
Gets a key property by name.

Parameters: pName The name of the key property to retrieve.

Returns: The CIMProperty with the given name, or null if it is not found.

getKeys

public CIMProperty<?>[] getKeys()
Gets all key properties.

Returns: The container of key properties.

getNamespace

public String getNamespace()
Gets the namespace.

Returns: The name of the namespace.

getObjectName

public String getObjectName()
Gets the object name. Depending on the type of CIM element referenced, this may be either a class name or a qualifier type name.

Returns: The name of this CIM element.

getPort

public String getPort()
Gets the the port on the host to which the connection was established.

Returns: The port on the host.

getScheme

public String getScheme()
Get the connection scheme.

Returns: The connection scheme (e.g. http, https,...)

getXmlSchemaName

public String getXmlSchemaName()
Get the XML Schema for this object (optional).

Returns: The XML Schema name.

Copyright © 2005, 2010 IBM Corporation. All Rights Reserved.