public class PrintCommandListener extends Object implements ProtocolCommandListener
Constructor and Description |
---|
PrintCommandListener(PrintStream stream)
Create the default instance which prints everything.
|
PrintCommandListener(PrintStream stream,
boolean suppressLogin)
Create an instance which optionally suppresses login command text
and indicates where the EOL starts with the specified character.
|
PrintCommandListener(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(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(PrintWriter writer)
Create the default instance which prints everything.
|
PrintCommandListener(PrintWriter writer,
boolean suppressLogin)
Create an instance which optionally suppresses login command text.
|
PrintCommandListener(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(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.
|
Modifier and Type | Method and Description |
---|---|
void |
protocolCommandSent(ProtocolCommandEvent event)
This method is invoked by a ProtocolCommandEvent source after
sending a protocol command to a server.
|
void |
protocolReplyReceived(ProtocolCommandEvent event)
This method is invoked by a ProtocolCommandEvent source after
receiving a reply from a server.
|
public PrintCommandListener(PrintStream stream)
stream
- where to write the commands and responses
e.g. System.outpublic PrintCommandListener(PrintStream stream, boolean suppressLogin)
stream
- where to write the commands and responsessuppressLogin
- if true
, only print command name for loginpublic PrintCommandListener(PrintStream stream, boolean suppressLogin, char eolMarker)
stream
- where to write the commands and responsessuppressLogin
- if true
, only print command name for logineolMarker
- if non-zero, add a marker just before the EOL.public PrintCommandListener(PrintStream stream, boolean suppressLogin, char eolMarker, boolean showDirection)
stream
- where to write the commands and responsessuppressLogin
- if true
, only print command name for logineolMarker
- if non-zero, add a marker just before the EOL.showDirection
- if true
, add "> "
or "< "
as appropriate to the outputpublic PrintCommandListener(PrintWriter writer)
writer
- where to write the commands and responsespublic PrintCommandListener(PrintWriter writer, boolean suppressLogin)
writer
- where to write the commands and responsessuppressLogin
- if true
, only print command name for loginpublic PrintCommandListener(PrintWriter writer, boolean suppressLogin, char eolMarker)
writer
- where to write the commands and responsessuppressLogin
- if true
, only print command name for logineolMarker
- if non-zero, add a marker just before the EOL.public PrintCommandListener(PrintWriter writer, boolean suppressLogin, char eolMarker, boolean showDirection)
writer
- where to write the commands and responsessuppressLogin
- if true
, only print command name for logineolMarker
- if non-zero, add a marker just before the EOL.showDirection
- if true
, add ">
" or "< "
as appropriate to the outputpublic void protocolCommandSent(ProtocolCommandEvent event)
ProtocolCommandListener
protocolCommandSent
in interface ProtocolCommandListener
event
- The ProtocolCommandEvent fired.public void protocolReplyReceived(ProtocolCommandEvent event)
ProtocolCommandListener
protocolReplyReceived
in interface ProtocolCommandListener
event
- The ProtocolCommandEvent fired.Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.