org.sblim.wbem.cim

Class CIMObject

Implemented Interfaces:
Comparable, Serializable
Known Direct Subclasses:
CIMClass, CIMInstance

public abstract class CIMObject
extends CIMQualifiableElement

CIMObject.java (C) Copyright IBM Corp. 2005, 2006 THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. You can obtain a current copy of the Common Public License from http://www.opensource.org/licenses/cpl1.0.php

Field Summary

protected Vector
iAllProperties
protected CIMObjectPath
iObjectPath

Fields inherited from class org.sblim.wbem.cim.CIMQualifiableElement

iQualifiers

Fields inherited from class org.sblim.wbem.cim.CIMElement

CLOSING_BRAKET, EMPTY, OPENING_BRAKET, iName

Constructor Summary

CIMObject()
CIMObject(String pName)

Method Summary

void
addProperty(CIMProperty pProperty)
Adds a property to the specified object.
Vector
getAllProperties()
Returns a list of CIMProperties for this CIMObject.
Vector
getKeys()
Returns a list of key properties in this CIMObject.
Vector
getProperties()
Returns a list of CIMProperties for this CIMObject.
CIMProperty
getProperty(String pPropertyName)
Gets the specified CIMProperty, if the property exists.
CIMProperty
getProperty(String pName, String pOriginClass)
Gets the CIMProperty from the current CIMElement, if the property exits.
protected CIMProperty
getProperty(CIMProperty pProperty)
CIMProperty
removeProperty(String propertyName)
Remove the specified property from the object.
abstract void
setObjectPath(CIMObjectPath pObjectPath)
Specifies the CIMObjectPath for this CIM Object.
void
setProperties(Vector pProperties)
Replace the current properties from the object and add the new set of properties defined by the argument.
CIMProperty
setProperty(String pPropertyName, CIMValue pValue)
Sets the value for the property, if the property already exists, otherwise create a new property with the specified name, and sets assigns the especified value to it.

Methods inherited from class org.sblim.wbem.cim.CIMQualifiableElement

addQualifier, getQualifier, getQualifiers, removeQualifier, setQualifiers

Methods inherited from class org.sblim.wbem.cim.CIMElement

appendTab, assign, compareTo, equals, getName, lessThan, setName, vectorToMOFString, vectorToMOFString, vectorToMOFString

Field Details

iAllProperties

protected Vector iAllProperties

iObjectPath

protected CIMObjectPath iObjectPath

Constructor Details

CIMObject

protected CIMObject()

CIMObject

protected CIMObject(String pName)

Method Details

addProperty

public void addProperty(CIMProperty pProperty)
Adds a property to the specified object. If the property already exits in the object, the property will not be modified. No exception is thrown.
Parameters:
pProperty - property to be added

getAllProperties

public Vector getAllProperties()
Returns a list of CIMProperties for this CIMObject. For performance reasons the method returns the internal property vector of the object. It is important to note that any modification to this vector may affect the consistency of the CIMMethod therefore, should be avoided. The application should decide when the vector needs to be cloned or not to preserve a consistent internal state.
Returns:
internal vector of CIMProperties for this CIMObject.

getKeys

public Vector getKeys()
Returns a list of key properties in this CIMObject.
Returns:
a vector of cloned key properties.

getProperties

public Vector getProperties()
Returns a list of CIMProperties for this CIMObject. For performance reasons the method returns a vector which provides direct access to the properties of the object. It is important to note that any modification to this vector may affect the consistency of the CIMMethod therefore, should be avoided. The application should decide when the vector needs to be cloned or not to preserve a consistent internal state.
Returns:
a vector of CIMProperties for this CIMObject.

getProperty

public CIMProperty getProperty(String pPropertyName)
Gets the specified CIMProperty, if the property exists.
Parameters:
pPropertyName - the name of the CIMProperty, with the following format "propName" or "propName.orignClass".
Returns:
null if the property does not exists, otherwise returns the CIMProperty.

getProperty

public CIMProperty getProperty(String pName,
                               String pOriginClass)
Gets the CIMProperty from the current CIMElement, if the property exits.
Parameters:
pName - a string which specifies the property name.
pOriginClass - a String which specifies the originClass.
Returns:
null if the property exits, otherwise returns the CIMProperty.

getProperty

protected CIMProperty getProperty(CIMProperty pProperty)

removeProperty

public CIMProperty removeProperty(String propertyName)
Remove the specified property from the object. If the object does not contains the specified.
Parameters:
propertyName - The property's name
Returns:
The removed property

setObjectPath

public abstract void setObjectPath(CIMObjectPath pObjectPath)
Specifies the CIMObjectPath for this CIM Object.
Parameters:
pObjectPath - The object path

setProperties

public void setProperties(Vector pProperties)
Replace the current properties from the object and add the new set of properties defined by the argument. If any property is repeated, only the first instance of it will be added.
Parameters:
pProperties -

setProperty

public CIMProperty setProperty(String pPropertyName,
                               CIMValue pValue)
Sets the value for the property, if the property already exists, otherwise create a new property with the specified name, and sets assigns the especified value to it.
Parameters:
pPropertyName - A string specifing the property name.
pValue - CIMValue that will be assigned to the property. It may be null.
Returns:
if the property already exists, returns the modified property, otherwise returns the new property that was created.

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