Package com.sun.jna.platform.win32.COM
Class WbemcliUtil.WmiQuery<T extends Enum<T>>
- java.lang.Object
-
- com.sun.jna.platform.win32.COM.WbemcliUtil.WmiQuery<T>
-
- Enclosing class:
- WbemcliUtil
public static class WbemcliUtil.WmiQuery<T extends Enum<T>> extends Object
Helper class wrapping information required for a WMI query.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WbemcliUtil.WmiResult<T>
execute()
Query WMI for values, with no timeout.WbemcliUtil.WmiResult<T>
execute(int timeout)
Query WMI for values, with a specified timeout.String
getNameSpace()
Class<T>
getPropertyEnum()
String
getWmiClassName()
void
setNameSpace(String nameSpace)
void
setWmiClassName(String wmiClassName)
-
-
-
Constructor Detail
-
WmiQuery
public WmiQuery(String nameSpace, String wmiClassName, Class<T> propertyEnum)
Instantiate a WmiQuery.- Parameters:
nameSpace
- The WMI namespace to use.wmiClassName
- The WMI class to use. Optionally include a WQL WHERE clause with filters results to properties matching the input.propertyEnum
- An enum for type mapping.
-
-
Method Detail
-
getNameSpace
public String getNameSpace()
- Returns:
- The namespace
-
setNameSpace
public void setNameSpace(String nameSpace)
- Parameters:
nameSpace
- The namespace to set
-
getWmiClassName
public String getWmiClassName()
- Returns:
- The class name
-
setWmiClassName
public void setWmiClassName(String wmiClassName)
- Parameters:
wmiClassName
- The classname to set
-
execute
public WbemcliUtil.WmiResult<T> execute()
Query WMI for values, with no timeout.- Returns:
- a WmiResult object containing the query results, wrapping an EnumMap
-
execute
public WbemcliUtil.WmiResult<T> execute(int timeout) throws TimeoutException
Query WMI for values, with a specified timeout.- Parameters:
timeout
- Number of milliseconds to wait for results before timing out. IfWbemcli.WBEM_INFINITE
(-1), will always wait for results. If a timeout occurs, throws aTimeoutException
.- Returns:
- a WmiResult object containing the query results, wrapping an EnumMap
- Throws:
TimeoutException
- if the query times out before completion
-
-