org.sblim.wbem.cim

Class CIMClass

Implemented Interfaces:
Cloneable, Comparable, Serializable

public class CIMClass
extends CIMObject
implements Serializable, Cloneable

Defines a Java object that represents a CIM Class. A CIM Class provides the class definition for creating CIM Instances.

Field Summary

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

CIMClass()
Constructs an object of a CIMClass.
CIMClass(String pClassName)
Construct an object of a CIMClass with the specified name.
CIMClass(CIMObjectPath pObjectPath)
Construct an object of a CIMClass pointing to the specified CIMObjectPath.

Method Summary

void
addMethod(CIMMethod pMethod)
Add a CIMMethod to this class.
Object
clone()
boolean
equals(Object o)
CIMClass
filterProperties(String[] pPropertyList)
Creates a replica of this CIMClass only with the properties specified in the propertyList argument.
Vector
getAllMethods()
Return all the methods for this class, including all the methods inherited from superclasses.
protected CIMMethod
getAllMethods(CIMMethod pMethod)
CIMMethod
getMethod(String pName)
Returns a CIMMethod with the specified name.
CIMMethod
getMethod(String pName, String pOriginClass)
Returns a CIMMethod with the specified name for the given class origin.
protected CIMMethod
getMethod(CIMMethod pMethod)
Gets a method corresponding to the specified name
Vector
getMethods()
Returns a vector containing all the CIMMethods defined by this CIMClass, without including the methods inherited by any super classes.
CIMObjectPath
getObjectPath()
Returns the CIMObjectPath from this object.
String
getSuperClass()
Returns the name of the super class.
int
hashCode()
boolean
isAssociation()
Determines if this CIMClass contains the Association qualifier.
boolean
isKeyed()
Determines if this CIMClass contains any keyed CIMProperty.
CIMClass
localElements()
Creates a replica of this CIMClass which only contains the objects local CIMProperties and CIMMethods.
static void
main(args[] )
CIMInstance
newInstance()
Creates an CIMInstance object based on this CIMClass.
int
numberOfProperties()
Returns the number of properties in this class.
int
numberOfQualifiers()
Returns the number of qualifiers in this class.
void
setIsAssociation(boolean pValue)
Adds or removes the Association qualifier from this CIMClass.
void
setIsKeyed(boolean pValue)
Deprecated. this method may lead to confusion.
void
setMethods(Vector pMethods)
Assigns the specified vector with CIMMethod to this CIMClass.
void
setName(String pName)
Sets the name for this CIMClass.
void
setObjectPath(CIMObjectPath pObjectPath)
Sets the CIMObjectPath for the current CIMClass.
void
setSuperClass(String pClass)
Sets the super class for this class.
String
toMOF()
Returns the MOF representation of this object.
String
toString()

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

Constructor Details

CIMClass

public CIMClass()
Constructs an object of a CIMClass.

CIMClass

public CIMClass(String pClassName)
Construct an object of a CIMClass with the specified name.
Parameters:
pClassName -

CIMClass

public CIMClass(CIMObjectPath pObjectPath)
Construct an object of a CIMClass pointing to the specified CIMObjectPath. Initialize internal object path with the information provided (namespace, hostname, and object name)
Parameters:
pObjectPath -

Method Details

addMethod

public void addMethod(CIMMethod pMethod)
Add a CIMMethod to this class.
Parameters:
pMethod - defines a CIMMethod to be added to the class. If the method already exists, nothing happend.

clone

public Object clone()

equals

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

filterProperties

public CIMClass filterProperties(String[] pPropertyList)
Creates a replica of this CIMClass only with the properties specified in the propertyList argument.
Parameters:
pPropertyList - An array with string of property names. (case sencitive names)
Returns:
The replica

getAllMethods

public Vector getAllMethods()
Return all the methods for this class, including all the methods inherited from superclasses.
Returns:
A Vector containin all CIMMethods from this class. For performance reasons, the returned vector points to the internal data structure that maintains the methods. Modifications on this object may result in an inconsistent state of the CIMClass. Applications MUST deside when this obect has to be cloned.

getAllMethods

protected CIMMethod getAllMethods(CIMMethod pMethod)

getMethod

