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.OwnPresenceStanzaFactory |
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 |
OWN_PRESENCE_STANZA_FACTORY_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 final String OWN_PRESENCE_STANZA_FACTORY_KEY
public static PresenceStore getPresenceStore(SessionObject sessionObject)
public static void setOwnPresenceStanzaFactory(SessionObject sessionObject, PresenceModule.OwnPresenceStanzaFactory factory)
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 JaxmppException
JaxmppExceptionpublic void sentDirectPresence(JID jid, Presence.Show show, String status, Integer priority) throws JaxmppException
show - presence substate.status - human readable description of status.priority - priority.JaxmppExceptionpublic 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 JaxmppException
show - presence substate.status - human readable description of status.priority - priority.JaxmppExceptionpublic void subscribe(JID jid) throws JaxmppException
jid - JIDJaxmppExceptionpublic void subscribed(JID jid) throws JaxmppException
JaxmppExceptionpublic void unsubscribe(JID jid) throws JaxmppException
JaxmppExceptionpublic void unsubscribed(JID jid) throws JaxmppException
JaxmppExceptionCopyright © 2006–2018 Tigase. All rights reserved.