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.out
to print XMPP traffic.
-
-
Constructor Summary
Constructors Constructor Description ConsoleDebugger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
createInputStream(InputStream inputStream)
Creates a new input stream from the actual input stream.OutputStream
createOutputStream(OutputStream outputStream)
Creates a new output stream from the actual output stream.void
initialize(XmppSession xmppSession)
This method is called when a new XMPP session is initialized.void
readStanza(String xml, Object stanza)
This method is called, whenever a stream element is read.void
writeStanza(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:XmppDebugger
This method is called when a new XMPP session is initialized.- Specified by:
initialize
in interfaceXmppDebugger
- Parameters:
xmppSession
- The XMPP session.
-
writeStanza
public void writeStanza(String xml, Object stanza)
Description copied from interface:XmppDebugger
This method is called, whenever a stream element is written.- Specified by:
writeStanza
in 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:XmppDebugger
This method is called, whenever a stream element is read.- Specified by:
readStanza
in 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:XmppDebugger
Creates 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:
createOutputStream
in interfaceXmppDebugger
- Parameters:
outputStream
- The actual output stream.- Returns:
- The (forked) output stream.
-
createInputStream
public InputStream createInputStream(InputStream inputStream)
Description copied from interface:XmppDebugger
Creates 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:
createInputStream
in interfaceXmppDebugger
- Parameters:
inputStream
- The actual input stream.- Returns:
- The (forked) input stream.
-
-