Package org.jivesoftware.openfire.pep
Class PEPServiceManager
java.lang.Object
org.jivesoftware.openfire.pep.PEPServiceManager
- All Implemented Interfaces:
EntityCapabilitiesListener
Manages the creation, persistence and removal of
PEPService
instances.- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(org.xmpp.packet.JID owner) voiddestroy()voidentityCapabilitiesChanged(org.xmpp.packet.JID entity, EntityCapabilities updatedEntityCapabilities, Set<String> featuresAdded, Set<String> featuresRemoved, Set<String> identitiesAdded, Set<String> identitiesRemoved) Invoked when a change was detected in the capabilities of a particular entity.findSubscribedNodes(org.xmpp.packet.JID entity, String nodeId) Returns all PEP nodes with a specific ID that the provided entity is a subscriber to.getPEPService(PubSubService.UniqueIdentifier uniqueIdentifier) Retrieves a PEP service -- attempting first from memory, then from the database.getPEPService(PubSubService.UniqueIdentifier uniqueIdentifier, boolean autoCreate) Retrieves a PEP service -- attempting first from memory, then from the database.getPEPService(org.xmpp.packet.JID jid) Retrieves a PEP service -- attempting first from memory, then from the database.getPEPService(org.xmpp.packet.JID jid, boolean autoCreate) Retrieves a PEP service -- attempting first from memory, then from the database.booleanhasCachedService(org.xmpp.packet.JID owner) voidFuture<?>process(PEPService service, org.xmpp.packet.IQ iq) voidremove(org.xmpp.packet.JID owner) Deletes thePEPServicebelonging to the specified owner.voidstart()voidstart(PEPService pepService) voidstop()
-
Field Details
-
Log
public static final org.slf4j.Logger Log
-
-
Constructor Details
-
PEPServiceManager
public PEPServiceManager()
-
-
Method Details
-
initialize
public void initialize() -
destroy
public void destroy() -
getPEPService
Retrieves a PEP service -- attempting first from memory, then from the database. This method will automatically create a PEP service if one does not exist.- Parameters:
uniqueIdentifier- the unique identifier of the PEP service.- Returns:
- the requested PEP service.
-
getPEPService
public PEPService getPEPService(PubSubService.UniqueIdentifier uniqueIdentifier, boolean autoCreate) Retrieves a PEP service -- attempting first from memory, then from the database. This method can automatically create a PEP service if one does not exist.- Parameters:
uniqueIdentifier- the unique identifier of the PEP service.autoCreate- true if a PEP service that does not yet exist needs to be created.- Returns:
- the requested PEP service if found or null if not found.
-
getPEPService
Retrieves a PEP service -- attempting first from memory, then from the database. This method will automatically create a PEP service if one does not exist.- Parameters:
jid- the JID of the user that owns the PEP service.- Returns:
- the requested PEP service.
-
getPEPService
Retrieves a PEP service -- attempting first from memory, then from the database. This method can automatically create a PEP service if one does not exist.- Parameters:
jid- the JID of the user that owns the PEP service.autoCreate- true if a PEP service that does not yet exist needs to be created.- Returns:
- the requested PEP service if found or null if not found.
-
create
-
remove
public void remove(org.xmpp.packet.JID owner) Deletes thePEPServicebelonging to the specified owner.- Parameters:
owner- The JID of the owner of the service to be deleted.
-
start
-
start
public void start() -
stop
public void stop() -
process
-
hasCachedService
public boolean hasCachedService(org.xmpp.packet.JID owner) -
entityCapabilitiesChanged
public void entityCapabilitiesChanged(@Nonnull org.xmpp.packet.JID entity, @Nonnull EntityCapabilities updatedEntityCapabilities, @Nonnull Set<String> featuresAdded, @Nonnull Set<String> featuresRemoved, @Nonnull Set<String> identitiesAdded, @Nonnull Set<String> identitiesRemoved) Description copied from interface:EntityCapabilitiesListenerInvoked when a change was detected in the capabilities of a particular entity. Apart from supplying the full entity capabilities object, each invocation will also include a the 'delta' of each capability characteristic: the features and identities that are new, or are removed, in the new capabilities, as compared to the previous capabilities for the entity. When no previous capabilities were registered for this entity, all characteristics will be new.- Specified by:
entityCapabilitiesChangedin interfaceEntityCapabilitiesListener- Parameters:
entity- The entity for which CAPS changed.updatedEntityCapabilities- The updated capabilities.featuresAdded- The features that are now part of the capabilities, but were not in the previous capabilities of this entity.featuresRemoved- The features that are now no longer part of the capabilities, but were in the previous capabilities of this entity.identitiesAdded- The identities that are now present in the capabilities, but were not in the previous capabilities of this entity.identitiesRemoved- The identities that are no longer part of the capabilities, but were in the previous capabilities of this entity.
-
findSubscribedNodes
@Nonnull public Set<Node> findSubscribedNodes(@Nonnull org.xmpp.packet.JID entity, @Nonnull String nodeId) Returns all PEP nodes with a specific ID that the provided entity is a subscriber to. This would typically return a similar node for many different services (eg: the 'user-tune' node of the PEP services of all of entity's contacts.- Parameters:
entity- The entity address.nodeId- The NodeID of the nodes to return- Returns:
- A collection of nodes (possibly empty).
-