|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcn.chenlichao.wmi4j.AbstractSecurityScriptingObject
cn.chenlichao.wmi4j.SWbemObject
public class SWbemObject
You can use the methods and properties of the SWbemObject object to represent one Windows Management Instrumentation (WMI) class definition or object instance.
This object supports two types of properties and methods. Those defined in this section are generic properties and methods that apply to all WMI objects. In addition, this object exposes the properties and methods of the underlying object as dynamic automation properties and methods of SWbemObject. The names and types of these properties and methods depend on the underlying WMI object.
From the WMI client perspective, this object is always in-process.
Write operations only affect the local copy of the object, and read operations always retrieve values from the local copy.
Updates to WMI are performed only when entire objects are written using a call to the SWbemObject.put().
If you modify the properties or methods in an SWbemObject object, your changes are not written to WMI
until you call SWbemObject.put().
Note: SWbemObject cannot be created by yourself.
If you want to create a new, empty class use SWbemServices.get
with an empty path parameter. This call returns an empty SWbemObject object that can become a class.
You can then supply a class name for the class property of the SWbemObjectPath object returned by the getPath() call.
Add properties to the new class by the properties method.
To create an instance, call GetObject on the new class.
| 方法摘要 | |
|---|---|
SWbemObjectSet |
associators()
Use default parameters for method associators(String, String, String, String, Boolean, Boolean, String, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.AssociatorsFlag...) |
SWbemObjectSet |
associators(String assocClass,
String resultClass,
String resultRole,
String role,
Boolean classesOnly,
Boolean schemaOnly,
String requiredAssocQualifier,
String requiredQualifier,
SWbemNamedValueSet objwbemNamedValueSet,
Flags.AssociatorsFlag... flags)
Returns a collection of objects (classes or instances) that are associated with the current object. |
boolean |
compareTo(SWbemObject wbemObject)
Use default parameters for #compareTo(SWbemObject, Flags.CompareToFlag... |
boolean |
compareTo(SWbemObject wbemObject,
Flags.CompareToFlag... flags)
Compares two SWbemObject objects. |
void |
delete()
Use default parameters for delete(Integer, SWbemNamedValueSet) |
void |
delete(Integer flags,
SWbemNamedValueSet objWbemNamedValueSet)
Deletes either the current class or the current instance. |
SWbemObject |
execMethod(String methodName)
Use default parameters for execMethod(String, SWbemObject, Integer, SWbemNamedValueSet) |
SWbemObject |
execMethod(String methodName,
SWbemObject inParameters)
Use default parameters for execMethod(String, SWbemObject, Integer, SWbemNamedValueSet) |
SWbemObject |
execMethod(String methodName,
SWbemObject inParameters,
Integer flags,
SWbemNamedValueSet objWbemNamedValueSet)
Executes a method exported by a method provider. |
List<String> |
getDerivation()
An array of strings that describe the class derivation hierarchy for the instance being referenced. |
SWbemObject |
getInParametersByMethodName(String methodName)
Get an SWbemObject object whose properties define the input parameters for the specified method. |
SWbemMethodSet |
getMethods()
Returns an SWbemMethodSet object that is a collection of the methods for the current class or instance. |
String |
getObjectText()
Use default parameters for getObjectText(Integer) |
String |
getObjectText(Integer flags)
Returns a textual rendering of the object. |
SWbemObjectPath |
getPath()
Returns an SWbemObjectPath object that represents the object path of the current class or instance. |
SWbemPropertySet |
getProperties()
Returns an SWbemPropertySet object that is a collection of the properties for the current class or instance. |
WMIVariant |
getPropertyByName(String propertyName)
Get the variant value of the specified WMI property. |
SWbemQualifierSet |
getQualifiers()
Returns an SWbemQualifierSet object that is a collection of the qualifiers for the current class or instance. |
SWbemObjectSet |
instances()
Use default parameters for instances(SWbemNamedValueSet, Flags.InstancesFlag...) |
SWbemObjectSet |
instances(SWbemNamedValueSet objWbemNamedValueSet,
Flags.InstancesFlag... flags)
Creates an enumerator that returns the instances of the current class object. |
SWbemObjectPath |
put()
Use default parameters for put(SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.PutFlag...) |
SWbemObjectPath |
put(SWbemNamedValueSet objWbemNamedValueSet,
Flags.PutFlag... flags)
Creates or updates an instance or a class object to Windows Management Instrumentation (WMI). |
SWbemObjectSet |
references()
Use default parameters for references(String, String, Boolean, Boolean, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.ReferenceFlag...) |
SWbemObjectSet |
references(String resultClass,
String role,
Boolean classesOnly,
Boolean schemaOnly,
String requiredQualifier,
SWbemNamedValueSet objWbemNamedValueSet,
Flags.ReferenceFlag... flags)
Returns a collection of all association classes or instances that refer to the current object. |
void |
setPropertyByName(String propertyName,
WMIVariant value)
Set the variant value of the specified WMI property |
SWbemObject |
spawnDerivedClass()
Use default parameters for spawnDerivedClass(Integer) |
SWbemObject |
spawnDerivedClass(Integer flags)
Create a derived class object from the current object. |
SWbemObject |
spawnInstance()
Use default parameters for spawnInstance(Integer) |
SWbemObject |
spawnInstance(Integer flags)
Create a new instance of a class. |
SWbemObjectSet |
subclasses()
Use default parameters for subclasses(SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.SubclassesFlag...) |
SWbemObjectSet |
subclasses(SWbemNamedValueSet objWbemNamedValueSet,
Flags.SubclassesFlag... flags)
Returns an SWbemObjectSet object. |
SWbemObject |
wmiClone()
Returns a new object that is a clone of the current object. |
| 从类 cn.chenlichao.wmi4j.AbstractSecurityScriptingObject 继承的方法 |
|---|
getSecurity |
| 从类 java.lang.Object 继承的方法 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法详细信息 |
|---|
public SWbemObjectSet associators(String assocClass,
String resultClass,
String resultRole,
String role,
Boolean classesOnly,
Boolean schemaOnly,
String requiredAssocQualifier,
String requiredQualifier,
SWbemNamedValueSet objwbemNamedValueSet,
Flags.AssociatorsFlag... flags)
throws WMIException
assocClass - [Optional] String that contains an association class. If specified, this parameter indicates that
the returned endpoints must be associated with the source through the specified association class
or a class that is derived from this association class.resultClass - [Optional] String that contains a class name. If specified, this optional parameter indicates that
the returned endpoints must belong to or be derived from the class specified in this parameter.resultRole - [Optional] String that contains a property name.
If specified, this parameter indicates that the returned endpoints must play a particular
role in their association with the source object. The role is defined by the name of
a specified property (which must be a reference property) of an association.role - [Optional] String that contains a property name.
If specified, this parameter indicates that the returned endpoints must participate in an association
with the source object in which the source object plays a particular role. The role is defined by
the name of a specified property (which must be a reference property) of an association.classesOnly - [Optional] Boolean value that indicates whether a list of class names should be returned rather than
actual instances of the classes. These are the classes to which the endpoint instances belong.
The default value for this parameter is FALSE.schemaOnly - [Optional] Boolean value that indicates whether the query applies to the schema rather than the data.
The default value for this parameter is FALSE. It can only be set to TRUE if the strObjectPath
parameter specifies the object path of a class. When set to TRUE, the set of returned
endpoints represent classes that are suitably associated with the source class in schema.requiredAssocQualifier - [Optional] String that contains a qualifier name.
If specified, this parameter indicates that the returned endpoints must be
associated with the source object through an association class that includes the
specified qualifier.requiredQualifier - [Optional] String that contains a qualifier name.
If specified, this parameter indicates that the returned endpoints must include
the specified qualifier.flags - [Optional] Integer that specifies additional flags to the operation.
The default value for this parameter is wbemFlagReturnImmediately,
which calls the method in the semisynchronous mode. This parameter can accept the following values.objwbemNamedValueSet - [Optional] Typically, this is undefined.
Otherwise, this is an SWbemNamedValueSet object whose elements represent the context
information that can be used by the provider that is servicing the request.
A provider that supports or requires such information must document the recognized
value names, data type of the value, allowed values, and semantics.
SWbemObjectSet will be returned.
WMIException
public SWbemObjectSet associators()
throws WMIException
associators(String, String, String, String, Boolean, Boolean, String, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.AssociatorsFlag...)
WMIException
public SWbemObject wmiClone()
throws WMIException
WMIException
public boolean compareTo(SWbemObject wbemObject,
Flags.CompareToFlag... flags)
throws WMIException
wbemObject - This is the object with which the first object is compared. The object must be a valid SWbemObject instance.flags - [Optional] Specifies the object characteristics to consider when comparing an object
with other objects. You can use wbemComparisonFlagIncludeAll
to consider all features (this is the default), or any combination of the following values.
WMIException
public boolean compareTo(SWbemObject wbemObject)
throws WMIException
#compareTo(SWbemObject, Flags.CompareToFlag...
WMIException
public void delete(Integer flags,
SWbemNamedValueSet objWbemNamedValueSet)
throws WMIException
flags - Reserved and must be 0 (zero) if specified.objWbemNamedValueSet - [Optional] Typically, this is undefined.
Otherwise, this is an SWbemNamedValueSet object whose elements represent the context
information that can be used by the provider that is servicing the request.
A provider that supports or requires such information must document the recognized
value names, data type of the value, allowed values, and semantics.
WMIException
public void delete()
throws WMIException
delete(Integer, SWbemNamedValueSet)
WMIException
public SWbemObject execMethod(String methodName,
SWbemObject inParameters,
Integer flags,
SWbemNamedValueSet objWbemNamedValueSet)
throws WMIException
methodName - Name of the method for the object.inParameters - [Optional] An SWbemObject object that contains the input parameters for the method being executed.
By default, this parameter is undefined.flags - [Optional] Reserved. This value must be zero.objWbemNamedValueSet - [Optional] Typically, this is undefined.
Otherwise, this is an SWbemNamedValueSet object whose elements represent the context
information that can be used by the provider that is servicing the request.
A provider that supports or requires such information must document the recognized
value names, data type of the value, allowed values, and semantics.
SWbemObject object is returned.
The returned object contains the out parameters and return value for the method that is being executed.
WMIException
public SWbemObject execMethod(String methodName,
SWbemObject inParameters)
throws WMIException
execMethod(String, SWbemObject, Integer, SWbemNamedValueSet)
WMIException
public SWbemObject execMethod(String methodName)
throws WMIException
execMethod(String, SWbemObject, Integer, SWbemNamedValueSet)
WMIException
public String getObjectText(Integer flags)
throws WMIException
flags - [Optional] Reserved. This value must be zero.
WMIException
public String getObjectText()
throws WMIException
getObjectText(Integer)
WMIException
public SWbemObjectSet instances(SWbemNamedValueSet objWbemNamedValueSet,
Flags.InstancesFlag... flags)
throws WMIException
SWbemServices.execQuery().
flags - [Optional] Integer that determines the behavior of the call.objWbemNamedValueSet - [Optional] Typically, this is undefined.
Otherwise, this is an SWbemNamedValueSet object whose elements represent the context
information that can be used by the provider that is servicing the request.
A provider that supports or requires such information must document the recognized
value names, data type of the value, allowed values, and semantics.
WMIException
public SWbemObjectSet instances()
throws WMIException
instances(SWbemNamedValueSet, Flags.InstancesFlag...)
WMIException
public SWbemObjectPath put(SWbemNamedValueSet objWbemNamedValueSet,
Flags.PutFlag... flags)
throws WMIException
SWbemObject,
and your changes are written to WMI.
flags - [Optional] Determines if the call creates or updates the class or instance and if the call returns immediately.objWbemNamedValueSet - [Optional] Typically, this is undefined.
Otherwise, this is an SWbemNamedValueSet object whose elements represent the context
information that can be used by the provider that is servicing the request.
A provider that supports or requires such information must document the recognized
value names, data type of the value, allowed values, and semantics.
SWbemObjectPath object contains the object path of the instance or class that has been successfully committed to WMI.
WMIException
public SWbemObjectPath put()
throws WMIException
put(SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.PutFlag...)
WMIException
public SWbemObjectSet references(String resultClass,
String role,
Boolean classesOnly,
Boolean schemaOnly,
String requiredQualifier,
SWbemNamedValueSet objWbemNamedValueSet,
Flags.ReferenceFlag... flags)
throws WMIException
resultClass - [Optional] String that contains a class name. If specified, this optional parameter indicates that
the returned endpoints must belong to or be derived from the class specified in this parameter.role - [Optional] String that contains a property name.
If specified, this parameter indicates that the returned endpoints must participate in an association
with the source object in which the source object plays a particular role. The role is defined by
the name of a specified property (which must be a reference property) of an association.classesOnly - [Optional] Boolean value that indicates whether a list of class names should be returned rather than
actual instances of the classes. These are the classes to which the endpoint instances belong.
The default value for this parameter is FALSE.schemaOnly - [Optional] Boolean value that indicates whether the query applies to the schema rather than the data.
The default value for this parameter is FALSE. It can only be set to TRUE if the strObjectPath
parameter specifies the object path of a class. When set to TRUE, the set of returned
endpoints represent classes that are suitably associated with the source class in schema.requiredQualifier - [Optional] String that contains a qualifier name.
If specified, this parameter indicates that the returned endpoints must include
the specified qualifier.flags - [Optional] Integer that specifies additional flags to the operation.
The default value for this parameter is wbemFlagReturnImmediately,
which calls the method in the semisynchronous mode. This parameter can accept the following values.objWbemNamedValueSet - [Optional] Typically, this is undefined.
Otherwise, this is an SWbemNamedValueSet object whose elements represent the context
information that can be used by the provider that is servicing the request.
A provider that supports or requires such information must document the recognized
value names, data type of the value, allowed values, and semantics.
SWbemObjectSet will be returned.
WMIException
public SWbemObjectSet references()
throws WMIException
references(String, String, Boolean, Boolean, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.ReferenceFlag...)
WMIException
public SWbemObject spawnDerivedClass(Integer flags)
throws WMIException
flags - [Optional] Reserved. This value must be zero.
SWbemObject object contains the new class definition object. No object returns when there is an error.
WMIException
public SWbemObject spawnDerivedClass()
throws WMIException
spawnDerivedClass(Integer)
WMIException
public SWbemObject spawnInstance(Integer flags)
throws WMIException
SWbemServices.get()
or SWbemServices.execQuery().
Then, use this class definition to create new instances.
Create each new instance locally within the process, and then call SWbemObject.put()
to actually create the instance within WMI.
Note: Spawning an instance from an instance is supported, but the returned instance is empty.
flags - [Optional] Reserved. This value must be zero.
SWbemObject object that contains a new instance of the class.
WMIException
public SWbemObject spawnInstance()
throws WMIException
spawnInstance(Integer)
WMIException
public SWbemObjectSet subclasses(SWbemNamedValueSet objWbemNamedValueSet,
Flags.SubclassesFlag... flags)
throws WMIException
flags - [Optional] Determines how detailed the call enumerates.
The default values for this parameter are wbemFlagReturnImmediately
and wbemQueryFlagDeep.objWbemNamedValueSet - [Optional] Typically, this is undefined.
Otherwise, this is an SWbemNamedValueSet object whose elements represent the context
information that can be used by the provider that is servicing the request.
A provider that supports or requires such information must document the recognized
value names, data type of the value, allowed values, and semantics.
SWbemObjectSet contains subclasses of the current object will be returned.
WMIException
public SWbemObjectSet subclasses()
throws WMIException
subclasses(SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.SubclassesFlag...)
WMIException
public List<String> getDerivation()
throws WMIException
This property is read-only.
WMIException
public SWbemMethodSet getMethods()
throws WMIException
WMIException
public SWbemObject getInParametersByMethodName(String methodName)
throws WMIException
SWbemObject object whose properties define the input parameters for the specified method.
methodName - Name of the method for the in parameters.
SWbemObject object whose properties define the input parameters for the specified method.
WMIException
public SWbemObjectPath getPath()
throws WMIException
SWbemObjectPath object that represents the object path of the current class or instance.
This property can be passed as a parameter to methods that require an object path.
Only the class property of the returned SWbemObjectPath instance can be modified.
If you try to modify any other property, or try to call the methods SWbemObjectPath.setAsClass() or SWbemObjectPath.setAsSingleton()
you will get a WMIException.
Because of this, you cannot modify the SWbemNamedValueSet object
that is the value of the keys property of the returned SWbemObjectPath instance.
If you try to call the Add, Remove, or DeleteAll methods on this value, you will get a WMIException.
Furthermore, you cannot modify any SWbemNamedValue obtained from this collection.
Attempts to modify the value property return the same error.
However, if you call wmiClone() to create a copy,
the SWbemObjectPath.path property of the copy is fully modifiable.
SWbemObjectPath object that represents the object path of the current class or instance.
WMIException
public SWbemPropertySet getProperties()
throws WMIException
SWbemPropertySet object that is a collection of the properties for the current class or instance.
This property is read-only.
SWbemPropertySet object that is a collection of the properties for the current class or instance.
WMIException
public WMIVariant getPropertyByName(String propertyName)
throws WMIException
propertyName - Name of the property.
WMIException
public void setPropertyByName(String propertyName,
WMIVariant value)
throws WMIException
propertyName - Name of the property.value - The variant value of the property
WMIException
public SWbemQualifierSet getQualifiers()
throws WMIException
SWbemQualifierSet object that is a collection of the qualifiers for the current class or instance.
This property is read-only.
SWbemQualifierSet object that is a collection of the qualifiers for the current class or instance.
WMIException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||