Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.debugger
Class SmackPacketDebugger

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.debugger.SmackPacketDebugger
All Implemented Interfaces:
org.jivesoftware.smack.PacketInterceptor, org.jivesoftware.smack.PacketListener

public class SmackPacketDebugger
extends Object
implements org.jivesoftware.smack.PacketListener, org.jivesoftware.smack.PacketInterceptor

The jabber packet listener that logs the packets to the packet logging service.

Author:
Damian Minkov

Constructor Summary
SmackPacketDebugger()
          Creates the SmackPacketDebugger instance.
 
Method Summary
 void interceptPacket(org.jivesoftware.smack.packet.Packet packet)
          Process the packet that is about to be sent to the server.
 void processPacket(org.jivesoftware.smack.packet.Packet packet)
          Process the next packet sent to this packet listener.
 void setConnection(org.jivesoftware.smack.XMPPConnection connection)
          Sets current connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmackPacketDebugger

public SmackPacketDebugger()
Creates the SmackPacketDebugger instance.

Method Detail

setConnection

public void setConnection(org.jivesoftware.smack.XMPPConnection connection)
Sets current connection.

Parameters:
connection - the connection.

interceptPacket

public void interceptPacket(org.jivesoftware.smack.packet.Packet packet)
Process the packet that is about to be sent to the server. The intercepted packet can be modified by the interceptor.

Interceptors are invoked using the same thread that requested the packet to be sent, so it's very important that implementations of this method not block for any extended period of time.

Specified by:
interceptPacket in interface org.jivesoftware.smack.PacketInterceptor
Parameters:
packet - the packet to is going to be sent to the server.

processPacket

public void processPacket(org.jivesoftware.smack.packet.Packet packet)
Process the next packet sent to this packet listener.

A single thread is responsible for invoking all listeners, so it's very important that implementations of this method not block for any extended period of time.

Specified by:
processPacket in interface org.jivesoftware.smack.PacketListener
Parameters:
packet - the packet to process.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.