Package org.jivesoftware.smackx.pubsub
Class Subscription
java.lang.Object
org.jivesoftware.smackx.pubsub.NodeExtension
org.jivesoftware.smackx.pubsub.Subscription
- All Implemented Interfaces:
Element
,NamedElement
,XmlElement
,XmlLangElement
Represents a subscription to node for both requests and replies.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected String
protected Jid
protected Subscription.State
-
Constructor Summary
ConstructorDescriptionSubscription
(Jid subscriptionJid) Used to constructs a subscription request to the root node with the specified JID.Subscription
(Jid subscriptionJid, String nodeId) Used to constructs a subscription request to the specified node with the specified JID.Subscription
(Jid jid, String nodeId, String subscriptionId, Subscription.State state) Constructs a representation of a subscription reply to the specified node and JID.Subscription
(Jid jid, String nodeId, String subscriptionId, Subscription.State state, boolean configRequired) Constructs a representation of a subscription reply to the specified node and JID.Subscription
(Jid subscriptionJid, Subscription.State state) Construct a subscription change request to the specified state. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addXml
(XmlStringBuilder xml) getId()
Gets the subscription id.getJid()
Gets the JID the subscription is created for.getState()
Gets the current subscription state.boolean
This value is only relevant when thegetState()
isSubscription.State.unconfigured
.Methods inherited from class org.jivesoftware.smackx.pubsub.NodeExtension
getElementName, getNamespace, getNode, getPubSubNamespace, toString, toXML
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
jid
-
id
-
state
-
configRequired
-
-
Constructor Details
-
Subscription
Used to constructs a subscription request to the root node with the specified JID.- Parameters:
subscriptionJid
- The subscriber JID
-
Subscription
Used to constructs a subscription request to the specified node with the specified JID.- Parameters:
subscriptionJid
- The subscriber JIDnodeId
- The node id
-
Subscription
Construct a subscription change request to the specified state.- Parameters:
subscriptionJid
- The subscriber JIDstate
- The requested new state
-
Subscription
Constructs a representation of a subscription reply to the specified node and JID. The server will have supplied the subscription id and current state.- Parameters:
jid
- The JID the request was made undernodeId
- The node subscribed tosubscriptionId
- The id of this subscriptionstate
- The current state of the subscription
-
Subscription
public Subscription(Jid jid, String nodeId, String subscriptionId, Subscription.State state, boolean configRequired) Constructs a representation of a subscription reply to the specified node and JID. The server will have supplied the subscription id and current state and whether the subscription need to be configured.- Parameters:
jid
- The JID the request was made undernodeId
- The node subscribed tosubscriptionId
- The id of this subscriptionstate
- The current state of the subscriptionconfigRequired
- Is configuration required to complete the subscription
-
-
Method Details
-
getJid
Gets the JID the subscription is created for.- Returns:
- The JID
-
getId
Gets the subscription id.- Returns:
- The subscription id
-
getState
Gets the current subscription state.- Returns:
- Current subscription state
-
isConfigRequired
This value is only relevant when thegetState()
isSubscription.State.unconfigured
.- Returns:
- true if configuration is required, false otherwise
-
addXml
- Overrides:
addXml
in classNodeExtension
-