edu.ou.kmi.buddyspace.plugins.disco.core
Class BSDiscoBean

java.lang.Object
  |
  +--edu.ou.kmi.buddyspace.plugins.disco.core.BSDiscoBean

public class BSDiscoBean
extends java.lang.Object

BSDiscoBean provides jabber disco. It relies on IQBean (this must be reset after reconnection).


Field Summary
protected  ConnectionBean connBean
           
protected  java.util.Vector discoListeners
           
protected  java.lang.String name
           
 
Constructor Summary
BSDiscoBean()
          Constructor
 
Method Summary
 void addDiscoListener(BSDiscoListener listener)
          Adds BSDiscoListener to listeners notified when disco events.
 void disconnected()
          Called when disconnected
 boolean discoverInfo(JID jid, PacketID id)
          Discovers info of the given jid
 boolean discoverInfo(JID jid, java.lang.String node, PacketID id)
          Discovers info of the given jid and node
 boolean discoverItems(JID jid, PacketID id)
          Discovers items of the given jid
 boolean discoverItems(JID jid, java.lang.String node, PacketID id)
          Discovers items of the given jid and node
 ConnectionBean getConnection()
          Returns currently used ConnectionBean.
protected  void prepareToDestroy()
          Frees all object bindings to allow object destroy
 void receivedPacket(PacketEvent pe)
          called when a packet is received and processed.
 void removeAllDiscoListeners()
          Removes all listeners notified when presence state of some of buddies changes.
 void removeDiscoListener(BSDiscoListener listener)
          Removes BSDiscoListener to listeners notified about disco events.
 void sendFailed(PacketEvent pe)
          called if a packet is not successfully sent (for instance, if the connection dies while the packet is queued, or a packet is sent while disconnected).
 boolean sendIQ(InfoQuery iq)
          Sends given iq packet
 void sentPacket(PacketEvent pe)
          called whenever a local client sends a packet, after the sending is successful
 void setConnection(ConnectionBean connBean)
          Sets existing and connected ConnectionBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connBean

protected ConnectionBean connBean

discoListeners

protected java.util.Vector discoListeners

name

protected final java.lang.String name
See Also:
Constant Field Values
Constructor Detail

BSDiscoBean

public BSDiscoBean()
Constructor

Method Detail

setConnection

public void setConnection(ConnectionBean connBean)
Sets existing and connected ConnectionBean. Then this is registered as listener for packets.


getConnection

public ConnectionBean getConnection()
Returns currently used ConnectionBean.


disconnected

public void disconnected()
Called when disconnected


discoverItems

public boolean discoverItems(JID jid,
                             java.lang.String node,
                             PacketID id)
Discovers items of the given jid and node


discoverItems

public boolean discoverItems(JID jid,
                             PacketID id)
Discovers items of the given jid


discoverInfo

public boolean discoverInfo(JID jid,
                            java.lang.String node,
                            PacketID id)
Discovers info of the given jid and node


discoverInfo

public boolean discoverInfo(JID jid,
                            PacketID id)
Discovers info of the given jid


sendIQ

public boolean sendIQ(InfoQuery iq)
Sends given iq packet


prepareToDestroy

protected void prepareToDestroy()
Frees all object bindings to allow object destroy


receivedPacket

public void receivedPacket(PacketEvent pe)
called when a packet is received and processed.


sendFailed

public void sendFailed(PacketEvent pe)
called if a packet is not successfully sent (for instance, if the connection dies while the packet is queued, or a packet is sent while disconnected).


sentPacket

public void sentPacket(PacketEvent pe)
called whenever a local client sends a packet, after the sending is successful


addDiscoListener

public void addDiscoListener(BSDiscoListener listener)
Adds BSDiscoListener to listeners notified when disco events.

See Also:
#removePresenceListener, #removeAllPresenceListeners, #firePresenceChanged, #fireSubscriptionRequested, #fireSubscriptionApproved

removeDiscoListener

public void removeDiscoListener(BSDiscoListener listener)
Removes BSDiscoListener to listeners notified about disco events.

See Also:
#addPresenceListener, #removeAllPresenceListeners, #firePresenceChanged, #fireSubscriptionRequested, #fireSubscriptionApproved

removeAllDiscoListeners

public void removeAllDiscoListeners()
Removes all listeners notified when presence state of some of buddies changes. This can be used before to free dependencies and allow dispose of all objects.

See Also:
#addPresenceListener, #removePresenceListener, #firePresenceChanged, #fireSubscriptionRequested, #fireSubscriptionApproved