Class Who


  • @ThreadSafe
    public final class Who
    extends java.lang.Object
    Utility to query logged in users.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Who()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean matchLinux​(java.util.List<OSSession> whoList, java.lang.String s)
      Attempt to match Linux WHO format and add to the list
      private static boolean matchUnix​(java.util.List<OSSession> whoList, java.lang.String s)
      Attempt to match Unix WHO format and add to the list
      static java.util.List<OSSession> queryWho()
      Query who to get logged in users
      • Methods inherited from class java.lang.Object

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

      • WHO_FORMAT_LINUX

        private static final java.util.regex.Pattern WHO_FORMAT_LINUX
      • WHO_DATE_FORMAT_LINUX

        private static final java.time.format.DateTimeFormatter WHO_DATE_FORMAT_LINUX
      • WHO_FORMAT_UNIX

        private static final java.util.regex.Pattern WHO_FORMAT_UNIX
      • WHO_DATE_FORMAT_UNIX

        private static final java.time.format.DateTimeFormatter WHO_DATE_FORMAT_UNIX
    • Constructor Detail

      • Who

        private Who()
    • Method Detail

      • queryWho

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

        private static boolean matchLinux​(java.util.List<OSSession> whoList,
                                          java.lang.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​(java.util.List<OSSession> whoList,
                                         java.lang.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