|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcn.chenlichao.wmi4j.SWbemObjectSet
public class SWbemObjectSet
An SWbemObjectSet object is a collection of SWbemObject objects.
You can get an SWbemObjectSet object by calling any of the following methods or their asynchronous equivalents:
SWbemObject.associatorsSWbemObject.instancesSWbemObject.referencesSWbemObject.subclassesSWbemService.associatorsOfSWbemServices.referencesToSWbemServices.subclassesOfNote: The SWbemObjectSet object does not support the optional Add and Remove collection methods.
Note: Because the call-back to the sink might not be returned at the same authentication level as the client requires, it is recommended that you use semisynchronous instead of asynchronous communication. For more information, see Calling a Method.
Created by chenlichao on 14-7-22.
| 方法摘要 | |
|---|---|
int |
getCount()
Get how many items are in this SWbemObjectSet collection. |
SWbemSecurity |
getSecurity()
The security property is used to read, or set the security settings. |
SWbemObject |
item(String objectPath)
The Item method of the SWbemObjectSet object gets an SWbemObject from the collection. |
SWbemObject |
itemIndex(int index)
The itemIndex method returns the SWbemObject associated with the specified index into the collection. |
Iterator<E> |
iterator()
Create a iterator of this object set. |
| 从类 java.lang.Object 继承的方法 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法详细信息 |
|---|
public SWbemObject item(String objectPath)
throws WMIException
SWbemObject from the collection.
objectPath - Relative path of the object to retrieve from the collection. Example: Win32_LogicalDisk="C:"
SWbemObject object returns.
WMIException
IllegalArgumentException - Object path is empty.
public SWbemObject itemIndex(int index)
throws WMIException
SWbemObject associated with the specified index into the collection.
The index indicates the position of the element within the collection. Collection numbering starts at zero.
Important: This method only supported by Windows Server 2008 or higher versions.
index - Index of the item in the collection.
SWbemObject object returns.
WMIException
public SWbemSecurity getSecurity()
throws WMIException
SWbemSecurity object. The security settings in this object do not indicate the authentication,
impersonation, or privilege settings made on a connection to Windows Management Instrumentation (WMI),
or the security in effect for the proxy when an object is delivered to a sink in an asynchronous call.
Note: Setting the Security_ property of an SWbemObject object to NULL grants unlimited access to everyone all the time.
For more information, see SWbemSecurity.
WMIException
public int getCount()
throws WMIException
One thing to be careful of when using Count is that WMI does not keep a running tally of the number of items in a collection. If you request Count for a collection, WMI cannot instantly respond with a number; instead, it must literally count the items, enumerating the entire collection. For a collection that has relatively few items, such as services, this enumeration likely takes less than a second. Counting the number of events in an event log collection, however, can take considerably longer.
And then suppose you want to display the property values for every event in the collection. If so, WMI will have to enumerate the entire collection a second time.
Note: If you attempt to get this property from an SWbemObjectSet object that is returned from a method where the specified flags are included the wbemFlagForwardOnly flag, you will get an wbemErrFailed error.
WMIException
public Iterator<E> iterator()
throws WMIException
WMIException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||