| Modifier and Type | Class and Description |
|---|---|
| private static enum | WbemcliUtil.NamespaceProperty
Enum containing the property used for WMI Namespace query. |
| public static class | |
| public class | WbemcliUtil.WmiResult<T extends Enum
Helper class wrapping an EnumMap containing the results of a query. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | DEFAULT_NAMESPACE
The default namespace for most WMI queries. |
| public static final WbemcliUtil | INSTANCE
Instance to generate the WmiQuery class. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Wbemcli. | Returns: A service representing the connected namespace, which can be queried. This service may be re-used for multiple queries and should be released by the userThe namespace to connect to namespace)Obtains a locator to the WMI server and connects to the specified namespace |
| public static boolean | Returns: true if the namespace exists, false otherwiseThe namespace to test namespace)Determine if WMI has the requested namespace. |
| DEFAULT_NAMESPACE | back to summary |
|---|---|
| public static final String DEFAULT_NAMESPACE The default namespace for most WMI queries. | |
| INSTANCE | back to summary |
|---|---|
| public static final WbemcliUtil INSTANCE Instance to generate the WmiQuery class. | |
| WbemcliUtil | back to summary |
|---|---|
| public WbemcliUtil() | |
| connectServer | back to summary |
|---|---|
| public static Wbemcli. Obtains a locator to the WMI server and connects to the specified namespace
| |
| hasNamespace | back to summary |
|---|---|
| public static boolean hasNamespace(String namespace) Determine if WMI has the requested namespace. Some namespaces only exist on newer versions of Windows.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final WbemcliUtil. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static WbemcliUtil. | |
| public static WbemcliUtil. |
| NAME | back to summary |
|---|---|
| public static final WbemcliUtil. | |
| NamespaceProperty | back to summary |
|---|---|
| private NamespaceProperty() | |
| valueOf | back to summary |
|---|---|
| public static WbemcliUtil. | |
| values | back to summary |
|---|---|
| public static WbemcliUtil. | |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static <T extends Enum | Returns: A WmiResult object encapsulating an EnumMap which will hold the results. Values, that are not supported by this helper (Dispatch, Unknown, SAFEARRAY) are
not returned and reported as null.The enumerator with the results enumerator,The enum containing the properties to enumerate, which are
the keys to the WmiResult map propertyEnum, int Number of milliseconds to wait for results before timing
out. If timeout)IEnumWbemClassObject#WBEM_INFINITE (-1),
will always wait for results.Enumerate the results of a WMI query. |
| public WbemcliUtil. | Returns: a WmiResult object containing the query results, wrapping an EnumMapQuery WMI for values, with no timeout. |
| public WbemcliUtil. | Returns: a WmiResult object containing the query results, wrapping an EnumMapNumber of milliseconds to wait for results before timing
out. If timeout)IEnumWbemClassObject#WBEM_INFINITE (-1),
will always wait for results. If a timeout occurs, throws
a TimeoutException.Query WMI for values, with a specified timeout. |
| public String | |
| public Class | |
| public String | |
| private static <T extends Enum | Returns: An enumerator to receive the results of the queryA WbemServices object to make the calls svc,A WmiQuery object encapsulating the details of the query querySelects properties from WMI. |
| public void | |
| public void |
| nameSpace | back to summary |
|---|---|
| private String nameSpace | |
| propertyEnum | back to summary |
|---|---|
| private Class<T> propertyEnum | |
| wmiClassName | back to summary |
|---|---|
| private String wmiClassName | |
| WmiQuery | back to summary |
|---|---|
| public WmiQuery(String nameSpace, String wmiClassName, Class<T> propertyEnum) Instantiate a WmiQuery. | |
| WmiQuery | back to summary |
|---|---|
| public WmiQuery(String wmiClassName, Class<T> propertyEnum) Instantiate a WMI Query in the default namespace | |
| enumerateProperties | back to summary |
|---|---|
| private static <T extends Enum Enumerate the results of a WMI query. This method is called while results are still being retrieved and may iterate in the forward direction only.
| |
| execute | back to summary |
|---|---|
| public WbemcliUtil. Query WMI for values, with no timeout.
| |
| execute | back to summary |
|---|---|
| public WbemcliUtil. Query WMI for values, with a specified timeout.
| |
| getNameSpace | back to summary |
|---|---|
public String getNameSpace()
| |
| getPropertyEnum | back to summary |
|---|---|
public Class
| |
| getWmiClassName | back to summary |
|---|---|
public String getWmiClassName()
| |
| selectProperties | back to summary |
|---|---|
| private static <T extends Enum Selects properties from WMI. Returns immediately (asynchronously), even while results are being retrieved; results may begun to be enumerated in the forward direction only.
| |
| setNameSpace | back to summary |
|---|---|
public void setNameSpace(String nameSpace)
| |
| setWmiClassName | back to summary |
|---|---|
public void setWmiClassName(String wmiClassName)
| |
| Modifier and Type | Field and Description |
|---|---|
| private Map | |
| private Map | |
| private int | |
| private Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public int | Returns: An integer representing the CIM typeThe property (column) whose type to fetch property)Gets the CIM type from the WmiResult. |
| public int | |
| public Object | Returns: The Object containing the specified value, which may be nullThe property (column) to fetch property, int The index (row) to fetch index)Gets a value from the WmiResult, which may be null. |
| public int | Returns: An integer representing the Variant typeThe property (column) whose type to fetch property)Gets the Variant type from the WmiResult. |
| private void |
| cimTypeMap | back to summary |
|---|---|
| private Map<T, Integer> cimTypeMap | |
| propertyMap | back to summary |
|---|---|
| private Map<T, List<Object>> propertyMap | |
| resultCount | back to summary |
|---|---|
| private int resultCount | |
| vtTypeMap | back to summary |
|---|---|
| private Map<T, Integer> vtTypeMap | |
| WmiResult | back to summary |
|---|---|
public WmiResult(Class<T> propertyEnum)
| |
| add | back to summary |
|---|---|
| private void add(int vtType, int cimType, T property, Object o) Adds a value to the WmiResult at the next index for that property
| |
| getCIMType | back to summary |
|---|---|
| public int getCIMType(T property) Gets the CIM type from the WmiResult. The integer value is defined as
a CIM_* constant in the
| |
| getResultCount | back to summary |
|---|---|
public int getResultCount()
| |
| getValue | back to summary |
|---|---|
| public Object getValue(T property, int index) Gets a value from the WmiResult, which may be null. User must check
for null and cast the result. Types correlate to the CIM Type of the
enumerated WMI property and will be consistent for a given property,
and may be validated by the user using
| |
| getVtType | back to summary |
|---|---|
| public int getVtType(T property) Gets the Variant type from the WmiResult. The integer value is
defined as a VT_* constant in the
| |
| incrementResultCount | back to summary |
|---|---|
| private void incrementResultCount() Increment the result count by one. | |