|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.wbem.cim.CIMElement | +--com.sun.wbem.cim.CIMClass
Creates and instantiates a Java object that represents a CIM class. A CIM class is a template for creating a CIM instance. A CIM class represents a collection of CIM instances, all of which support a common type (for example, a set of properties, methods, and associations).
Constructor Summary | |
CIMClass()
Creates and instantiates a Java object representing a CIM class. |
|
CIMClass(java.lang.String name)
Creates and instantiates a Java object representing a CIM Class with the specified name. |
Method Summary | |
void |
addMethod(CIMMethod m)
Adds the specified CIM method to this CIM class. |
void |
addProperty(CIMProperty p)
Adds the specified property to the CIM properties in this CIM class. |
void |
addQualifier(CIMQualifier q)
Adds the specified CIM qualifier to the qualifiers in this CIM class. |
CIMClass |
filterProperties(java.lang.String[] propertyList,
boolean includeQualifier,
boolean includeClassOrigin)
This method returns a new CIMClass with properties filtered according to the input parameters. |
java.util.Vector |
getAllMethods()
Gets the CIM methods in this CIM class, including overridden ones. |
java.util.Vector |
getAllProperties()
Gets the CIM properties in this CIM class, including overriden properties. |
java.util.Vector |
getKeys()
Returns a list of key properties in this CIMClass. |
CIMMethod |
getMethod(java.lang.String name)
Returns the specified CIM method in this CIM class. |
CIMMethod |
getMethod(java.lang.String name,
java.lang.String originClass)
Returns the CIM method specified by its name and optionally, its origin class. |
java.util.Vector |
getMethods()
Gets the CIM methods in this CIM class. |
java.util.Vector |
getProperties()
Gets the CIM properties in this CIM class. |
CIMProperty |
getProperty(java.lang.String name)
Returns the specified CIM Property. |
CIMProperty |
getProperty(java.lang.String name,
java.lang.String originClass)
Returns the specified CIMProperty. |
CIMQualifier |
getQualifier(java.lang.String name)
Returns the specified qualifier, if it exists in this CIM class. |
java.util.Vector |
getQualifiers()
Gets the CIM Qualifiers in this CIM class. |
java.lang.String |
getSuperClass()
Gets the parent of this CIM class. |
boolean |
hasQualifier(CIMQualifier q)
Checks whether the specified qualifier is one of the qualifiers in this CIM class. |
boolean |
isAssociation()
Identifies whether or not this CIM class is an association. |
boolean |
isKeyed()
Convenience method to identify if this class is keyed. |
CIMClass |
localElements()
Returns only the local elements for this class and filters out the rest. |
CIMInstance |
newInstance()
Returns a new CIM instance initialized with the default CIM properties, qualifiers, and name of this CIM class. |
int |
numberOfProperties()
Returns the number of properties in this class. |
int |
numberOfQualifiers()
Returns the number of qualifiers declared in this CIM Class. |
boolean |
removeQualifier(CIMQualifier q)
Removes the specified qualifier from this CIM class. |
void |
setIsAssociation(boolean isAssociation)
Sets the isAssociation field to true to indicate that this
CIM class is an association. |
void |
setIsKeyed(boolean isKeyedValue)
Takes a boolean that indicates whether or not this CIM class has a key property. |
void |
setMethods(java.util.Vector Table)
Replaces the existing methods in this class with the specified methods. |
void |
setProperties(java.util.Vector Table)
Replaces the existing CIM properties in this class with the specified CIM properties. |
void |
setQualifiers(java.util.Vector Table)
Replaces the CIM qualifiers in this CIM class with the specified CIM qualifiers. |
void |
setSuperClass(java.lang.String sClass)
Sets the parent of this CIM class to the name of the super class contained in the specified string. |
java.lang.String |
toMOF()
Returns a MOF representation of the CIM class. |
java.lang.String |
toString()
Returns a String representation of the CIMClass. |
java.lang.String |
toXml()
Returns an XML representation of this CIM class. |
java.lang.String |
toXml(CIMObjectPath cop)
Returns an XML representation of the specified CIM object (class or instance). |
java.lang.String |
toXml(CIMObjectPath cop,
java.lang.String host)
Returns an XML representation of the specified class or instance on the specified host. |
Methods inherited from class com.sun.wbem.cim.CIMElement |
assign,
equals,
getName,
lessThan,
setName |
Methods inherited from class java.lang.Object |
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public CIMClass()
setName
method to assign a name to
the CIM class.
Example:
{ // Connect to the root\cimv2 namespace on the local host and // create a new class called myclass.CIMClient cc = new CIMClient();
// Construct a new CIMClass object.CIMClass cimclass = new CIMClass();
// Set the name of the CIM class to myclass.cimclass.setName("myclass");
... }
public CIMClass(java.lang.String name)
name
- Name of the CIM class.
Example:
{
// Construct a new CIMClass object with the name myclass.
CIMClass cimclass = new CIMClass(myclass);
...
}
Method Detail |
public java.lang.String toString()
public java.lang.String toMOF()
public java.lang.String getSuperClass()
public void setSuperClass(java.lang.String sClass)
superClass
- The parent class.public boolean isKeyed()
public void setIsKeyed(boolean isKeyedValue)
isKeyedValue
- True indicates this CIM class has a key
property. False indicates this CIM class
has no key properties.public java.util.Vector getKeys()
public CIMQualifier getQualifier(java.lang.String name)
name
- The string name of the CIM qualifier.public CIMProperty getProperty(java.lang.String name)
name
- The string name of the property to get.
It can also be of the form
"originClass.propertyName"public CIMProperty getProperty(java.lang.String name, java.lang.String originClass)
name
- The string name of the property to get.originClass
- (Optional) The string name of the class
in which the property was defined.public CIMMethod getMethod(java.lang.String name)
name
- The string name of the method to get. The name
can also be in the form "originClass.methodName"public CIMMethod getMethod(java.lang.String name, java.lang.String originClass)
name
- The string name of the method to get.originClass
- (Optional) The class in which the method
was defined.public boolean isAssociation()
This method returns true if this CIM class is an association. Otherwise, false.
public void setIsAssociation(boolean isAssociation)
isAssociation
field to true to indicate that this
CIM class is an association.
An association is a relationship between two classes or between instances of two classes. The properties of an association class include pointers, or references, to the two classes or instances.
Class association is one of the most powerful CIM features. It provides
a way to organize a collection of management objects into meaningful
relationships. For example, a Solaris_ComputerSystem
object
might contain a Solaris_Disk
, Processor A, and Processor B.
The Solaris_ComputerSystem
has an association with each of
the objects it contains. Because this particular association is a
containment association, it is represented by a class called
CIM_contains
. The CIM_contains
class contains
references to each of the objects that belong to the association. In
this case, CIM_contains
has a reference to
Solaris_Disk
and a reference to
Solaris_ComputerSystem
.
All CIM classes can be included in one or more associations.
isAssociation
- True indicates this CIM
class belongs to an association.
False indicates that this CIM
class does not belong to an
association.public java.util.Vector getQualifiers()
public java.util.Vector getAllProperties()
public java.util.Vector getProperties()
public java.util.Vector getAllMethods()
public java.util.Vector getMethods()
public void addProperty(CIMProperty p)
p
- The property to add to this CIM class.public int numberOfProperties()
public void setProperties(java.util.Vector Table)
Table
- Vector of CIMProperty objects.public void addQualifier(CIMQualifier q)
q
- CIMQualifier object to add to this CIM class.public boolean hasQualifier(CIMQualifier q)
public int numberOfQualifiers()
public boolean removeQualifier(CIMQualifier q)
public void setQualifiers(java.util.Vector Table)
Table
- Vector of CIMQualifier objects.public void addMethod(CIMMethod m)
m
- The CIMMethod object to add to this CIM class.public void setMethods(java.util.Vector Table)
Table
- Vector of CIMMethod elements.public CIMInstance newInstance()
public java.lang.String toXml()
public java.lang.String toXml(CIMObjectPath cop)
public java.lang.String toXml(CIMObjectPath cop, java.lang.String host)
public CIMClass localElements()
filterProperties(java.lang.String[], boolean, boolean)
public CIMClass filterProperties(java.lang.String[] propertyList, boolean includeQualifier, boolean includeClassOrigin)
propertyList
- If the PropertyList input parameter is not NULL, the
members of the array define one or more Property names. The returned
CIMClass 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 each returned class. If the
PropertyList input parameter is NULL this specifies that all Properties
are included in each returned class.
If the PropertyList contains duplicate elements or invalid property
names, they are ignored.includeQualifier
- qualifiers are only included if true.includeClassOrigin
- classOrigins are only included if true.localElements()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |