javax.cim

Class CIMInstance

public class CIMInstance extends Object implements CIMNamedElementInterface, Serializable

The CIMInstance class represents an instance of a CIM class.
Constructor Summary
CIMInstance(CIMObjectPath pName, CIMProperty<?>[] pProps)
Constructs a CIMInstance object using the name and properties specified.
Method Summary
CIMInstancederiveInstance(CIMObjectPath pPath)
Returns a CIMInstance with the updated CIMObjectPath.
CIMInstancederiveInstance(CIMProperty<?>[] pPropA)
Returns a CIMInstance with the updated values for the properties in pPropA.
CIMInstancefilterProperties(boolean pLocalOnly, boolean pIncludeClassOrigin, String[] pPropertyList)
This method returns a new CIMInstance with properties filtered according to the input parameters.
StringgetClassName()
Get the name of the class that instantiates this CIM instance.
CIMProperty<?>[]getKeys()
Get the key properties for this instance.
CIMObjectPathgetObjectPath()
Returns the CIMObjectPath that represents this instance.
CIMProperty<?>[]getProperties()
Retrieve an array of the properties for this instance.
CIMProperty<?>getProperty(int pIndex)
Get a class property by index.
CIMProperty<?>getProperty(String pName)
Returns the specified property.
CIMProperty<?>getProperty(String pName, String pOriginClass)
Returns the specified CIMProperty.
intgetPropertyCount()
Get the number of properties defined in this CIMClass.
ObjectgetPropertyValue(String name)
Returns the value of a property of this CIM Instance.

Constructor Detail

CIMInstance

public CIMInstance(CIMObjectPath pName, CIMProperty<?>[] pProps)
Constructs a CIMInstance object using the name and properties specified.

Parameters: pName - The objectpath for this CIMInstance pProps - The properties for this CIMInstance

Throws: IllegalArgumentException

name is null or name.getObjectName() is null.
[OPTIONAL] - If the key property values do not match the values in the property array. This is optional due to the cost of the verification. Some implementations may leave it up to the developer to ensure that the values match.

Method Detail

deriveInstance

public CIMInstance deriveInstance(CIMObjectPath pPath)
Returns a CIMInstance with the updated CIMObjectPath.

Parameters: pPath The complete CIMObjectPath for this instance.

Returns: CIMInstance a new CIMInstance with the updated CIMObjectPath.

deriveInstance

public CIMInstance deriveInstance(CIMProperty<?>[] pPropA)
Returns a CIMInstance with the updated values for the properties in pPropA. Any new properties are ignored.

Parameters: pPropA - The array of properties to update.

Returns: A new CIMInstance with the updated properties.

filterProperties

public CIMInstance filterProperties(boolean pLocalOnly, boolean pIncludeClassOrigin, String[] pPropertyList)
This method returns a new CIMInstance with properties filtered according to the input parameters. Inclusion of class origin and qualifiers can also be controlled.

Parameters: pLocalOnly - Include only the properties values that were instantiated in this instance. pIncludeClassOrigin - classOrigins are only included if true. pPropertyList

If the propertyList input parameter is not null, the members of the array define one or more Property names. The returned Instance does not include elements for any Properties missing from this list.
If the propertyList input parameter is an empty array this signifies that no Properties are included in each returned class.
If the propertyList input parameter is null this specifies that all Properties are included in each returned class.
If the propertyList contains duplicate elements or invalid property names, they are ignored.

Returns: CIMInstance matching the input filter.

getClassName

public String getClassName()
Get the name of the class that instantiates this CIM instance.

Returns: Name of class that instantiates this CIM instance.

getKeys

public CIMProperty<?>[] getKeys()
Get the key properties for this instance.

Returns: An array of key properties.

getObjectPath

public CIMObjectPath getObjectPath()
Returns the CIMObjectPath that represents this instance.

Returns: The CIMObjectPath that represents this instance.

getProperties

public CIMProperty<?>[] getProperties()
Retrieve an array of the properties for this instance.

Returns: An array of the CIM properties for this instance

getProperty

public CIMProperty<?> getProperty(int pIndex)
Get a class property by index.

Parameters: pIndex - The index of the class property to retrieve.

Returns: The CIMProperty at the specified index.

getProperty

public CIMProperty<?> getProperty(String pName)
Returns the specified property.

Parameters: pName - The text string for the name of the property.

Returns: The property requested or null if the property does not exist.

getProperty

public CIMProperty<?> getProperty(String pName, String pOriginClass)
Returns the specified CIMProperty.

Parameters: pName - The string name of the property to get. pOriginClass - (Optional) The string name of the class in which the property was defined.

Returns: null if the property does not exist, otherwise returns the CIM property.

getPropertyCount

public int getPropertyCount()
Get the number of properties defined in this CIMClass.

Returns: The number of properties defined in the CIMClass.

getPropertyValue

public Object getPropertyValue(String name)
Returns the value of a property of this CIM Instance.

Parameters: name - The name of the property.

Returns: The value for the specified property name or null if the property does not exist.

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