public CIMMethod getMethod(String pName)
Returns a CIMMethod with the specified name. If a method with the specified name (case sensitive) does not exists, then returns null. For performance reasons, this method returns the internal data structure that is used to by the CIMClass. Modifications on this object may result in state of the CIMClass or CIMMethod. Applications MUST deside when this object has to be cloned.
Parameters:
pName - The method's name
Returns:
null if the speficied method is not found or does not exists.

getMethod

public CIMMethod getMethod(String pName,
                           String pOriginClass)
Returns a CIMMethod with the specified name for the given class origin. If a method with the specified name (case sensitive) does not exists, then returns null. The class origin may be "superclass.overridingmethod" or "overridingmethod", or null. For performance reasons, this method returns the internal data structure that is used to by the CIMClass. Modifications on this object may result in state of the CIMClass or CIMMethod. Applications MUST deside when this object has to be cloned.
Parameters:
pName - The method's name
pOriginClass - The class origin
Returns:
null if the speficied method is not found or does not exists.

getMethod

protected CIMMethod getMethod(CIMMethod pMethod)
Gets a method corresponding to the specified name
Parameters:
pMethod - A CIMMethod with the name to look for
Returns:
The method

getMethods

public Vector getMethods()
Returns a vector containing all the CIMMethods defined by this CIMClass, without including the methods inherited by any super classes. For performance reasons, this method returns a vector that contains CIMMethods which are internally used by the CIMClass. Modifications on the CIMMethods objects may result in state of the CIMClass or CIMMethod. Applications MUST deside when this object has to be cloned.
Returns:
a vector of CIMMethods.

getObjectPath

public CIMObjectPath getObjectPath()
Returns the CIMObjectPath from this object. For performance reasons, this method returns the internal structure used by the CIMClass. The application is responsable to deside when it must may a copy of the returned object to prevent inconsiste state.
Returns:
A CIMObjectPath pointing to the class.

getSuperClass

public String getSuperClass()
Returns the name of the super class. Return null if this class does not has a super class.
Returns:
a string which defines the super class of this class.

hashCode

public int hashCode()

isAssociation

public boolean isAssociation()
Determines if this CIMClass contains the Association qualifier.
Returns:
true if this class contains the association qualifier, otherwise false.

isKeyed

public boolean isKeyed()
Determines if this CIMClass contains any keyed CIMProperty.
Returns:
true if this CIMClass contains a keyed CIMProperty, otherwise returns false.

localElements

public CIMClass localElements()
Creates a replica of this CIMClass which only contains the objects local CIMProperties and CIMMethods. A local CIMProperty or CIMMethod are those that the original CIMClass is this object.
Returns:
The replica

main

public static void main(args[] )

newInstance

public CIMInstance newInstance()
Creates an CIMInstance object based on this CIMClass. This CIMInstance may be used later to create a CIMInstance remotely at the CIMOM with the CIMClient.createInstance() method.
Returns:
The new instance

numberOfProperties

public int numberOfProperties()
Returns the number of properties in this class.
Returns:
The property count

numberOfQualifiers

public int numberOfQualifiers()
Returns the number of qualifiers in this class.
Returns:
The qualifier count

setIsAssociation

public void setIsAssociation(boolean pValue)
Adds or removes the Association qualifier from this CIMClass. Depending on the case, this method will add if the specified parameter is true, otherwise remove the association qualifier from this CIMClass.
Parameters:
pValue -

setIsKeyed

public void setIsKeyed(boolean pValue)

Deprecated. this method may lead to confusion. Instead of this method application are encourage to remove/add the Key qualifier manually.

Specified when this CIM Class has key properties or not.
Parameters:
pValue -

setMethods

public void setMethods(Vector pMethods)
Assigns the specified vector with CIMMethod to this CIMClass. If the method argument is null, all the CIMMethods from this CIMClass will be removed.
Parameters:
pMethods -

setName

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

setObjectPath

public void setObjectPath(CIMObjectPath pObjectPath)
Sets the CIMObjectPath for the current CIMClass.
Overrides:
setObjectPath in interface CIMObject
Parameters:
pObjectPath -

setSuperClass

public void setSuperClass(String pClass)
Sets the super class for this class. If null is passed means that the class does not have any super class.
Parameters:
pClass -

toMOF

public String toMOF()
Returns the MOF representation of this object.
Returns:
A string containig the MOF representation

toString

public String toString()

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