Class Who

java.lang.Object
oshi.driver.unix.Who

@ThreadSafe public final class Who extends Object
Utility to query logged in users.
  • Field Details

    • WHO_FORMAT_LINUX

      private static final Pattern WHO_FORMAT_LINUX
    • WHO_DATE_FORMAT_LINUX

      private static final DateTimeFormatter WHO_DATE_FORMAT_LINUX
    • WHO_FORMAT_UNIX

      private static final Pattern WHO_FORMAT_UNIX
    • WHO_DATE_FORMAT_UNIX

      private static final DateTimeFormatter WHO_DATE_FORMAT_UNIX
  • Constructor Details

    • Who

      private Who()
  • Method Details

    • queryWho

      public static List<OSSession> queryWho()
      Query who to get logged in users
      Returns:
      A list of logged in user sessions
    • matchLinux

      private static boolean matchLinux(List<OSSession> whoList, String s)
      Attempt to match Linux WHO format and add to the list
      Parameters:
      whoList - the list to add to
      s - the string to match
      Returns:
      true if successful, false otherwise
    • matchUnix

      private static boolean matchUnix(List<OSSession> whoList, String s)
      Attempt to match Unix WHO format and add to the list
      Parameters:
      whoList - the list to add to
      s - the string to match
      Returns:
      true if successful, false otherwise