org.jabber.jabberbeans
Class IQBean

java.lang.Object
  |
  +--org.jabber.jabberbeans.IQBean
All Implemented Interfaces:
PacketListenerRegistrar, java.io.Serializable

public class IQBean
extends java.lang.Object
implements java.io.Serializable, PacketListenerRegistrar

IQBean is a bean used to utilize the 'iq' functionality of the jabber protocol. IQ is used for setting and reading values, including user information (for logging on).

IQBean, like most of the other beans in jabberbeans, relies on ConnectionBean to provide the actual network socket to the server. IQBean will not operate until a connection is set.

See Also:
Serialized Form

Constructor Summary
IQBean()
          Creates a new IQBean instance.
IQBean(ConnectionBean connection)
          Creates a new IQBean instance, and registers it with an existing connection
 
Method Summary
 void addPacketListener(PacketListener l)
          addPacketListener registers a packet listener with our filtered packet rebroadcaster.
 void delPacketListener(PacketListener l)
          delPacketListener unregisters a packet listener with our filtered packet rebroadcaster.
 ConnectionBean getConnection()
          returns the connection bean in use, or null if none
 void send(InfoQuery packet)
          Send out a packet through the ConnectionBean.
 void setConnection(ConnectionBean connection)
          sets the connection bean required for the IQBean to operate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IQBean

public IQBean()
Creates a new IQBean instance.


IQBean

public IQBean(ConnectionBean connection)
Creates a new IQBean instance, and registers it with an existing connection

Parameters:
connection - ConnectionBean we will monitor
Method Detail

send

public void send(InfoQuery packet)
Send out a packet through the ConnectionBean.

Parameters:
packet - an InfoQuery packet

setConnection

public void setConnection(ConnectionBean connection)
sets the connection bean required for the IQBean to operate

Parameters:
connection - a ConnectionBean value which maps to a server connection.

getConnection

public ConnectionBean getConnection()
returns the connection bean in use, or null if none

Returns:
ConnectionBean value

addPacketListener

public final void addPacketListener(PacketListener l)
addPacketListener registers a packet listener with our filtered packet rebroadcaster.

Specified by:
addPacketListener in interface PacketListenerRegistrar
Parameters:
l - a PacketListener value

delPacketListener

public final void delPacketListener(PacketListener l)
delPacketListener unregisters a packet listener with our filtered packet rebroadcaster.

Specified by:
delPacketListener in interface PacketListenerRegistrar
Parameters:
l - a PacketListener value