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, write
public 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()
InitializingModule
afterRegister
in interface InitializingModule
afterRegister
in class AbstractStanzaModule<Presence>
public void beforeRegister()
InitializingModule
beforeRegister
in interface InitializingModule
beforeRegister
in class AbstractStanzaModule<Presence>
public void beforeUnregister()
InitializingModule
beforeUnregister
in interface InitializingModule
beforeUnregister
in class AbstractStanzaModule<Presence>
protected void contactOffline(Presence i, JID jid) throws JaxmppException
JaxmppException
public Criteria getCriteria()
XmppModule
getCriteria
in interface XmppModule
public String[] getFeatures()
XmppModule
Returns features what are implemented by Module.
getFeatures
in interface XmppModule
public PresenceStore getPresenceStore()
public void onXmppSessionEstablished(SessionObject sessionObject) throws JaxmppException
onXmppSessionEstablished
in interface XmppSessionLogic.XmppSessionEstablishedHandler
JaxmppException
public void process(Presence presence) throws JaxmppException
AbstractStanzaModule
process
in class AbstractStanzaModule<Presence>
presence
- incoming stanzaJaxmppException
public 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
JaxmppException
public void sentDirectPresence(JID jid, Presence.Show show, String status, Integer priority) throws JaxmppException
show
- presence substate.status
- human readable description of status.priority
- priority.JaxmppException
public void setContext(Context context)
setContext
in interface ContextAware
setContext
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.JaxmppException
public void subscribe(JID jid) throws JaxmppException
jid
- JIDJaxmppException
public void subscribed(JID jid) throws JaxmppException
JaxmppException
public void unsubscribe(JID jid) throws JaxmppException
JaxmppException
public void unsubscribed(JID jid) throws JaxmppException
JaxmppException
Copyright © 2006–2023 Tigase. All rights reserved.