Package org.sblim.wbem.cim
Class CIMObject
- java.lang.Object
-
- org.sblim.wbem.cim.CIMElement
-
- org.sblim.wbem.cim.CIMQualifiableElement
-
- org.sblim.wbem.cim.CIMObject
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
- Direct Known Subclasses:
CIMClass
,CIMInstance
public abstract class CIMObject extends CIMQualifiableElement
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.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, iName, OPENING_BRAKET
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addProperty(CIMProperty pProperty)
Adds a property to the specified object.java.util.Vector
getAllProperties()
Returns a list of CIMProperties for this CIMObject.java.util.Vector
getKeys()
Returns a list of key properties in this CIMObject.java.util.Vector
getProperties()
Returns a list of CIMProperties for this CIMObject.CIMProperty
getProperty(java.lang.String pPropertyName)
Gets the specified CIMProperty, if the property exists.CIMProperty
getProperty(java.lang.String pName, java.lang.String pOriginClass)
Gets the CIMProperty from the current CIMElement, if the property exits.protected CIMProperty
getProperty(CIMProperty pProperty)
CIMProperty
removeProperty(java.lang.String propertyName)
Remove the specified property from the object.abstract void
setObjectPath(CIMObjectPath pObjectPath)
Specifies the CIMObjectPath for this CIM Object.void
setProperties(java.util.Vector pProperties)
Replace the current properties from the object and add the new set of properties defined by the argument.CIMProperty
setProperty(java.lang.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 Detail
-
iObjectPath
protected CIMObjectPath iObjectPath
-
iAllProperties
protected java.util.Vector iAllProperties
-
-
Method Detail
-
getProperty
public CIMProperty getProperty(java.lang.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(java.lang.String pName, java.lang.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)
-
getProperties
public java.util.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.
-
getAllProperties
public java.util.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.
-
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
-
setProperties
public void setProperties(java.util.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(java.lang.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.
- Throws:
java.lang.IllegalArgumentException
- if the propertyName is null
-
removeProperty
public CIMProperty removeProperty(java.lang.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
- Throws:
java.lang.IllegalArgumentException
- if the property name is null
-
getKeys
public java.util.Vector getKeys()
Returns a list of key properties in this CIMObject.- Returns:
- a vector of cloned key properties.
-
setObjectPath
public abstract void setObjectPath(CIMObjectPath pObjectPath)
Specifies the CIMObjectPath for this CIM Object.- Parameters:
pObjectPath
- The object path
-
-