@Bean(name="presence-subscription", parent=SessionManager.class, active=true) public class PresenceSubscription extends PresenceAbstract
Modifier and Type | Class and Description |
---|---|
static class |
PresenceSubscription.PresenceSubscriptionVHostItemExtension |
static class |
PresenceSubscription.PresenceSubscriptionVHostItemExtensionProvider |
Modifier and Type | Field and Description |
---|---|
static String |
AUTO_AUTHORIZE_PROP_KEY
key allowing enabling automatic authorisation.
|
protected static String |
ID |
protected VHostManagerIfc |
vHostManager |
PRESENCE_ELEMENT_NAME, PRESENCE_PROBE_FULL_JID_KEY, probeFullJID, roster_util, SKIP_OFFLINE_PROP_KEY, SKIP_OFFLINE_SYS_PROP_KEY, skipOffline, USERS_STATUS_CHANGES, XMLNS
ALL_NAMES, ALL_PATHS, cmpInfo
CLIENT_XMLNS
Constructor and Description |
---|
PresenceSubscription() |
Modifier and Type | Method and Description |
---|---|
void |
process(Packet packet,
XMPPResourceConnection session,
NonAuthUserRepository repo,
Queue<Packet> results,
Map<String,Object> settings)
Performs processing of presence packets and calls different methods for particular RosterAbstract.PresenceType |
protected void |
processInSubscribe(Packet packet,
XMPPResourceConnection session,
Queue<Packet> results,
Map<String,Object> settings,
RosterAbstract.PresenceType pres_type)
Method is responsible for processing incoming subscription request (i.e. in the receivers session manager).
|
protected void |
processInSubscribed(Packet packet,
XMPPResourceConnection session,
Queue<Packet> results,
Map<String,Object> settings,
RosterAbstract.PresenceType pres_type)
Method is responsible for processing incoming subscribed presence (i.e. in the receivers session manager).
|
protected void |
processInUnsubscribe(Packet packet,
XMPPResourceConnection session,
Queue<Packet> results,
Map<String,Object> settings,
RosterAbstract.PresenceType pres_type)
Method is responsible for processing incoming unsubscribe presence (i.e. in the receivers session manager).
|
protected void |
processInUnsubscribed(Packet packet,
XMPPResourceConnection session,
Queue<Packet> results,
Map<String,Object> settings,
RosterAbstract.PresenceType pres_type)
Method is responsible for processing incoming unsubscribed presence (i.e. in the receivers session manager).
|
protected void |
processOutSubscribe(Packet packet,
XMPPResourceConnection session,
Queue<Packet> results,
Map<String,Object> settings,
RosterAbstract.PresenceType pres_type)
Method is responsible for processing outgoing subscribe and unsubscribe presence (i.e. in the sender session
manager).
|
protected void |
processOutSubscribed(Packet packet,
XMPPResourceConnection session,
Queue<Packet> results,
Map<String,Object> settings,
RosterAbstract.PresenceType pres_type)
Method is responsible for processing outgoing subscribed and unsubscribed presence (i.e. in the sender session
manager).
|
Set<StanzaType> |
supTypes()
Method returns an array of all stanza types which the plugin is able to handle.
|
broadcastProbe, concurrentQueuesNo, forwardPresence, getProbeFullJID, getRosterUtil, isSkipOffline, isSkipOfflineSys, prepareProbe, requiresPresenceSending, sendPresence, sendPresence, setProbeFullJID, setSkipOffline, setSkipOfflineSys, updatePresenceChange, updateUserResources
id, supDiscoFeatures, supElementNamePaths, supNamespaces, supStreamFeatures
canHandle, compareTo, getComponentInfo, getInstance, getQueueSize, getStatistics, getThreadsNo, init, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canHandle, getComponentInfo, getStatistics, id, init, supDiscoFeatures, supElementNamePaths, supNamespaces, supStreamFeatures
compareTo
public static final String AUTO_AUTHORIZE_PROP_KEY
protected static final String ID
@Inject(nullAllowed=true) protected VHostManagerIfc vHostManager
public Set<StanzaType> supTypes()
XMPPImplIfc
supTypes
in interface XMPPImplIfc
supTypes
in class AnnotatedXMPPProcessor
StanzaType[]
array of supported stanza types.public void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String,Object> settings) throws XMPPException
RosterAbstract.PresenceType
packet
- packet is which being processed. This parameter may never be null. Even though this is not
immutable object it mustn't be altered. None of it's fields or attributes can be changed during processing.session
- user session which keeps all the user session data and also gives an access to the user's
repository data. It allows for storing information in a permanent storage or in memory only during the live of
the online session. This parameter can be null if there is no online user session at the time of the packet
processing.repo
- this is a user data storage which is normally used when the user session (parameter above) is null.
This is repository allows for a very restricted access only. It allows for storing some user private data
(doesn't allow overwriting existing data) like messages for offline users and it also allows for reading user
public data like VCard.results
- this a collection with packets which have been generated as input packet processing results.
Regardless a response to a user request is sent or the packet is forwarded to it's destination it is always
required that a copy of the input packet is created and stored in the results queue.settings
- this map keeps plugin specific settings loaded from the Tigase server configuration. In most
cases it is unused, however if the plugin needs to access an external database that this is a way to pass
database connection string to the plugin.XMPPException
protected void processInSubscribe(Packet packet, XMPPResourceConnection session, Queue<Packet> results, Map<String,Object> settings, RosterAbstract.PresenceType pres_type) throws NotAuthorizedException, TigaseDBException, NoConnectionIdException, PolicyViolationException
PresenceType.in_subscribe
and subsequently broadcast presence update to all connected resources.packet
- packet is which being processed.session
- user session which keeps all the user session data and also gives an access to the user's
repository data.results
- this a collection with packets which have been generated as input packet processing results.settings
- this map keeps plugin specific settings loaded from the Tigase server configuration.pres_type
- specifies type of the presence.NotAuthorizedException
TigaseDBException
NoConnectionIdException
PolicyViolationException
protected void processInSubscribed(Packet packet, XMPPResourceConnection session, Queue<Packet> results, Map<String,Object> settings, RosterAbstract.PresenceType pres_type) throws NotAuthorizedException, TigaseDBException, NoConnectionIdException, PolicyViolationException
PresenceType.in_subscribed
and subsequently, if subscription has changed,forwards the presence to user
resource connection as well as broadcast presence update to all connected resources.packet
- packet is which being processed.session
- user session which keeps all the user session data and also gives an access to the user's
repository data.results
- this a collection with packets which have been generated as input packet processing results.settings
- this map keeps plugin specific settings loaded from the Tigase server configuration.pres_type
- specifies type of the presence.NotAuthorizedException
TigaseDBException
NoConnectionIdException
PolicyViolationException
protected void processInUnsubscribe(Packet packet, XMPPResourceConnection session, Queue<Packet> results, Map<String,Object> settings, RosterAbstract.PresenceType pres_type) throws NotAuthorizedException, TigaseDBException, NoConnectionIdException, PolicyViolationException
packet
- packet is which being processed.session
- user session which keeps all the user session data and also gives an access to the user's
repository data.results
- this a collection with packets which have been generated as input packet processing results.settings
- this map keeps plugin specific settings loaded from the Tigase server configuration.pres_type
- specifies type of the presence.NotAuthorizedException
TigaseDBException
NoConnectionIdException
PolicyViolationException
protected void processInUnsubscribed(Packet packet, XMPPResourceConnection session, Queue<Packet> results, Map<String,Object> settings, RosterAbstract.PresenceType pres_type) throws NotAuthorizedException, TigaseDBException, NoConnectionIdException, PolicyViolationException
PresenceType.in_unsubscribed
and in case that there was a change in user subscription
send out a roster push to all connected resources to update them with current state of the roster and items
subscriptions.packet
- packet is which being processed.session
- user session which keeps all the user session data and also gives an access to the user's
repository data.results
- this a collection with packets which have been generated as input packet processing results.settings
- this map keeps plugin specific settings loaded from the Tigase server configuration.pres_type
- specifies type of the presence.NotAuthorizedException
TigaseDBException
NoConnectionIdException
PolicyViolationException
protected void processOutSubscribe(Packet packet, XMPPResourceConnection session, Queue<Packet> results, Map<String,Object> settings, RosterAbstract.PresenceType pres_type) throws NotAuthorizedException, TigaseDBException, NoConnectionIdException, PolicyViolationException
In case of PresenceType.out_subscribe
packet type contact is added to the roster (in case it was missing), a subscription
state is being updated and, in case there was a change, a roster push is being sent to all user resources.
In case of PresenceType.out_unsubscribe
method updates contact subscription (and generates roster push if
there was a change) and if the resulting contact subscription is NONE then contact is removed from the roster.
packet
- packet is which being processed.session
- user session which keeps all the user session data and also gives an access to the user's
repository data.results
- this a collection with packets which have been generated as input packet processing results.settings
- this map keeps plugin specific settings loaded from the Tigase server configuration.pres_type
- specifies type of the presence.NotAuthorizedException
TigaseDBException
NoConnectionIdException
PolicyViolationException
protected void processOutSubscribed(Packet packet, XMPPResourceConnection session, Queue<Packet> results, Map<String,Object> settings, RosterAbstract.PresenceType pres_type) throws NotAuthorizedException, TigaseDBException, NoConnectionIdException, PolicyViolationException
packet
- packet is which being processed.session
- user session which keeps all the user session data and also gives an access to the user's
repository data.results
- this a collection with packets which have been generated as input packet processing results.settings
- this map keeps plugin specific settings loaded from the Tigase server configuration.pres_type
- specifies type of the presence.NotAuthorizedException
TigaseDBException
NoConnectionIdException
PolicyViolationException
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.