javax.cim
Class CIMObjectPath

java.lang.Object
  extended byjavax.cim.CIMObjectPath
All Implemented Interfaces:
java.io.Serializable

public class CIMObjectPath
extends java.lang.Object
implements java.io.Serializable

This clas represents the CIM Object Path as 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/interop:My_ComputerSystem.Name=mycomputer, CreationClassName=My_ComputerSystem

has two parts:

Since:
JSR48 1.0.0
See Also:
Serialized Form

Constructor Summary
CIMObjectPath(java.lang.String objectPath)
          Constructs a CIM Object Path referencing a CIM element.
CIMObjectPath(java.lang.String objectName, java.lang.String namespace)
          Constructs a CIM Object Path referencing a CIM element along in the specified namespace.
CIMObjectPath(java.lang.String objectName, java.lang.String namespace, CIMProperty[] keys)
          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.
CIMObjectPath(java.lang.String host, java.lang.String namespace, java.lang.String objectName, CIMProperty[] keys)
          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(java.lang.String scheme, java.lang.String host, java.lang.String port, java.lang.String namespace, java.lang.String objectName, CIMProperty[] keys)
          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
 boolean equals(java.lang.Object o)
          Compares this CIM object path with the specified CIM object path for equality.
 boolean equalsModelPath(CIMObjectPath pModelPath)
           
 java.lang.String getHost()
          Gets the host.
 CIMProperty getKey(java.lang.String name)
          Gets a key property by name.
 CIMProperty[] getKeys()
          Gets all key properties.
 java.lang.String getNamespace()
          Gets the namespace.
 java.lang.String getObjectName()
          Gets the object name.
 java.lang.String getPort()
          Gets the the port on the host to which the connection was established.
 java.lang.String getScheme()
          Get the connection scheme.
 int hashCode()
          Computes the hash code for this object path.
 java.lang.String toString()
          Returns a String representation of the CIM object path.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMObjectPath

public CIMObjectPath(java.lang.String objectPath)
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.

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

CIMObjectPath

public CIMObjectPath(java.lang.String objectName,
                     java.lang.String namespace)
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.

Parameters:
objectName - The name of a CIM element.
namespace - The namespace relative to the current namespace.

CIMObjectPath

public CIMObjectPath(java.lang.String objectName,
                     java.lang.String namespace,
                     CIMProperty[] keys)
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.

Parameters:
objectName - The name of the CIM element referenced.
namespace - The namespace in which the CIM element is defined.
keys - CIMProperty[] The keys and their corresponding values that identify an instance of the CIM element.

CIMObjectPath

public CIMObjectPath(java.lang.String host,
                     java.lang.String namespace,
                     java.lang.String objectName,
                     CIMProperty[] keys)
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.

Parameters:
host - The host name or IP Address.
namespace - The namepace in which the CIM element is defined.
objectName - The name of the CIM element referenced.
keys - CIMProperty[] The keys and their corresponding values that identify an instance of the CIM element.

CIMObjectPath

public CIMObjectPath(java.lang.String scheme,
                     java.lang.String host,
                     java.lang.String port,
                     java.lang.String namespace,
                     java.lang.String objectName,
                     CIMProperty[] keys)
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.

Parameters:
scheme - The connection scheme to the host (e.g. http, https, ...)
host - The host name or IP Address.
port - The port on the host to which the connection was established.
namespace - The namepace in which the CIM element is defined.
objectName - The name of the CIM element referenced.
keys - CIMProperty[] The keys and their corresponding values that identify an instance of the CIM element.
Method Detail

equals

public boolean equals(java.lang.Object o)
Compares this CIM object path with the specified CIM object path for equality.

Parameters:
o - The object to compare to this CIM object path. Only the model paths are compared.
Returns:
boolean Returns true if the specified path references the same object, otherwise false is returned.

equalsModelPath

public boolean equalsModelPath(CIMObjectPath pModelPath)

getHost

public java.lang.String getHost()
Gets the host.

Returns:
String The name of the host

getKey

public CIMProperty getKey(java.lang.String name)
Gets a key property by name.

Parameters:
name - The name of the key property to retrieve.
Returns:
CIMProperty The CIMProperty with the given name, or null if it is not found.

getKeys

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

Returns:
CIMProperty[] The container of key properties.

getNamespace

public java.lang.String getNamespace()
Gets the namespace.

Returns:
String The name of the namespace

getObjectName

public java.lang.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:
String The name of this CIM element

getPort

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

Returns:
String The port on the host

getScheme

public java.lang.String getScheme()
Get the connection scheme.

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

hashCode

public int hashCode()
Computes the hash code for this object path.

Returns:
int The integer representing the hash code for this object path.

toString

public java.lang.String toString()
Returns a String representation of the CIM object path. This method is intended to be used only for debugging purposes. The format of the value returned may vary between implementations. The string returned may be empty but may not be null.

Returns:
String A string representation of this CIM object path


Java™ WBEM (JSR48) 1.0.0 API