Class 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.

    • 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.
      • incomingStreamSink

        public abstract void incomingStreamSink​(java.lang.CharSequence incomingCharSequence)
      • 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.