|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.net.PrintCommandListener
public class PrintCommandListener
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.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 outputMethod Detail |
---|
public 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |