public class PrintCommandListener extends java.lang.Object implements ProtocolCommandListener
Modifier and Type | Field and Description |
---|---|
private boolean |
__directionMarker |
private char |
__eolMarker |
private boolean |
__nologin |
private java.io.PrintWriter |
__writer |
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
getPrintableString(java.lang.String msg) |
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.
|
private final java.io.PrintWriter __writer
private final boolean __nologin
private final char __eolMarker
private final boolean __directionMarker
public PrintCommandListener(java.io.PrintStream stream)
stream
- where to write the commands and responses
e.g. System.outpublic PrintCommandListener(java.io.PrintStream stream, boolean suppressLogin)
stream
- where to write the commands and responsessuppressLogin
- if true
, only print command name for loginpublic PrintCommandListener(java.io.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(java.io.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(java.io.PrintWriter writer)
writer
- where to write the commands and responsespublic PrintCommandListener(java.io.PrintWriter writer, boolean suppressLogin)
writer
- where to write the commands and responsessuppressLogin
- if true
, only print command name for loginpublic PrintCommandListener(java.io.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(java.io.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.private java.lang.String getPrintableString(java.lang.String msg)
public void protocolReplyReceived(ProtocolCommandEvent event)
ProtocolCommandListener
protocolReplyReceived
in interface ProtocolCommandListener
event
- The ProtocolCommandEvent fired.