org.sblim.wbem.cim

Class CIMObjectPath

Implemented Interfaces:
Cloneable, Serializable

public class CIMObjectPath
extends java.lang.Object
implements Serializable, Cloneable

Points to the specified CIM Class or CIM Instance. The object path is a reference to a CIM Object, denoted by a host, namespace, object name, and keys (if the object is an instance). The namespace is handle in an absolute form with respect to the default namespace define for the CIMClient at the moment of its construction. root/lsissi:LSISSI_StorageSystem.Name="TheComputer",CreationClassName="LSISSI_StorageSystem" The namespace associated with it is root/lsissi. The classname associated with the object path is LSISSI_StorageSystem This object is uniquely identified by two key property values: Name="TheComputer" CreationClassName="LSISSI_StorageSystem" Note: host information is maintained, but is upto the application to resolve its address.

Field Summary

protected String
iToString

Constructor Summary

CIMObjectPath()
Constructs a CIMObjectPath.
CIMObjectPath(String pClassName)
Constructs a CIMObjectPath pointing to the specified ClassName.
CIMObjectPath(String pClassName, String pNamespace)
Constructs a CIMObjectPath with the specified ClassName, on the defined namespace.
CIMObjectPath(String pClassName, Vector pKeyValuePairs)
Constructs a CIMObjectPath with the specified CIM ClassName and the set of key values.

Method Summary

void
addKey(String pPropertyName, CIMValue pValue)
Add a new key to the property list
void
addKey(CIMProperty pProperty)
Adds the specified CIMProperty object as part of the keys.
Object
clone()
boolean
equals(Object obj)
boolean
equals(Object pObject, boolean pIgnoreClassOrigin)
Compares this object with the specified object for equality.
String
getHost()
Returns the host of the current object path.
CIMProperty
getKey(String pPropertyName)
Returns a keyed CIMProperty with the specified name.
Vector
getKeys()
Returns an vector with all the key properties from the CIMObjectPath.
String
getNameSpace()
Returns the namespace from this CIMObjectPath.
String
getObjectName()
Returns the object name to which this object path points.The object name is a CIMClass name.
int
hashCode()
static void
main(String[] args)
static CIMObjectPath
parse(String pObjectPath)
Deprecated.
void
removeAllKeys()
Removes all the key from this CIMObjectPath.
void
removeKey(String pPropertyName)
Removes the specified key from this CIMObjectPath.
void
setHost(String pHost)
Specifies the host name.
void
setKeys(Vector pKeys)
Sets the key properties for this CIMObjectPath.
void
setNameSpace(String pNamespace)
Specifies the namespace for this CIMObjectPath.
void
setNameSpace(CIMNameSpace pNamespace)
Specifies the namespace for this CIMObjectPath.
protected void
setNamespace(String pNamespace)
void
setObjectName(String pName)
Specifies the object name for this CIMObjectPath.
String
toString()
String
toString(boolean pIncludeHostname)
Returns the string representation of an object path.

Field Details

iToString

protected String iToString

Constructor Details

CIMObjectPath

public CIMObjectPath()
Constructs a CIMObjectPath.

CIMObjectPath

public CIMObjectPath(String pClassName)
Constructs a CIMObjectPath pointing to the specified ClassName.
Parameters:
pClassName -

CIMObjectPath

public CIMObjectPath(String pClassName,
                     String pNamespace)
            throws CIMException
Constructs a CIMObjectPath with the specified ClassName, on the defined namespace.
Parameters:
pClassName - a String representing the CIM ClassName.
pNamespace - a String which represents the namespace. Only forward slashes ('/') are allowed on the namespace. The namespace should not start or end with a '/', it will be automatically removed. As a result a namespace like "/root/cimv2", will result on "root/cimv2", and "/" would be translated into an empty namespace ("") Empty namespaces are handled as null namespace. Which in turn are replaced by the default namespace (assigned to the CIM client during its contruction) when operations are performed on objects with null namespaces.
Throws:
CIMException - CIM_ERR_INVALID_PARAMETER if a namespace is constructed with '\'.

