tigase.jaxmpp.core.client.xmpp.modules.presence
Class PresenceModule

java.lang.Object
  extended by tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule<Presence>
      extended by tigase.jaxmpp.core.client.xmpp.modules.presence.PresenceModule
All Implemented Interfaces:
XmppModule

public class PresenceModule
extends AbstractStanzaModule<Presence>

Module for handling presence information.


Nested Class Summary
static class PresenceModule.PresenceEvent
          Presence related event.
 
Field Summary
static EventType BeforeInitialPresence
          Event fired before initial presence is sent.
static EventType BeforePresenceSend
          Event fired before each presence sent by client.
static EventType ContactAvailable
          Event fired when contact (understood as bare JID) becomes available.
static EventType ContactChangedPresence
          Event fired when contact changed his presence.
static EventType ContactUnavailable
          Event fired when contact (understood as bare JID) goes offline.
static EventType ContactUnsubscribed
          Event fired when contact is unsubscribed.
static Criteria CRIT
           
static EventType SubscribeRequest
          Event fired when subscription request is received.
 
Fields inherited from class tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule
log, observable, sessionObject, writer
 
Constructor Summary
PresenceModule(Observable parentObservable, SessionObject sessionObject, PacketWriter packetWriter)
           
 
Method Summary
protected  void contactOffline(JID jid)
           
protected  boolean fireBeforePresenceSend(Presence presence)
           
 Criteria getCriteria()
          Criteria
 String[] getFeatures()
           Returns features what are implemented by Module.
 PresenceStore getPresence()
           
 void process(Presence presence)
           
 void sendInitialPresence()
           
 void setPresence(Presence.Show show, String status, Integer priority)
          Sends own presence.
 void subscribe(JID jid)
          Subscribe for presence.
 void subscribed(JID jid)
           
 void unsubscribe(JID jid)
           
 void unsubscribed(JID jid)
           
 
Methods inherited from class tigase.jaxmpp.core.client.xmpp.modules.AbstractStanzaModule
addListener, addListener, process, removeAllListeners, removeListener, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BeforeInitialPresence

public static final EventType BeforeInitialPresence
Event fired before initial presence is sent.


BeforePresenceSend

public static final EventType BeforePresenceSend
Event fired before each presence sent by client.


ContactAvailable

public static final EventType ContactAvailable
Event fired when contact (understood as bare JID) becomes available. Fired when first resource of JID becomes available.


ContactChangedPresence

public static final EventType ContactChangedPresence
Event fired when contact changed his presence.


ContactUnavailable

public static final EventType ContactUnavailable
Event fired when contact (understood as bare JID) goes offline. Fired when no more resources are available.


ContactUnsubscribed

public static final EventType ContactUnsubscribed
Event fired when contact is unsubscribed.


CRIT

public static final Criteria CRIT

SubscribeRequest

public static final EventType SubscribeRequest
Event fired when subscription request is received.

Constructor Detail

PresenceModule

public PresenceModule(Observable parentObservable,
                      SessionObject sessionObject,
                      PacketWriter packetWriter)
Method Detail

contactOffline

protected void contactOffline(JID jid)
                       throws JaxmppException
Throws:
JaxmppException

fireBeforePresenceSend

protected boolean fireBeforePresenceSend(Presence presence)
                                  throws JaxmppException
Parameters:
presence -
Returns:
true if event is cancelled
Throws:
JaxmppException

getCriteria

public Criteria getCriteria()
Description copied from interface: XmppModule
Criteria

Returns:

getFeatures

public String[] getFeatures()
Description copied from interface: XmppModule

Returns features what are implemented by Module.

See Service Discovery Features

Returns:
array of features

getPresence

public PresenceStore getPresence()

process

public void process(Presence presence)
             throws JaxmppException
Specified by:
process in class AbstractStanzaModule<Presence>
Throws:
JaxmppException

sendInitialPresence

public void sendInitialPresence()
                         throws XMLException,
                                JaxmppException
Throws:
XMLException
JaxmppException

setPresence

public void setPresence(Presence.Show show,
                        String status,
                        Integer priority)
                 throws XMLException,
                        JaxmppException
Sends own presence.

Parameters:
show - presence substate.
status - human readable description of status.
priority - priority.
Throws:
XMLException
JaxmppException

subscribe

public void subscribe(JID jid)
               throws JaxmppException,
                      XMLException
Subscribe for presence.

Parameters:
jid - JID
Throws:
JaxmppException
XMLException

subscribed

public void subscribed(JID jid)
                throws JaxmppException,
                       XMLException
Throws:
JaxmppException
XMLException

unsubscribe

public void unsubscribe(JID jid)
                 throws JaxmppException,
                        XMLException
Throws:
JaxmppException
XMLException

unsubscribed

public void unsubscribed(JID jid)
                  throws JaxmppException,
                         XMLException
Throws:
JaxmppException
XMLException


Copyright © 2006-2013 Tigase. All Rights Reserved.