public final class ConsoleDebugger extends java.lang.Object implements XmppDebugger
A simple debugger implementation, which uses System.out
to print XMPP traffic.
Constructor and Description |
---|
ConsoleDebugger() |
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
createInputStream(java.io.InputStream inputStream)
Creates a new input stream from the actual input stream.
|
java.io.OutputStream |
createOutputStream(java.io.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(java.lang.String xml,
java.lang.Object stanza)
This method is called, whenever a stream element is read.
|
void |
writeStanza(java.lang.String xml,
java.lang.Object stanza)
This method is called, whenever a stream element is written.
|
public void initialize(XmppSession xmppSession)
XmppDebugger
This method is called when a new XMPP session is initialized.
initialize
in interface XmppDebugger
xmppSession
- The XMPP session.public void writeStanza(java.lang.String xml, java.lang.Object stanza)
XmppDebugger
This method is called, whenever a stream element is written.
writeStanza
in interface XmppDebugger
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.public void readStanza(java.lang.String xml, java.lang.Object stanza)
XmppDebugger
This method is called, whenever a stream element is read.
readStanza
in interface XmppDebugger
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.public java.io.OutputStream createOutputStream(java.io.OutputStream outputStream)
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.
createOutputStream
in interface XmppDebugger
outputStream
- The actual output stream.public java.io.InputStream createInputStream(java.io.InputStream inputStream)
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.
createInputStream
in interface XmppDebugger
inputStream
- The actual input stream.Copyright © 2014–2019 XMPP.rocks. All rights reserved.