Class CIMClass
java.lang.Object
org.sblim.wbem.cim.CIMElement
org.sblim.wbem.cim.CIMQualifiableElement
org.sblim.wbem.cim.CIMObject
org.sblim.wbem.cim.CIMClass
- All Implemented Interfaces:
Serializable, Cloneable, Comparable
Defines a Java object that represents a CIM Class. A CIM Class provides the
class definition for creating CIM Instances.
- See Also:
-
Field Summary
Fields inherited from class CIMObject
iAllProperties, iObjectPath
Fields inherited from class CIMQualifiableElement
iQualifiers
Fields inherited from class CIMElement
CLOSING_BRAKET, EMPTY, iName, OPENING_BRAKET
-
Constructor Summary
ConstructorsConstructorDescriptionCIMClass()
Constructs an object of a CIMClass.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
Modifier and TypeMethodDescriptionvoid
Add a CIMMethod to this class.clone()
boolean
filterProperties
(String[] pPropertyList) Creates a replica of this CIMClass only with the properties specified in the propertyList argument.Return all the methods for this class, including all the methods inherited from superclasses.protected CIMMethod
getAllMethods
(CIMMethod pMethod) Returns a CIMMethod with the specified name.Returns a CIMMethod with the specified name for the given class origin.protected CIMMethod
Gets a method corresponding to the specified nameReturns a vector containing all the CIMMethods defined by this CIMClass, without including the methods inherited by any super classes.Returns the CIMObjectPath from this object.Returns the name of the super class.int
hashCode()
boolean
Determines if this CIMClass contains the Association qualifier.boolean
isKeyed()
Determines if this CIMClass contains any keyed CIMProperty.Creates a replica of this CIMClass which only contains the objects local CIMProperties and CIMMethods.static void
Creates an CIMInstance object based on this CIMClass.int
Returns the number of properties in this class.int
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
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.toMOF()
Returns the MOF representation of this object.toString()
Methods inherited from class CIMObject
addProperty, getAllProperties, getKeys, getProperties, getProperty, getProperty, getProperty, removeProperty, setProperties, setProperty
Methods inherited from class CIMQualifiableElement
addQualifier, getQualifier, getQualifiers, removeQualifier, setQualifiers
Methods inherited from class CIMElement
appendTab, assign, compareTo, getName, lessThan, vectorToMOFString, vectorToMOFString, vectorToMOFString
-
Constructor Details
-
CIMClass
public CIMClass()Constructs an object of a CIMClass. -
CIMClass
Construct an object of a CIMClass with the specified name.- Parameters:
pClassName
-
-
CIMClass
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
-- Throws:
IllegalArgumentException
- if the object name of the objectpath or the object path are null
-
-
Method Details
-
addMethod
Add a CIMMethod to this class.- Parameters:
pMethod
- defines a CIMMethod to be added to the class. If the method already exists, nothing happend.- Throws:
IllegalArgumentException
- if the specified method is null.
-
clone
-
hashCode
-
equals
- Overrides:
equals
in classCIMElement
-
getMethod
-
getAllMethods
-
filterProperties
-
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.
-
getMethod
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
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 namepOriginClass
- The class origin- Returns:
- null if the speficied method is not found or does not exists.
-
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.
-
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.
-
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
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
-
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
-
setSuperClass
Sets the super class for this class. If null is passed means that the class does not have any super class.- Parameters:
pClass
-
-
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
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
Sets the name for this CIMClass.- Overrides:
setName
in classCIMElement
- Parameters:
pName
- The name
-
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.
-
setObjectPath
Sets the CIMObjectPath for the current CIMClass.- Specified by:
setObjectPath
in classCIMObject
- Parameters:
pObjectPath
-
-
toMOF
Returns the MOF representation of this object.- Returns:
- A string containig the MOF representation
-
toString
-
main
-