Class PrintCommandListener

  • All Implemented Interfaces:
    java.util.EventListener, ProtocolCommandListener

    public class PrintCommandListener
    extends java.lang.Object
    implements ProtocolCommandListener
    This is a support class for some of the example programs. It is a sample implementation of the ProtocolCommandListener interface which just prints out to a specified stream all command/reply traffic.
    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      PrintCommandListener​(java.io.PrintStream stream)
      Create the default instance which prints everything.
      PrintCommandListener​(java.io.PrintStream stream, boolean suppressLogin)
      Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      PrintCommandListener​(java.io.PrintStream stream, boolean suppressLogin, char eolMarker)
      Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      PrintCommandListener​(java.io.PrintStream stream, boolean suppressLogin, char eolMarker, boolean showDirection)
      Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      PrintCommandListener​(java.io.PrintWriter writer)
      Create the default instance which prints everything.
      PrintCommandListener​(java.io.PrintWriter writer, boolean suppressLogin)
      Create an instance which optionally suppresses login command text.
      PrintCommandListener​(java.io.PrintWriter writer, boolean suppressLogin, char eolMarker)
      Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      PrintCommandListener​(java.io.PrintWriter writer, boolean suppressLogin, char eolMarker, boolean showDirection)
      Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
    • Constructor Detail

      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintStream stream)
        Create the default instance which prints everything.
        Parameters:
        stream - where to write the commands and responses e.g. System.out
        Since:
        3.0
      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintStream stream,
                                    boolean suppressLogin)
        Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
        Parameters:
        stream - where to write the commands and responses
        suppressLogin - if true, only print command name for login
        Since:
        3.0
      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintStream stream,
                                    boolean suppressLogin,
                                    char eolMarker)
        Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
        Parameters:
        stream - where to write the commands and responses
        suppressLogin - if true, only print command name for login
        eolMarker - if non-zero, add a marker just before the EOL.
        Since:
        3.0
      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintStream stream,
                                    boolean suppressLogin,
                                    char eolMarker,
                                    boolean showDirection)
        Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
        Parameters:
        stream - where to write the commands and responses
        suppressLogin - if true, only print command name for login
        eolMarker - if non-zero, add a marker just before the EOL.
        showDirection - if true, add "> " or "< " as appropriate to the output
        Since:
        3.0
      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintWriter writer)
        Create the default instance which prints everything.
        Parameters:
        writer - where to write the commands and responses
      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintWriter writer,
                                    boolean suppressLogin)
        Create an instance which optionally suppresses login command text.
        Parameters:
        writer - where to write the commands and responses
        suppressLogin - if true, only print command name for login
        Since:
        3.0
      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintWriter writer,
                                    boolean suppressLogin,
                                    char eolMarker)
        Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
        Parameters:
        writer - where to write the commands and responses
        suppressLogin - if true, only print command name for login
        eolMarker - if non-zero, add a marker just before the EOL.
        Since:
        3.0
      • PrintCommandListener

        public PrintCommandListener​(java.io.PrintWriter writer,
                                    boolean suppressLogin,
                                    char eolMarker,
                                    boolean showDirection)
        Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
        Parameters:
        writer - where to write the commands and responses
        suppressLogin - if true, only print command name for login
        eolMarker - if non-zero, add a marker just before the EOL.
        showDirection - if true, add "> " or "< " as appropriate to the output
        Since:
        3.0