javax.cim
Class CIMClass

java.lang.Object
  extended by javax.cim.CIMElement
      extended by javax.cim.CIMClass
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CIMElement>, CIMNamedElementInterface, CIMQualifiedElementInterface

public class CIMClass
extends CIMElement
implements CIMQualifiedElementInterface, CIMNamedElementInterface

CIMClass represents a CIM class as defined by the Distributed Management Task Force (www.dmtf.org) CIM Infrastructure Specification. A CIMClass has the following attributes:

See Also:
Serialized Form

Constructor Summary
CIMClass(CIMObjectPath pPath, java.lang.String pSuperClass, CIMQualifier<?>[] pQualifiers, CIMClassProperty<?>[] pProps, CIMMethod<?>[] pMethods, boolean pIsAssociation, boolean pIsKeyed)
          Creates and instantiates a Java object representing a CIM Class.
CIMClass(java.lang.String pName, java.lang.String pSuperClass, CIMQualifier<?>[] pQualifiers, CIMClassProperty<?>[] pProps, CIMMethod<?>[] pMethods)
          Creates and instantiates a Java object representing a CIM Class.
 
Method Summary
 boolean equals(java.lang.Object pObj)
          Compares this object against the specified object.
 CIMClass filterProperties(boolean pLocalOnly, boolean pIncludeQualifiers, boolean pIncludeClassOrigin, java.lang.String[] pPropertyList)
          This method returns a new CIMClass with properties filtered according to the input parameters.
 CIMClassProperty<?>[] getKeys()
          Returns a list of key properties for this CIM class.
 CIMMethod<?> getMethod(int pIndex)
          Get a method by index.
 CIMMethod<?> getMethod(java.lang.String pName)
          Returns the specified CIM method in this CIM class.
 CIMMethod<?> getMethod(java.lang.String pName, java.lang.String pOriginClass)
          Returns the CIM method specified by its name and optionally, its origin class.
 int getMethodCount()
          Get the number of methods defined in this CIM class.
 CIMMethod<?>[] getMethods()
          Get the CIM methods defined in this CIM class.
 CIMObjectPath getObjectPath()
          This method returns the CIMObjectPath that represents this CIM class.
 CIMClassProperty<?>[] getProperties()
          Get the properties defined for this CIM class.
 CIMClassProperty<?> getProperty(int pIndex)
          Get a class property by index.
 CIMClassProperty<?> getProperty(java.lang.String pName)
          Gets the specified property.
 CIMClassProperty<?> getProperty(java.lang.String pName, java.lang.String pOriginClass)
          Gets the specified property.
 int getPropertyCount()
          Get the number of properties defined in this CIMClass.
 CIMQualifier<?> getQualifier(int pIndex)
          Get a qualifier by index.
 CIMQualifier<?> getQualifier(java.lang.String pName)
          Gets a qualifier by name.
 int getQualifierCount()
          Get the number of qualifiers defined in this CIM class.
 CIMQualifier<?>[] getQualifiers()
          Returns the list of qualifiers for the CIM class.
 java.lang.Object getQualifierValue(java.lang.String pName)
          Gets a qualifier value by name.
 java.lang.String getSuperClassName()
          Gets the name of the parent of this CIM class.
 boolean hasQualifier(java.lang.String pName)
          Checks whether the specified qualifier is one of the qualifiers in this CIM class.
 boolean hasQualifierValue(java.lang.String pName, java.lang.Object pValue)
          Checks whether the specified qualifier is one of the qualifiers defined for this property with the specified value.
 boolean isAssociation()
          Identifies whether or not this CIM class is an association.
 boolean isKeyed()
          Identifies whether or not this class is keyed.
 CIMInstance newInstance()
          Returns a new CIM instance initialized with the default CIM properties, values and name of this CIM class.
 java.lang.String toString()
          Returns a String representation of the CIM class.
 
Methods inherited from class javax.cim.CIMElement
compareTo, getName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CIMClass

public CIMClass(CIMObjectPath pPath,
                java.lang.String pSuperClass,
                CIMQualifier<?>[] pQualifiers,
                CIMClassProperty<?>[] pProps,
                CIMMethod<?>[] pMethods,
                boolean pIsAssociation,
                boolean pIsKeyed)
