public class PresenceModule extends AbstractStanzaModule<Presence> implements InitializingModule, ContextAware, XmppSessionLogic.XmppSessionEstablishedHandler
| Modifier and Type | Class and Description |
|---|---|
static interface |
PresenceModule.BeforePresenceSendHandler
Event fired before each presence sent by client.
|
static interface |
PresenceModule.ContactAvailableHandler
Event fired when contact (understood as bare JID) becomes available.
|
static interface |
PresenceModule.ContactChangedPresenceHandler
Event fired when contact changed his presence.
|
static interface |
PresenceModule.ContactUnavailableHandler
Event fired when contact (understood as bare JID) goes offline.
|
static interface |
PresenceModule.ContactUnsubscribedHandler
Event fired when contact is unsubscribed.
|
static interface |
PresenceModule.SubscribeRequestHandler
Event fired when subscription request is received.
|
XmppSessionLogic.XmppSessionEstablishedHandler.XmppSessionEstablishedEvent| Modifier and Type | Field and Description |
|---|---|
static Criteria |
CRIT |
static String |
INITIAL_PRESENCE_ENABLED_KEY |
static String |
PRESENCE_STORE_KEY |
context, log| Constructor and Description |
|---|
PresenceModule() |
fireEvent, getFirstChild, process, write, write, writepublic static final Criteria CRIT
public static final String PRESENCE_STORE_KEY
public static final String INITIAL_PRESENCE_ENABLED_KEY
public static PresenceStore getPresenceStore(SessionObject sessionObject)
public static void setPresenceStore(SessionObject sessionObject, PresenceStore presenceStore)
public void addBeforePresenceSendHandler(PresenceModule.BeforePresenceSendHandler handler)
public void addContactAvailableHandler(PresenceModule.ContactAvailableHandler handler)
public void addContactChangedPresenceHandler(PresenceModule.ContactChangedPresenceHandler handler)
public void addContactUnavailableHandler(PresenceModule.ContactUnavailableHandler handler)
public void addContactUnsubscribedHandler(PresenceModule.ContactUnsubscribedHandler handler)
public void addSubscribeRequestHandler(PresenceModule.SubscribeRequestHandler handler)
public void afterRegister()
InitializingModuleafterRegister in interface InitializingModuleafterRegister in class AbstractStanzaModule<Presence>public void beforeRegister()
InitializingModulebeforeRegister in interface InitializingModulebeforeRegister in class AbstractStanzaModule<Presence>public void beforeUnregister()
InitializingModulebeforeUnregister in interface InitializingModulebeforeUnregister in class AbstractStanzaModule<Presence>protected void contactOffline(Presence i, JID jid) throws JaxmppException
JaxmppExceptionpublic Criteria getCriteria()
XmppModulegetCriteria in interface XmppModulepublic String[] getFeatures()
XmppModuleReturns features what are implemented by Module.
getFeatures in interface XmppModulepublic PresenceStore getPresenceStore()
public void onXmppSessionEstablished(SessionObject sessionObject) throws JaxmppException
onXmppSessionEstablished in interface XmppSessionLogic.XmppSessionEstablishedHandlerJaxmppExceptionpublic void process(Presence presence) throws JaxmppException
AbstractStanzaModuleprocess in class AbstractStanzaModule<Presence>JaxmppExceptionpublic void removeBeforePresenceSendHandler(PresenceModule.BeforePresenceSendHandler handler)
public void removeContactAvailableHandler(PresenceModule.ContactAvailableHandler handler)
public void removeContactChangedPresenceHandler(PresenceModule.ContactChangedPresenceHandler handler)
public void removeContactUnavailableHandler(PresenceModule.ContactUnavailableHandler handler)
public void removeContactUnsubscribedHandler(PresenceModule.ContactUnsubscribedHandler handler)
public void removeSubscribeRequestHandler(PresenceModule.SubscribeRequestHandler handler)
public void sendInitialPresence()
throws XMLException,
JaxmppException
XMLExceptionJaxmppExceptionpublic void setContext(Context context)
setContext in interface ContextAwaresetContext in class AbstractStanzaModule<Presence>public void setInitialPresence(boolean enabled)
public void setPresence(Presence.Show show, String status, Integer priority) throws XMLException, JaxmppException
show - presence substate.status - human readable description of status.priority - priority.XMLExceptionJaxmppExceptionpublic void subscribe(JID jid) throws JaxmppException, XMLException
jid - JIDJaxmppExceptionXMLExceptionpublic void subscribed(JID jid) throws JaxmppException, XMLException
JaxmppExceptionXMLExceptionpublic void unsubscribe(JID jid) throws JaxmppException, XMLException
JaxmppExceptionXMLExceptionpublic void unsubscribed(JID jid) throws JaxmppException, XMLException
JaxmppExceptionXMLExceptionCopyright © 2006–2015 Tigase. All rights reserved.