public class PubSubEngine extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PubSubEngine.CreateNodeResponse
Response Object returned by createNodeHelper method
|
| Modifier and Type | Field and Description |
|---|---|
static SystemProperty<Boolean> |
PUBSUB_NONREGUSER |
| Constructor and Description |
|---|
PubSubEngine(PacketRouter router) |
| Modifier and Type | Method and Description |
|---|---|
static PubSubEngine.CreateNodeResponse |
createNodeHelper(PubSubService service,
org.xmpp.packet.JID requester,
org.dom4j.Element configuration,
String nodeID,
org.xmpp.forms.DataForm publishOptions)
Checks if the following conditions are satisfied and creates a node
- Requester can create nodes
- Instant node creation is enabled
- Node does not already exist
- New node configuration is valid
NOTE 1: This method should not reply to the client NOTE 2: This method calls UserManager::isRegisteredUser(JID) which can block waiting for a response - so do not call this method in the same thread in which a response might arrive |
static org.xmpp.forms.DataForm |
getPublishOptions(org.xmpp.packet.IQ iq)
Get the dataform that describes the publish options from the request, or null if no such form was included.
|
static Collection<String> |
getShowPresences(PubSubService service,
org.xmpp.packet.JID subscriber)
Returns the show values of the last know presence of all connected resources of the
specified subscriber.
|
static void |
presenceSubscriptionNotRequired(PubSubService service,
Node node,
org.xmpp.packet.JID user)
Requests the pubsub service to subscribe to the presence of the user.
|
static void |
presenceSubscriptionRequired(PubSubService service,
Node node,
org.xmpp.packet.JID user)
Requests the pubsub service to unsubscribe from the presence of the user.
|
Future |
process(PubSubService service,
org.xmpp.packet.IQ iq)
Handles IQ packets sent to the pubsub service.
|
void |
process(PubSubService service,
org.xmpp.packet.Message message)
Handles Message packets sent to the pubsub service.
|
void |
process(PubSubService service,
org.xmpp.packet.Presence presence)
Handles Presence packets sent to the pubsub service.
|
void |
shutdown(PubSubService service) |
void |
start(PubSubService service) |
public static final SystemProperty<Boolean> PUBSUB_NONREGUSER
public PubSubEngine(PacketRouter router)
public Future process(PubSubService service, org.xmpp.packet.IQ iq)
service - the PubSub service this action is to be performed for.iq - the IQ packet sent to the pubsub service.null if the IQ packet was not handled by the engine, otherwise a Future that
indicates when processing is complete. Processing will be carried out asynchronously if there is the possibility
of sending a disco#info to a remote server, which could block for up to 60 seconds. If processing is carried out
synchronously, the returned future completes immediately. Note that the returned future will only return
null when it completes.public void process(PubSubService service, org.xmpp.packet.Presence presence)
service - the PubSub service this action is to be performed for.presence - the Presence packet sent to the pubsub service.public void process(PubSubService service, org.xmpp.packet.Message message)
Answers to authorization requests sent to node owners to approve pending subscriptions will also be processed by this method.
service - the PubSub service this action is to be performed for.message - the Message packet sent to the pubsub service.public static org.xmpp.forms.DataForm getPublishOptions(org.xmpp.packet.IQ iq)
iq - The publish request (cannot be null).public static PubSubEngine.CreateNodeResponse createNodeHelper(PubSubService service, org.xmpp.packet.JID requester, org.dom4j.Element configuration, String nodeID, org.xmpp.forms.DataForm publishOptions)
service - The service instance that's responsible for processing (cannot be null)requester - The (full) JID of the entity that performs the action (cannot be null)configuration - Optional Configuration dataform, if user requested to configure the node (can be null)nodeID - The ID of the node to be created, or null when an instant node is to be created.publishOptions - Optional Publishing Options, which are either preconditions or configuration overrides (can be null)PubSubEngine.CreateNodeResponsepublic void start(PubSubService service)
public void shutdown(PubSubService service)
public static Collection<String> getShowPresences(PubSubService service, org.xmpp.packet.JID subscriber)
online value. The rest of the possible show values as defined in RFC 3921.service - the PubSub service this action is to be performed for.subscriber - the JID of the subscriber. This is not the JID of the affiliate.public static void presenceSubscriptionNotRequired(PubSubService service, Node node, org.xmpp.packet.JID user)
service - the PubSub service this action is to be performed for.node - the node that originated the subscription request.user - the JID of the affiliate to subscribe to his presence.public static void presenceSubscriptionRequired(PubSubService service, Node node, org.xmpp.packet.JID user)
service - the PubSub service this action is to be performed for.node - the node that originated the unsubscription request.user - the JID of the affiliate to unsubscribe from his presence.Copyright © 2003–2020 Ignite Realtime. All rights reserved.