Package org.sblim.wbem.cim
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:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
public class CIMClass extends CIMObject implements java.io.Serializable, java.lang.Cloneable
Defines a Java object that represents a CIM Class. A CIM Class provides the class definition for creating CIM Instances.- See Also:
- Serialized Form
-
-
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, iName, OPENING_BRAKET
-
-
Constructor Summary
Constructors Constructor Description CIMClass()
Constructs an object of a CIMClass.CIMClass(java.lang.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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMethod(CIMMethod pMethod)
Add a CIMMethod to this class.java.lang.Object
clone()
boolean
equals(java.lang.Object o)
CIMClass
filterProperties(java.lang.String[] pPropertyList)
Creates a replica of this CIMClass only with the properties specified in the propertyList argument.java.util.Vector
getAllMethods()
Return all the methods for this class, including all the methods inherited from superclasses.protected CIMMethod
getAllMethods(CIMMethod pMethod)
CIMMethod
getMethod(java.lang.String pName)
Returns a CIMMethod with the specified name.CIMMethod
getMethod(java.lang.String pName, java.lang.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 namejava.util.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.java.lang.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(java.lang.String[] 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(java.util.Vector pMethods)
Assigns the specified vector with CIMMethod to this CIMClass.void
setName(java.lang.String pName)
Sets the name for this CIMClass.void
setObjectPath(CIMObjectPath pObjectPath)
Sets the CIMObjectPath for the current CIMClass.void
setSuperClass(java.lang.String pClass)
Sets the super class for this class.java.lang.String
toMOF()
Returns the MOF representation of this object.java.lang.String
toString()
-
Methods inherited from class org.sblim.wbem.cim.CIMObject
addProperty, getAllProperties, getKeys, getProperties, getProperty, getProperty, getProperty, removeProperty, 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, getName, lessThan, vectorToMOFString, vectorToMOFString, vectorToMOFString
-
-
-
-
Constructor Detail
-
CIMClass
public CIMClass()
Constructs an object of a CIMClass.
-
CIMClass
public CIMClass(java.lang.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
-- Throws:
java.lang.IllegalArgumentException
- if the object name of the objectpath or the object path are null
-
-
Method Detail
-
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.- Throws:
java.lang.IllegalArgumentException
- if the specified method is null.
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classCIMElement
-
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
-
filterProperties
public CIMClass filterProperties(java.lang.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 java.util.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.
-
getMethod
public CIMMethod getMethod(java.lang.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(java.lang.String pName, java.lang.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 namepOriginClass
- The class origin- Returns:
- null if the speficied method is not found or does not exists.
-
getMethods
public java.util.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.
-
getSuperClass
public java.lang.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.
-
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
-
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
-
setSuperClass
public void setSuperClass(java.lang.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
-
-
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(java.util.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(java.lang.String pName)
Sets the name for this CIMClass.- Overrides:
setName
in classCIMElement
- Parameters:
pName
- The name
-
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.
-
setObjectPath
public void setObjectPath(CIMObjectPath pObjectPath)
Sets the CIMObjectPath for the current CIMClass.- Specified by:
setObjectPath
in classCIMObject
- Parameters:
pObjectPath
-
-
toMOF
public java.lang.String toMOF()
Returns the MOF representation of this object.- Returns:
- A string containig the MOF representation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
main
public static void main(java.lang.String[] args)
-
-