Class TelnetServer.Authenticator

  • Direct Known Subclasses:
    TelnetDefaultAuthenticator
    Enclosing class:
    TelnetServer

    public abstract static class TelnetServer.Authenticator
    extends java.lang.Object
    Absctract class used as template for authenticators.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.logging.Logger LOG  
      protected java.io.BufferedReader STDIN  
      protected java.io.PrintWriter STDOUT  
    • Constructor Summary

      Constructors 
      Constructor Description
      Authenticator​(java.io.BufferedReader STDIN, java.io.PrintWriter STDOUT)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void handle()
      Executes the authenticator proccess.
      boolean isAuthenticated()
      Check if the user has been successfully authenticated.
      protected void isAuthenticated​(boolean Status)
      Set the status of the user authentication.
      abstract TelnetServer.Authenticator newAuthenticator​(java.io.BufferedReader STDIN, java.io.PrintWriter STDOUT)
      Make a new authenticator instance.
      java.lang.String user()
      Get the username of the authenticated user.
      protected void user​(java.lang.String User)
      Set the username of the authenticated user.
      • Methods inherited from class java.lang.Object

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

      • LOG

        protected static final java.util.logging.Logger LOG
      • STDIN

        protected final java.io.BufferedReader STDIN
      • STDOUT

        protected final java.io.PrintWriter STDOUT
    • Constructor Detail

      • Authenticator

        public Authenticator​(java.io.BufferedReader STDIN,
                             java.io.PrintWriter STDOUT)
    • Method Detail

      • isAuthenticated

        public boolean isAuthenticated()
        Check if the user has been successfully authenticated.
        Returns:
        True if the user has been authenticated, false otherwise.
      • isAuthenticated

        protected void isAuthenticated​(boolean Status)
        Set the status of the user authentication.
        Parameters:
        Status - True if the user has been authenticated, false otherwise.
      • user

        public java.lang.String user()
        Get the username of the authenticated user.
        Returns:
        Username
      • user

        protected void user​(java.lang.String User)
        Set the username of the authenticated user.
        Parameters:
        User - Username.
      • newAuthenticator

        public abstract TelnetServer.Authenticator newAuthenticator​(java.io.BufferedReader STDIN,
                                                                    java.io.PrintWriter STDOUT)
        Make a new authenticator instance.
        Parameters:
        STDIN - The standard input stream.
        STDOUT - The standard output stream.
        Returns:
        A new Authenticator instance.
      • handle

        public abstract void handle()
        Executes the authenticator proccess.