Class SubscriptionTask
java.lang.Object
org.jivesoftware.openfire.pubsub.cluster.NodeTask
org.jivesoftware.openfire.pubsub.cluster.SubscriptionTask
- All Implemented Interfaces:
Externalizable
,Serializable
,Runnable
,ClusterTask<Void>
- Direct Known Subclasses:
CancelSubscriptionTask
,ModifySubscriptionTask
,NewSubscriptionTask
A cluster task used work with a particular subscription (a relation between an entity an a pubsub node) of a pubsub node.
Note that this task aims to update in-memory state only: it will not apply affiliation changes to persistent data
storage (it is assumed that the cluster node where the task originated takes responsibility for that). As a result,
this task might not apply changes if the node that is the subject of this task is currently not loaded in-memory of
the cluster node on which this task operates.
- See Also:
-
Field Summary
Fields inherited from class org.jivesoftware.openfire.pubsub.cluster.NodeTask
nodeId, serviceId, uniqueNodeIdentifier
-
Constructor Summary
ConstructorsConstructorDescriptionThis no-argument constructor is provided for serialization purposes.SubscriptionTask
(NodeSubscription subscription) -
Method Summary
Modifier and TypeMethodDescriptionorg.xmpp.packet.JID
getOwner()
Returns the address of the entity that owns this subscription.getState()
Returns the state of the subscription.org.xmpp.packet.JID
Returns the address that is going to receive the event notifications.Returns the ID that uniquely identifies the subscription of the user in the node.Finds the pubsub node subscription that is the subject of this task.void
toString()
void
Methods inherited from class org.jivesoftware.openfire.pubsub.cluster.NodeTask
getNodeId, getNodeIfLoaded, getResult, getServiceIfLoaded, getUniqueNodeIdentifier
-
Constructor Details
-
SubscriptionTask
public SubscriptionTask()This no-argument constructor is provided for serialization purposes. It should generally not be used otherwise. -
SubscriptionTask
-
-
Method Details
-
getSubscriptionId
Returns the ID that uniquely identifies the subscription of the user in the node.- Returns:
- a unique node subscription identifier.
- See Also:
-
getOwner
public org.xmpp.packet.JID getOwner()Returns the address of the entity that owns this subscription.- Returns:
- The address of the owner of the subscription.
- See Also:
-
getSubscriberJid
public org.xmpp.packet.JID getSubscriberJid()Returns the address that is going to receive the event notifications.- Returns:
- the address that will receive notifications.
- See Also:
-
getState
Returns the state of the subscription.- Returns:
- subscription state
- See Also:
-
getSubscriptionIfLoaded
Finds the pubsub node subscription that is the subject of this task. Note that null, instead of a pubsub node subscription instance, might be returned when the pubsub service is not currently loaded in-memory on the cluster node that the task is executing on (although there is no guarantee that when this method returns a non-null node subscription, it was previously not loaded in-memory)! The rationale for this is that this cluster tasks does not need to operate on data that is not in memory, as such operations are the responsibility of the cluster node that initiates the cluster task.- Returns:
- a pubsub node subscription
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classNodeTask
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classNodeTask
- Throws:
IOException
ClassNotFoundException
-
toString
-