core
Class PresenceManager

java.lang.Object
  extended bycore.EventNotifier
      extended bycore.PresenceManager
All Implemented Interfaces:
java.lang.Runnable

public class PresenceManager
extends EventNotifier
implements java.lang.Runnable

This class is responsible for updating presence information to the application.

Author:
hoela

Constructor Summary
PresenceManager(ContactList contactList, Contact me)
           
 
Method Summary
 boolean accept(Contact contact)
          Accepts a subscription request contact the Contact.
 void block(Contact contact)
           
 boolean deny(Contact contact)
          Denies a subscription request contact the Contact.
 void finalPresence()
          Sends UNAVAILABLE presence to all subscribed contacts.
 void incomingPresence(PresenceMessage presence)
           
 void initialPresence()
          Sends presence probes and availability to properly subscribed contacts.
 void remove(Contact contact)
           
 void run()
           
 void start()
           
 void stop()
           
 boolean subscribe(Contact from)
          Sends a subscription request to the Contact specified.
 
Methods inherited from class core.EventNotifier
addListener, removeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PresenceManager

public PresenceManager(ContactList contactList,
                       Contact me)
Parameters:
contactList - the user's contactlist.
me - the user's contact information
Method Detail

initialPresence

public void initialPresence()
Sends presence probes and availability to properly subscribed contacts.


finalPresence

public void finalPresence()
Sends UNAVAILABLE presence to all subscribed contacts.


subscribe

public boolean subscribe(Contact from)
Sends a subscription request to the Contact specified.

Parameters:
from - The contact to subscribe to.
Returns:
True if the subscription request was sent, false otherwise

accept

public boolean accept(Contact contact)
Accepts a subscription request contact the Contact.

Parameters:
contact - the contact whose subscription request it was
Returns:
true if the contact's request was properly sent; false otherwise

deny

public boolean deny(Contact contact)
Denies a subscription request contact the Contact.

Parameters:
contact - the contact whose subscription request it was
Returns:
true if the subscription denial was properly sent; false otherwise

remove

public void remove(Contact contact)

block

public void block(Contact contact)

incomingPresence

public void incomingPresence(PresenceMessage presence)

start

public void start()

stop

public void stop()

run

public void run()
Specified by:
run in interface java.lang.Runnable