Smack

org.jivesoftware.smackx.debugger
Class EnhancedDebugger

java.lang.Object
  extended by org.jivesoftware.smackx.debugger.EnhancedDebugger
All Implemented Interfaces:
SmackDebugger

public class EnhancedDebugger
extends java.lang.Object
implements SmackDebugger

The EnhancedDebugger is a debugger that allows to debug sent, received and interpreted messages but also provides the ability to send ad-hoc messages composed by the user.

A new EnhancedDebugger will be created for each connection to debug. All the EnhancedDebuggers will be shown in the same debug window provided by the class EnhancedDebuggerWindow.

Author:
Gaston Dombiak

Constructor Summary
EnhancedDebugger(Connection connection, java.io.Writer writer, java.io.Reader reader)
           
 
Method Summary
 java.io.Reader getReader()
          Returns the special Reader that wraps the main Reader and logs data to the GUI.
 PacketListener getReaderListener()
          Returns the thread that will listen for all incoming packets and write them to the GUI.
 java.io.Writer getWriter()
          Returns the special Writer that wraps the main Writer and logs data to the GUI.
 PacketListener getWriterListener()
          Returns the thread that will listen for all outgoing packets and write them to the GUI.
 java.io.Reader newConnectionReader(java.io.Reader newReader)
          Returns a new special Reader that wraps the new connection Reader.
 java.io.Writer newConnectionWriter(java.io.Writer newWriter)
          Returns a new special Writer that wraps the new connection Writer.
 void userHasLogged(java.lang.String user)
          Called when a user has logged in to the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnhancedDebugger

public EnhancedDebugger(Connection connection,
                        java.io.Writer writer,
                        java.io.Reader reader)
Method Detail

newConnectionReader

public java.io.Reader newConnectionReader(java.io.Reader newReader)
Description copied from interface: SmackDebugger
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.

Specified by:
newConnectionReader in interface SmackDebugger
Returns:
a new special Reader that wraps the new connection Reader.

newConnectionWriter

public java.io.Writer newConnectionWriter(java.io.Writer newWriter)
Description copied from interface: SmackDebugger
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.

Specified by:
newConnectionWriter in interface SmackDebugger
Returns:
a new special Writer that wraps the new connection Writer.

userHasLogged

public void userHasLogged(java.lang.String user)
Description copied from interface: SmackDebugger
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.

Specified by:
userHasLogged in interface SmackDebugger
Parameters:
user - the user@host/resource that has just logged in

getReader

public java.io.Reader getReader()
Description copied from interface: SmackDebugger
Returns the special Reader that wraps the main Reader and logs data to the GUI.

Specified by:
getReader in interface SmackDebugger
Returns:
the special Reader that wraps the main Reader and logs data to the GUI.

getWriter

public java.io.Writer getWriter()
Description copied from interface: SmackDebugger
Returns the special Writer that wraps the main Writer and logs data to the GUI.

Specified by:
getWriter in interface SmackDebugger
Returns:
the special Writer that wraps the main Writer and logs data to the GUI.

getReaderListener

public PacketListener getReaderListener()
Description copied from interface: SmackDebugger
Returns the thread that will listen for all incoming packets and write them to the GUI. This is what we call "interpreted" packet data, since it's the packet data as Smack sees it and not as it's coming in as raw XML.

Specified by:
getReaderListener in interface SmackDebugger
Returns:
the PacketListener that will listen for all incoming packets and write them to the GUI

getWriterListener

public PacketListener getWriterListener()
Description copied from interface: SmackDebugger
Returns the thread that will listen for all outgoing packets and write them to the GUI.

Specified by:
getWriterListener in interface SmackDebugger
Returns:
the PacketListener that will listen for all sent packets and write them to the GUI

Smack

Copyright © 2003-2007 Jive Software.