CIMObjectPath

public CIMObjectPath(String pClassName,
                     Vector pKeyValuePairs)
Constructs a CIMObjectPath with the specified CIM ClassName and the set of key values. A null namespace is assigned to this object.
Parameters:
pClassName - a String representing the ClassName.
pKeyValuePairs - a Vector containing CIMProperties objects representing the keys for this CIMObjectPath.

Method Details

addKey

public void addKey(String pPropertyName,
                   CIMValue pValue)
Add a new key to the property list
Parameters:
pPropertyName -
pValue -

addKey

public void addKey(CIMProperty pProperty)
Adds the specified CIMProperty object as part of the keys.
Parameters:
pProperty -

clone

public Object clone()

equals

public boolean equals(Object obj)

equals

public boolean equals(Object pObject,
                      boolean pIgnoreClassOrigin)
Compares this object with the specified object for equality.
Parameters:
pObject - The other object
pIgnoreClassOrigin - if true the class origin is ignored
Returns:
true if pObject is equal to this, false otherwise

getHost

public String getHost()
Returns the host of the current object path.
Returns:
The host

getKey

public CIMProperty getKey(String pPropertyName)
Returns a keyed CIMProperty with the specified name.
Parameters:
pPropertyName - The name of the key property
Returns:
The key property

getKeys

public Vector getKeys()
Returns an vector with all the key properties from the CIMObjectPath. For performance reasons, this method returns the Vector object internally used. The application MUST deside when this object and the objects CIMProperties need to be cloned to prevend an sinconsistent state.
Returns:
The key vector

getNameSpace

public String getNameSpace()
Returns the namespace from this CIMObjectPath.
Returns:
The namespace

getObjectName

public String getObjectName()
Returns the object name to which this object path points.The object name is a CIMClass name.
Returns:
The object name

hashCode

public int hashCode()

main

public static void main(String[] args)

parse

public static CIMObjectPath parse(String pObjectPath)

Deprecated.

Returns a CIMObjectPath from the given string.
Parameters:
pObjectPath - a string with the following format //hostname/namespace_level1/namespace_level2/ClassName.key1="value1"[,key2="value2"] * for example //localhost/root/cimv2/CIM_ComputerSystem.Name="MyComputer" Note that values can represent CIM ObjectPath as well. Key values are represented
Returns:
The object path

removeAllKeys

public void removeAllKeys()
Removes all the key from this CIMObjectPath.

removeKey

public void removeKey(String pPropertyName)
Removes the specified key from this CIMObjectPath.
Parameters:
pPropertyName - a String representing the key name.

setHost

public void setHost(String pHost)
Specifies the host name.
Parameters:
pHost - The host name

setKeys

public void setKeys(Vector pKeys)
Sets the key properties for this CIMObjectPath.
Parameters:
pKeys - a vector containing CIMProperties.

setNameSpace

public void setNameSpace(String pNamespace)
Specifies the namespace for this CIMObjectPath.
Parameters:
pNamespace - The namespace

setNameSpace

public void setNameSpace(CIMNameSpace pNamespace)
Specifies the namespace for this CIMObjectPath.
Parameters:
pNamespace - The namespace

setNamespace

protected void setNamespace(String pNamespace)

setObjectName

public void setObjectName(String pName)
Specifies the object name for this CIMObjectPath.
Parameters:
pName - The object name

toString

public String toString()

toString

public String toString(boolean pIncludeHostname)
Returns the string representation of an object path. An object path which denotes an instance is represented as follow: namespace:classname or namespace:classname.key1="value2",key2="value2",...,keyn="valuen" An object path which denotes a class is denoted as follow: namespace:classname or namespace:classname=@ The namespace must contains forward slash, but does not starts or ends with a forward slash. Note that this representation does not include host information.
Parameters:
pIncludeHostname - specifies if host information should be included
Returns:
The string representation

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