Package org.jivesoftware.smack.debugger
Class SmackDebugger
- java.lang.Object
-
- org.jivesoftware.smack.debugger.SmackDebugger
-
- Direct Known Subclasses:
AbstractDebugger
,EnhancedDebugger
,LiteDebugger
,SLF4JSmackDebugger
public abstract class SmackDebugger extends java.lang.Object
Interface that allows for implementing classes to debug XML traffic. That is a GUI window that displays XML traffic.Every implementation of this interface must have a public constructor with the following arguments: XMPPConnection, Writer, Reader.
-
-
Field Summary
Fields Modifier and Type Field Description protected XMPPConnection
connection
-
Constructor Summary
Constructors Modifier Constructor Description protected
SmackDebugger(XMPPConnection connection)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
incomingStreamSink(java.lang.CharSequence incomingCharSequence)
java.io.Reader
newConnectionReader(java.io.Reader reader)
Returns a new special Reader that wraps the new connection Reader.java.io.Writer
newConnectionWriter(java.io.Writer writer)
Returns a new special Writer that wraps the new connection Writer.void
onIncomingElementCompleted()
abstract void
onIncomingStreamElement(TopLevelStreamElement streamElement)
Used by the connection to notify about an incoming top level stream element.void
onOutgoingElementCompleted()
abstract void
onOutgoingStreamElement(TopLevelStreamElement streamElement)
Used by the connection to notify about a outgoing top level stream element.abstract void
outgoingStreamSink(java.lang.CharSequence outgoingCharSequence)
Note that the sequence of characters may be pretty printed.abstract void
userHasLogged(EntityFullJid user)
Called when a user has logged in to the server.
-
-
-
Field Detail
-
connection
protected final XMPPConnection connection
-
-
Constructor Detail
-
SmackDebugger
protected SmackDebugger(XMPPConnection connection)
-
-
Method Detail
-
userHasLogged
public abstract void userHasLogged(EntityFullJid user)
Called when a user has logged in to the server. The user could be an anonymous user, this means that the user would be of the form host/resource instead of the form user@host/resource.- Parameters:
user
- the user@host/resource that has just logged in
-
outgoingStreamSink
public abstract void outgoingStreamSink(java.lang.CharSequence outgoingCharSequence)
Note that the sequence of characters may be pretty printed.- Parameters:
outgoingCharSequence
- the outgoing character sequence.
-
onOutgoingElementCompleted
public void onOutgoingElementCompleted()
-
incomingStreamSink
public abstract void incomingStreamSink(java.lang.CharSequence incomingCharSequence)
-
onIncomingElementCompleted
public void onIncomingElementCompleted()
-
newConnectionReader
public final java.io.Reader newConnectionReader(java.io.Reader reader)
Returns a new special Reader that wraps the new connection Reader. The connection has been secured so the connection is using a new reader and writer. The debugger needs to wrap the new reader and writer to keep being notified of the connection traffic.- Parameters:
reader
- connection reader.- Returns:
- a new special Reader that wraps the new connection Reader.
-
newConnectionWriter
public final java.io.Writer newConnectionWriter(java.io.Writer writer)
Returns a new special Writer that wraps the new connection Writer. The connection has been secured so the connection is using a new reader and writer. The debugger needs to wrap the new reader and writer to keep being notified of the connection traffic.- Parameters:
writer
- connection writer.- Returns:
- a new special Writer that wraps the new connection Writer.
-
onIncomingStreamElement
public abstract void onIncomingStreamElement(TopLevelStreamElement streamElement)
Used by the connection to notify about an incoming top level stream element.This method is invoked right after the incoming stream was parsed.
- Parameters:
streamElement
- the incoming top level stream element.
-
onOutgoingStreamElement
public abstract void onOutgoingStreamElement(TopLevelStreamElement streamElement)
Used by the connection to notify about a outgoing top level stream element.This method is invoked right before the element is serialized to XML and put into the outgoing stream.
- Parameters:
streamElement
- the outgoing top level stream element.
-
-