org.sblim.wbem.cim

Class CIMInstance

Implemented Interfaces:
Comparable, Serializable

public class CIMInstance
extends CIMObject
implements Serializable

CIMInstance.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 String
iAlias

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

iAllProperties, 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

CIMInstance()
Constructs an object of a CIMInstance.
CIMInstance(CIMObjectPath pObjectPath)
Constructs an object of a CIMInstance

Method Summary

Object
clone()
boolean
equals(Object o)
String
getAlias()
Returns the alias name for the instance
String
getClassName()
Returns the class name of the instance.
Vector
getKeyValuePairs()
Returns a list of key properties in this CIMInstance.
String
getName()
Deprecated. instances don't have names.
CIMObjectPath
getObjectPath()
Gets the CIMObjectsPath for this CIMInstance.
int
hashCode()
static void
main(String[] args)
void
setAlias(String pAliasName)
Specifies the alias for this instance.
void
setClassName(String pClassname)
Specifies the classname for this CIMInstance.
void
setName(String pName)
Specifies the name for this CIMInstance.
void
setObjectPath(CIMObjectPath pObjectPath)
Specifies the CIMObjectPath for this CIMInstance.
String
toMOF()
Returns the MOF representation of this CIMInstance.
String
toString()
void
updateProperty(CIMProperty pProperty)
Updates the specified CIMProperty.
void
updatePropertyValue(Vector pProperties)
Updates the properties of the current CIMInstance with the vector of CIMProperty objects.
boolean
updatePropertyValue(CIMProperty pProperty)
Updates the CIMProperty value.

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

addProperty, getAllProperties, getKeys, getProperties, getProperty, getProperty, getProperty, removeProperty, setObjectPath, setProperties, setProperty

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

iAlias

protected String iAlias

Constructor Details

CIMInstance

public CIMInstance()
Constructs an object of a CIMInstance.

CIMInstance

public CIMInstance(CIMObjectPath pObjectPath)
Constructs an object of a CIMInstance
Parameters:
pObjectPath -

Method Details

clone

public Object clone()

equals

public boolean equals(Object o)
Overrides:
equals in interface CIMElement

getAlias

public String getAlias()
Returns the alias name for the instance
Returns:
string which represents the alias for the instance, or null if it hasn't beed specified

getClassName

public String getClassName()
Returns the class name of the instance.
Returns:
string which defines the class name for the instance.

getKeyValuePairs

public Vector getKeyValuePairs()
Returns a list of key properties in this CIMInstance.
Returns:
a vector which provides direct access to the key properties of this instance.

getName

public String getName()

Deprecated. instances don't have names. However current implementation provides access to the class name of the instance.

Returns the class name of this instance.
Overrides:
getName in interface CIMElement
Returns:
The name

getObjectPath

public CIMObjectPath getObjectPath()
Gets the CIMObjectsPath for this CIMInstance. Note that this method returns the internal representation of the objectpath. It is upto the application to deside when the objectpath must be cloned to maintain consistency.
Returns:
The CIM object path

hashCode

public int hashCode()

main

public static void main(String[] args)

setAlias

public void setAlias(String pAliasName)
Specifies the alias for this instance.
Parameters:
pAliasName - The alias

setClassName

public void setClassName(String pClassname)
Specifies the classname for this CIMInstance.
Parameters:
pClassname - The class name

setName

public void setName(String pName)
Specifies the name for this CIMInstance.
Overrides:
setName in interface CIMElement
Parameters:
pName - The name

setObjectPath

public void setObjectPath(CIMObjectPath pObjectPath)
Specifies the CIMObjectPath for this CIMInstance.
Overrides:
setObjectPath in interface CIMObject
Parameters:
pObjectPath - The object path

toMOF

public String toMOF()
Returns the MOF representation of this CIMInstance.
Returns:
The MOF representation

toString

public String toString()

updateProperty

public void updateProperty(CIMProperty pProperty)
Updates the specified CIMProperty. If the property does not exists, add the new property to this CIMInstance, otherwise update the value, qualifiers, overridingProperty, and OriginClass attributes.
Parameters:
pProperty - The property

updatePropertyValue

public void updatePropertyValue(Vector pProperties)
Updates the properties of the current CIMInstance with the vector of CIMProperty objects.
Parameters:
pProperties - A property vector

updatePropertyValue

public boolean updatePropertyValue(CIMProperty pProperty)
Updates the CIMProperty value. Updates the CIMProperty's values which matches the specified CIMProperty name. If the CIMProperty does not exists, a new property will be added.
Parameters:
pProperty - The property
Returns:
true if the CIMProperty was succesfully updated, or false if a new property was added.

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