Package com.sun.jna.platform.win32.COM

## Class WbemcliUtil.WmiQuery<T extends java.lang.Enum<T>>

- java.lang.Object
- - com.sun.jna.platform.win32.COM.WbemcliUtil.WmiQuery<T>

- Enclosing class:
    WbemcliUtil

      public static class WbemcliUtil.WmiQuery<T extends java.lang.Enum<T>>
      extends java.lang.Object

  Helper class wrapping information required for a WMI query.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WmiQuery​(java.lang.String wmiClassName, java.lang.Class<T> propertyEnum)` | Instantiate a WMI Query in the default namespace
    `WmiQuery​(java.lang.String nameSpace, java.lang.String wmiClassName, java.lang.Class<T> propertyEnum)` | Instantiate a WmiQuery.

  - ### 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.
    `java.lang.String` | `getNameSpace()` |
    `java.lang.Class<T>` | `getPropertyEnum()` |
    `java.lang.String` | `getWmiClassName()` |
    `void` | `setNameSpace​(java.lang.String nameSpace)` |
    `void` | `setWmiClassName​(java.lang.String wmiClassName)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WmiQuery

          public WmiQuery​(java.lang.String nameSpace,
                          java.lang.String wmiClassName,
                          java.lang.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.

    - #### WmiQuery

          public WmiQuery​(java.lang.String wmiClassName,
                          java.lang.Class<T> propertyEnum)

      Instantiate a WMI Query in the default namespace
      Parameters:
        `wmiClassName` - The WMI Class to use. May include a WHERE clause with filtering conditions.
        `propertyEnum` - An Enum that contains the properties to query

  - ### Method Detail

    - #### getPropertyEnum

          public java.lang.Class<T> getPropertyEnum()

      Returns:
        The enum containing the properties

    - #### getNameSpace

          public java.lang.String getNameSpace()

      Returns:
        The namespace

    - #### setNameSpace

          public void setNameSpace​(java.lang.String nameSpace)

      Parameters:
        `nameSpace` - The namespace to set

    - #### getWmiClassName

          public java.lang.String getWmiClassName()

      Returns:
        The class name

    - #### setWmiClassName

          public void setWmiClassName​(java.lang.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 java.util.concurrent.TimeoutException

      Query WMI for values, with a specified timeout.
      Parameters:
        `timeout` - Number of milliseconds to wait for results before timing out. If `Wbemcli.WBEM_INFINITE` (-1), will always wait for results. If a timeout occurs, throws a `TimeoutException`.
      Returns:
        a WmiResult object containing the query results, wrapping an EnumMap
      Throws:
        `java.util.concurrent.TimeoutException` - if the query times out before completion