Package jexer.backend

Class TTYSessionInfo

  • All Implemented Interfaces:
    SessionInfo

    public class TTYSessionInfo
    extends java.lang.Object
    implements SessionInfo
    TTYSessionInfo queries environment variables and the tty window size for the session information. The username is taken from user.name, language is taken from user.language, and text window size from 'stty size'.
    • Constructor Summary

      Constructors 
      Constructor Description
      TTYSessionInfo()
      Public constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getIdleTime()
      Get the time this session was idle.
      java.lang.String getLanguage()
      Language getter.
      long getStartTime()
      Get the time this session was started.
      java.lang.String getUsername()
      Username getter.
      int getWindowHeight()
      Text window height getter.
      int getWindowWidth()
      Text window width getter.
      void queryWindowSize()
      Re-query the text window size.
      void setIdleTime​(int seconds)
      Set the time this session was idle.
      void setLanguage​(java.lang.String language)
      Language setter.
      void setUsername​(java.lang.String username)
      Username setter.
      • Methods inherited from class java.lang.Object

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

      • TTYSessionInfo

        public TTYSessionInfo()
        Public constructor.
    • Method Detail

      • getStartTime

        public long getStartTime()
        Get the time this session was started.
        Specified by:
        getStartTime in interface SessionInfo
        Returns:
        the number of millis since midnight, January 1, 1970 UTC
      • getIdleTime

        public int getIdleTime()
        Get the time this session was idle.
        Specified by:
        getIdleTime in interface SessionInfo
        Returns:
        the number of seconds since the last user input event from this session
      • setIdleTime

        public void setIdleTime​(int seconds)
        Set the time this session was idle.
        Specified by:
        setIdleTime in interface SessionInfo
        Parameters:
        seconds - the number of seconds since the last user input event from this session
      • getUsername

        public java.lang.String getUsername()
        Username getter.
        Specified by:
        getUsername in interface SessionInfo
        Returns:
        the username
      • setUsername

        public void setUsername​(java.lang.String username)
        Username setter.
        Specified by:
        setUsername in interface SessionInfo
        Parameters:
        username - the value
      • getLanguage

        public java.lang.String getLanguage()
        Language getter.
        Specified by:
        getLanguage in interface SessionInfo
        Returns:
        the language
      • setLanguage

        public void setLanguage​(java.lang.String language)
        Language setter.
        Specified by:
        setLanguage in interface SessionInfo
        Parameters:
        language - the value
      • getWindowWidth

        public int getWindowWidth()
        Text window width getter.
        Specified by:
        getWindowWidth in interface SessionInfo
        Returns:
        the window width
      • getWindowHeight

        public int getWindowHeight()
        Text window height getter.
        Specified by:
        getWindowHeight in interface SessionInfo
        Returns:
        the window height
      • queryWindowSize

        public void queryWindowSize()
        Re-query the text window size.
        Specified by:
        queryWindowSize in interface SessionInfo