cn.chenlichao.wmi4j
类 SWbemServices

java.lang.Object
  继承者 cn.chenlichao.wmi4j.AbstractSecurityScriptingObject
      继承者 cn.chenlichao.wmi4j.SWbemServices

public class SWbemServices
extends AbstractSecurityScriptingObject

You can use the methods of an SWbemServices object to perform operations against a namespace on either a local host or a remote host. SWbemServices object can be initialized by call SWbemLocator.connectServer() method only.

Created by chenlichao on 14-7-17.


方法摘要
 SWbemObjectSet associatorsOf(String objectPath)
          Use default parameters for method associatorsOf(String, String, String, String, String, Boolean, Boolean, String, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.AssociatorsFlag...)
 SWbemObjectSet associatorsOf(String objectPath, 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) called endpoints that are associated with a specified object.
 void delete(String objectPath)
          Use default parameters for method delete(String, Integer, SWbemNamedValueSet)
 void delete(String objectPath, Integer flags, SWbemNamedValueSet objWbemNamedValueSet)
          deletes the class or instance that is specified in the object path.
 SWbemObject execMethod(String objectPath, String methodName)
          Use default parameters for method execMethod(String, String, SWbemObject, Integer, SWbemNamedValueSet)
 SWbemObject execMethod(String objectPath, String methodName, SWbemObject inParameters)
          Use default parameters for method execMethod(String, String, SWbemObject, Integer, SWbemNamedValueSet)
 SWbemObject execMethod(String objectPath, String methodName, SWbemObject inParameters, Integer flags, SWbemNamedValueSet objWbemNamedValueSet)
          Executes a method that is exported by a method provider.
 SWbemEventSource execNotificationQuery(String queryString)
          Use default parameters for execNotificationQuery(String, String, Integer, SWbemNamedValueSet)
 SWbemEventSource execNotificationQuery(String queryString, String queryLanguage, Integer flags, SWbemNamedValueSet objWbemNamedValueSet)
          Executes a query to receive events.
 SWbemObjectSet execQuery(String queryString)
          Use default parameters for execQuery method execQuery(String, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.ExecQueryFlag...)
 SWbemObjectSet execQuery(String queryString, String queryLanguage, SWbemNamedValueSet objWbemNamedValueSet, Flags.ExecQueryFlag... flags)
          Executes a query to retrieve objects.
 SWbemObject get(String objectPath)
          Use default parameters for get method get(String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.GetFlag...)
 SWbemObject get(String objectPath, SWbemNamedValueSet objWbemNamedValueSet, Flags.GetFlag... flags)
          Retrieves an object, that is either a class definition or an instance, based on the object path.
 SWbemObjectSet instancesOf(String className)
          Use default parameters for method instancesOf(String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.InstancesFlag...)
 SWbemObjectSet instancesOf(String className, SWbemNamedValueSet objWbemNamedValueSet, Flags.InstancesFlag... flags)
          Creates an enumerator that returns the instances of a specified class according to the user-specified selection criteria.
 SWbemObjectSet referencesTo(String objectPath)
          Use default parameters for method referencesTo(String, String, String, Boolean, Boolean, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.ReferenceFlag...)
 SWbemObjectSet referencesTo(String objectPath, 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 a specific source class or instance.
 SWbemObjectSet subclassesOf(String superClass, SWbemNamedValueSet objWbemNamedValueSet, Flags.SubclassesFlag... flags)
          Returns an SWbemObjectSet object.
 
从类 cn.chenlichao.wmi4j.AbstractSecurityScriptingObject 继承的方法
getSecurity
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

associatorsOf

public SWbemObjectSet associatorsOf(String objectPath,
                                    String assocClass,
                                    String resultClass,
                                    String resultRole,
                                    String role,
                                    Boolean classesOnly,
                                    Boolean schemaOnly,
                                    String requiredAssocQualifier,
                                    String requiredQualifier,
                                    SWbemNamedValueSet objwbemNamedValueSet,
                                    Flags.AssociatorsFlag... flags)
                             throws WMIException
Returns a collection of objects (classes or instances) called endpoints that are associated with a specified object. This method performs the same function that the ASSOCIATORS OF WQL query performs. This method is called in the semisynchronous mode by default.

参数:
objectPath - String that contains the object path of the source class or instance.
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.
返回:
If successful a SWbemObjectSet will be returned.
抛出:
WMIException

associatorsOf

public SWbemObjectSet associatorsOf(String objectPath)
                             throws WMIException
Use default parameters for method associatorsOf(String, String, String, String, String, Boolean, Boolean, String, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.AssociatorsFlag...)

抛出:
WMIException

delete

public void delete(String objectPath,
                   Integer flags,
                   SWbemNamedValueSet objWbemNamedValueSet)
            throws WMIException
deletes the class or instance that is specified in the object path. You can only delete objects in the current namespace. If a dynamic provider supplies the class or instance, you cannot delete this object unless the provider supports class or instance deletion. This method is called in the synchronous mode.

参数:
objectPath - String that contains the object path to the object that you want to delete.
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.
抛出:
WMIException

delete

public void delete(String objectPath)
            throws WMIException
Use default parameters for method delete(String, Integer, SWbemNamedValueSet)

抛出:
WMIException

execMethod

public SWbemObject execMethod(String objectPath,
                              String methodName,
                              SWbemObject inParameters,
                              Integer flags,
                              SWbemNamedValueSet objWbemNamedValueSet)
                       throws WMIException
Executes a method that is exported by a method provider. This method blocks while the method that is forwarded to the appropriate provider executes. The information and status are then returned. The provider, rather than WMI, implements the method. This method is called in the synchronous mode.

参数:
objectPath - String that contains the object path of the object for which the method is executed.
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.
返回:
If the method is successful, an SWbemObject object is returned. The returned object contains the out parameters and return value for the method that is being executed.
抛出:
WMIException

execMethod

public SWbemObject execMethod(String objectPath,
                              String methodName,
                              SWbemObject inParameters)
                       throws WMIException
Use default parameters for method execMethod(String, String, SWbemObject, Integer, SWbemNamedValueSet)

抛出:
WMIException

execMethod

public SWbemObject execMethod(String objectPath,
                              String methodName)
                       throws WMIException
Use default parameters for method execMethod(String, String, SWbemObject, Integer, SWbemNamedValueSet)

抛出:
WMIException

execNotificationQuery

public SWbemEventSource execNotificationQuery(String queryString,
                                              String queryLanguage,
                                              Integer flags,
                                              SWbemNamedValueSet objWbemNamedValueSet)
                                       throws WMIException
Executes a query to receive events. The call returns immediately. The user can poll the returned enumerator for events as they arrive. The method is called in the semisynchronous mode.

参数:
queryString - String that contains the text of the event-related query. This parameter cannot be blank. For more information on building WMI query strings, see Querying with WQL and the WQL reference.
queryLanguage - [Optional] String that contains the query language to be used. If specified, this value must be "WQL".
flags - [Optional] This is an integer that determines the behavior of the query. If specified, this value must be 48.
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.
返回:
If no error occurs, this method returns an SWbemEventSource object. You can call the SWbemEventSource.nextEvent method to retrieve events as they arrive.
抛出:
WMIException

execNotificationQuery

public SWbemEventSource execNotificationQuery(String queryString)
                                       throws WMIException
Use default parameters for execNotificationQuery(String, String, Integer, SWbemNamedValueSet)

抛出:
WMIException

execQuery

public SWbemObjectSet execQuery(String queryString,
                                String queryLanguage,
                                SWbemNamedValueSet objWbemNamedValueSet,
                                Flags.ExecQueryFlag... flags)
                         throws WMIException
Executes a query to retrieve objects. These objects are available through the returned SWbemObjectSet collection.

参数:
queryString - String that contains the text of the query. This parameter cannot be blank. For more information on building WMI query strings, see Querying with WQL and the WQL reference.
queryLanguage - [Optional] String that contains the query language to be used. If specified, this value must be "WQL".
flags - [Optional] Integer that determines the behavior of the query and determines whether this call returns immediately. The default value for this parameter is wbemFlagReturnImmediately.
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.
返回:
If no error occurs, this method returns an SWbemObjectSet object. This is an object collection that contains the result set of the query.
抛出:
WMIException

execQuery

public SWbemObjectSet execQuery(String queryString)
                         throws WMIException
Use default parameters for execQuery method execQuery(String, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.ExecQueryFlag...)

抛出:
WMIException

get

public SWbemObject get(String objectPath,
                       SWbemNamedValueSet objWbemNamedValueSet,
                       Flags.GetFlag... flags)
                throws WMIException
Retrieves an object, that is either a class definition or an instance, based on the object path. This method retrieves only objects from the namespace that is associated with the current SWbemServices object.

参数:
objectPath - [Optional] String that contains the object path of the object to retrieve. If this value is empty, the empty object that is returned can become a new class.
flags - [Optional] Integer that determines the behavior of the query.
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.
返回:
If successful, this method returns an SWbemObject object that represents the requested object.
抛出:
WMIException

get

public SWbemObject get(String objectPath)
                throws WMIException
Use default parameters for get method get(String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.GetFlag...)

抛出:
WMIException

instancesOf

public SWbemObjectSet instancesOf(String className,
                                  SWbemNamedValueSet objWbemNamedValueSet,
                                  Flags.InstancesFlag... flags)
                           throws WMIException
Creates an enumerator that returns the instances of a specified class according to the user-specified selection criteria. This method implements a simple query. More complex queries may require the use of SWbemService.execQuery method.

参数:
className - String that contains the name of the class for which instances are desired. This parameter cannot be blank.
flags - This parameter determines how detailed the call enumerates and if this call returns immediately. The default value for this parameter is wbemFlagReturnImmediately.
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.
返回:
If successful, the method returns an SWbemObjectSet.
抛出:
WMIException

instancesOf

public SWbemObjectSet instancesOf(String className)
                           throws WMIException
Use default parameters for method instancesOf(String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.InstancesFlag...)

抛出:
WMIException

referencesTo

public SWbemObjectSet referencesTo(String objectPath,
                                   String resultClass,
                                   String role,
                                   Boolean classesOnly,
                                   Boolean schemaOnly,
                                   String requiredQualifier,
                                   SWbemNamedValueSet objWbemNamedValueSet,
                                   Flags.ReferenceFlag... flags)
                            throws WMIException
Returns a collection of all association classes or instances that refer to a specific source class or instance. This method performs the same function that the REFERENCES OF WQL query performs. This method is called in the semisynchronous mode.

参数:
objectPath - String that contains the object path of the source for this method.
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.
返回:
If successful a SWbemObjectSet will be returned.
抛出:
WMIException

referencesTo

public SWbemObjectSet referencesTo(String objectPath)
                            throws WMIException
Use default parameters for method referencesTo(String, String, String, Boolean, Boolean, String, SWbemNamedValueSet, cn.chenlichao.wmi4j.consts.Flags.ReferenceFlag...)

抛出:
WMIException

subclassesOf

public SWbemObjectSet subclassesOf(String superClass,
                                   SWbemNamedValueSet objWbemNamedValueSet,
                                   Flags.SubclassesFlag... flags)
                            throws WMIException
Returns an SWbemObjectSet object. This object is a collection of subclasses of a specified class. Items in the returned collection can be obtained using standard collection methods. This method only works for class objects. The method is called in the semisynchronous mode.

参数:
superClass - [Optional] Specifies a parent class name. Only subclasses of this class return in the enumerator. If you leave this parameter blank, and if flags is wbemQueryFlagShallow, only the top-level classes are returned (that is, classes that have no parent class). If this parameter is blank and flags is wbemQueryFlagDeep, all classes within the namespace are returned.
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.
返回:
If successful a SWbemObjectSet will be returned.
抛出:
WMIException


Copyright © 2014. All rights reserved.