Creates and instantiates a Java object representing a CIM Class.

Parameters:
pPath - - Object Name of the CIM class.
pSuperClass - - Name of the superclass.
pQualifiers - - List of qualifiers of the CIM class.
pProps - - List of properties of the CIM class.
pMethods - - List of methods of the CIM class.
pIsAssociation - - true if the CIM class is an Association, false otherwise.
pIsKeyed - - true if the CIM class has Keys, false otherwise.

CIMClass

public CIMClass(java.lang.String pName,
                java.lang.String pSuperClass,
                CIMQualifier<?>[] pQualifiers,
                CIMClassProperty<?>[] pProps,
                CIMMethod<?>[] pMethods)
Creates and instantiates a Java object representing a CIM Class.

Parameters:
pName - - Name of the CIM class.
pSuperClass - - Name of the superclass.
pQualifiers - - List of qualifiers of the CIM class.
pProps - - List of properties of the CIM class.
pMethods - - List of methods of the CIM class.
Method Detail

equals

public boolean equals(java.lang.Object pObj)
Compares this object against the specified object. The result is true if and only if the argument is not null and is a CIMValuedObject that represents the same name, type and value as this object.

Overrides:
equals in class CIMElement
Parameters:
pObj - - The object to compare with.
Returns:
true if the objects are the same; false otherwise.
See Also:
Object.equals(java.lang.Object)

filterProperties

public CIMClass filterProperties(boolean pLocalOnly,
                                 boolean pIncludeQualifiers,
                                 boolean pIncludeClassOrigin,
                                 java.lang.String[] pPropertyList)
This method returns a new CIMClass with properties filtered according to the input parameters. Inclusion of class origin and qualifiers can also be controlled. Methods will not be included in the class returned.

Parameters:
pLocalOnly - - If true only the elements defined in this class are included; otherwise all elements are included.
pIncludeQualifiers - - If true qualifiers are included on all elements; otherwise no qualifiers are included.
pIncludeClassOrigin - - If true, the ClassOrigin attribute is included.
pPropertyList -

If the propertyList input parameter is not null , the members of the array define one or more Property names. The CIMClass returned 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 the class returned. If the propertyList input parameter is null this specifies that all Properties are included in the class returned. If the propertyList contains duplicate elements or invalid property names, they are ignored.

Returns:
CIMClass matching the requested criteria.

getKeys

public CIMClassProperty<?>[] getKeys()
Returns a list of key properties for this CIM class.

Returns:
The list of CIM properties that are keys for this CIM class.

getMethod

public CIMMethod<?> getMethod(int pIndex)
Get a method by index.

Parameters:
pIndex - - The index of the method to retrieve
Returns:
The CIMMethod at the specified index.

getMethod

public CIMMethod<?> getMethod(java.lang.String pName)
Returns the specified CIM method in this CIM class.

Parameters:
pName -

The string name of the method to retrieve. The name may be specified in the form "originClass.methodName".

Returns:
The CIM method specified or null if the method does not exist.

getMethod

public CIMMethod<?> getMethod(java.lang.String pName,
                              java.lang.String pOriginClass)
Returns the CIM method specified by its name and optionally, its origin class. The origin class is the class in which the method is defined.

Parameters:
pName - - The string name of the method to get.
pOriginClass - - (Optional) The class in which the method was defined.
Returns:
The CIM method specified or null if the method does not exist.

getMethodCount

public int getMethodCount()
Get the number of methods defined in this CIM class.

Returns:
The number of methods defined in the CIM class.

getMethods

public CIMMethod<?>[] getMethods()
Get the CIM methods defined in this CIM class.

Returns:
A clone of the methods in this CIM class.

getObjectPath

public CIMObjectPath getObjectPath()
This method returns the CIMObjectPath that represents this CIM class.

Specified by:
getObjectPath in interface CIMNamedElementInterface
Returns:
The CIMObjectPath that represents this CIM class.

getProperty

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

Parameters:
pIndex - - The index of the class property to retrieve
Returns:
The CIMClassProperty at the specified index.

getProperty

public CIMClassProperty<?> getProperty(java.lang.String pName)
Gets the specified property.

