Class SessionWtsData


  • @ThreadSafe
    public final class SessionWtsData
    extends java.lang.Object
    Utility to read process data from HKEY_PERFORMANCE_DATA information with backup from Performance Counters or WMI
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SessionWtsData()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static int[] convertBytesToInts​(byte[] address)
      Per WTS_INFO_CLASS docs, the IP address is offset by two bytes from the start of the Address member of the WTS_CLIENT_ADDRESS structure.
      static java.util.List<OSSession> queryUserSessions()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • WTS_CLIENTPROTOCOLTYPE

        private static final int WTS_CLIENTPROTOCOLTYPE
        See Also:
        Constant Field Values
      • IS_VISTA_OR_GREATER

        private static final boolean IS_VISTA_OR_GREATER
      • WTS

        private static final com.sun.jna.platform.win32.Wtsapi32 WTS
    • Constructor Detail

      • SessionWtsData

        private SessionWtsData()
    • Method Detail

      • queryUserSessions

        public static java.util.List<OSSession> queryUserSessions()
      • convertBytesToInts

        private static int[] convertBytesToInts​(byte[] address)
        Per WTS_INFO_CLASS docs, the IP address is offset by two bytes from the start of the Address member of the WTS_CLIENT_ADDRESS structure. Also contrary to docs, IPv4 is not a null terminated string.

        This method converts the byte[20] to an int[4] parseable by existing code

        Parameters:
        address - The 20-byte array from the WTS_CLIENT_ADDRESS structure
        Returns:
        A 4-int array for ParseUtil.parseUtAddrV6toIP(int[])