Package rocks.xmpp.core.session.debug
Class ConsoleDebugger
- java.lang.Object
-
- rocks.xmpp.core.session.debug.ConsoleDebugger
-
- All Implemented Interfaces:
ReaderInterceptor,WriterInterceptor,XmppDebugger
public final class ConsoleDebugger extends Object implements XmppDebugger
A simple debugger implementation, which usesSystem.outto print XMPP traffic.
-
-
Constructor Summary
Constructors Constructor Description ConsoleDebugger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamcreateInputStream(InputStream inputStream)Creates a new input stream from the actual input stream.OutputStreamcreateOutputStream(OutputStream outputStream)Creates a new output stream from the actual output stream.voidinitialize(XmppSession xmppSession)This method is called when a new XMPP session is initialized.voidreadStanza(String xml, Object stanza)This method is called, whenever a stream element is read.voidwriteStanza(String xml, Object stanza)This method is called, whenever a stream element is written.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface rocks.xmpp.core.session.debug.XmppDebugger
process, process
-
-
-
-
Method Detail
-
initialize
public void initialize(XmppSession xmppSession)
Description copied from interface:XmppDebuggerThis method is called when a new XMPP session is initialized.- Specified by:
initializein interfaceXmppDebugger- Parameters:
xmppSession- The XMPP session.
-
writeStanza
public void writeStanza(String xml, Object stanza)
Description copied from interface:XmppDebuggerThis method is called, whenever a stream element is written.- Specified by:
writeStanzain interfaceXmppDebugger- Parameters:
xml- The xml representation of the stream element.stanza- The stream element. Maybe null, if no stream element, but an opening or closing stream element is written.
-
readStanza
public void readStanza(String xml, Object stanza)
Description copied from interface:XmppDebuggerThis method is called, whenever a stream element is read.- Specified by:
readStanzain interfaceXmppDebugger- Parameters:
xml- The xml representation of the stream element.stanza- The stream element. Maybe null, if no stream element, but an opening or closing stream element is read.
-
createOutputStream
public OutputStream createOutputStream(OutputStream outputStream)
Description copied from interface:XmppDebuggerCreates a new output stream from the actual output stream. This is useful is you want to log the actually written bytes. In this case you could fork the output stream and return the new forked stream.- Specified by:
createOutputStreamin interfaceXmppDebugger- Parameters:
outputStream- The actual output stream.- Returns:
- The (forked) output stream.
-
createInputStream
public InputStream createInputStream(InputStream inputStream)
Description copied from interface:XmppDebuggerCreates a new input stream from the actual input stream. This is useful is you want to log the actually read bytes. In this case you could fork the input stream and return the new forked stream.- Specified by:
createInputStreamin interfaceXmppDebugger- Parameters:
inputStream- The actual input stream.- Returns:
- The (forked) input stream.
-
-