Parameters:
pName - - The text string for the name of the property
Returns:
CIMClassProperty The property requested or null if the property does not exist.

getProperty

public CIMClassProperty<?> getProperty(java.lang.String pName,
                                       java.lang.String pOriginClass)
Gets the specified property.

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:
CIMClassProperty The property requested or null if the property does not exist

getProperties

public CIMClassProperty<?>[] getProperties()
Get the properties defined for this CIM class.

Returns:
A clone of the properties for this class.

getPropertyCount

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

Returns:
The number of properties defined in the CIMClass.

getQualifier

public CIMQualifier<?> getQualifier(int pIndex)
Get a qualifier by index.

Specified by:
getQualifier in interface CIMQualifiedElementInterface
Parameters:
pIndex - - The index of the qualifier to retrieve.
Returns:
The Qualifier at the specified index.

getQualifier

public CIMQualifier<?> getQualifier(java.lang.String pName)
Gets a qualifier by name.

Specified by:
getQualifier in interface CIMQualifiedElementInterface
Parameters:
pName - - The name of the qualifier to get.
Returns:
The qualifier requested or null if the qualifier does not exist.

getQualifierValue

public java.lang.Object getQualifierValue(java.lang.String pName)
Description copied from interface: CIMQualifiedElementInterface
Gets a qualifier value by name.

Specified by:
getQualifierValue in interface CIMQualifiedElementInterface
Parameters:
pName - - The name of the qualifier to get.
Returns:
null if the qualifier does not exist or value is null, otherwise returns the reference to the qualifier.
See Also:
CIMQualifiedElementInterface.getQualifierValue(java.lang.String)

getQualifierCount

public int getQualifierCount()
Get the number of qualifiers defined in this CIM class.

Specified by:
getQualifierCount in interface CIMQualifiedElementInterface
Returns:
The number of qualifiers defined in the CIM class.

getQualifiers

public CIMQualifier<?>[] getQualifiers()
Returns the list of qualifiers for the CIM class.

Specified by:
getQualifiers in interface CIMQualifiedElementInterface
Returns:
Qualifiers for this class.

getSuperClassName

public java.lang.String getSuperClassName()
Gets the name of the parent of this CIM class.

Returns:
The name of the parent class.

hasQualifier

public boolean hasQualifier(java.lang.String pName)
Checks whether the specified qualifier is one of the qualifiers in this CIM class.

Specified by:
hasQualifier in interface CIMQualifiedElementInterface
Parameters:
pName - - the name of the qualifier.
Returns:
true if the qualifier exists in this CIM class, otherwise false.

hasQualifierValue

public boolean hasQualifierValue(java.lang.String pName,
                                 java.lang.Object pValue)
Description copied from interface: CIMQualifiedElementInterface
Checks whether the specified qualifier is one of the qualifiers defined for this property with the specified value. This method will return false if the qualifier is not applied or if the value does not match.

Specified by:
hasQualifierValue in interface CIMQualifiedElementInterface
Parameters:
pName - - the name of the qualifier
pValue - - the value to be tested
Returns:
true if the qualifier exists and has the value, otherwise false.
See Also:
CIMQualifiedElementInterface.hasQualifierValue(java.lang.String, java.lang.Object)

isAssociation

public boolean isAssociation()
Identifies whether or not this CIM class is an association. An association is a relationship between two or more classes or instances of two or more classes. The properties of an association class include references, or pointers, to the two or more instances. All CIM classes can be included in one or more associations.

Returns:
true if this CIM class is an association; otherwise, false.

isKeyed

public boolean isKeyed()
Identifies whether or not this class is keyed. Only keyed classes can have instances. true if this CIM class has a one or more key property. Otherwise, returns false.

Returns:
true if this CIM class has a key property. otherwise returns false.

newInstance

public CIMInstance newInstance()
Returns a new CIM instance initialized with the default CIM properties, values and name of this CIM class.

Returns:
A CIM instance of this CIM class.

toString

public java.lang.String toString()
Returns a String representation of the CIM class. This method is intended to be used only for debugging purposes, and the format of the string returned string may vary between implementations. The returned string may be empty but may not be null .

Overrides:
toString in class CIMElement
Returns:
A String representation of this CIM class.
See Also:
Object.toString()


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