public class Subscription extends NodeExtension
Modifier and Type | Class and Description |
---|---|
static class |
Subscription.State |
Modifier and Type | Field and Description |
---|---|
protected boolean |
configRequired |
protected String |
id |
protected Jid |
jid |
protected Subscription.State |
state |
Constructor and Description |
---|
Subscription(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.
|
Modifier and Type | Method and Description |
---|---|
String |
getId()
Gets the subscription id.
|
Jid |
getJid()
Gets the JID the subscription is created for.
|
Subscription.State |
getState()
Gets the current subscription state.
|
boolean |
isConfigRequired()
This value is only relevant when the
getState() is Subscription.State.unconfigured . |
XmlStringBuilder |
toXML(String enclosingNamespace)
Returns the XML representation of this Element.
|
getElementName, getNamespace, getNode, getPubSubNamespace, toString
protected Subscription.State state
protected boolean configRequired
public Subscription(Jid subscriptionJid)
subscriptionJid
- The subscriber JIDpublic Subscription(Jid subscriptionJid, String nodeId)
subscriptionJid
- The subscriber JIDnodeId
- The node idpublic Subscription(Jid subscriptionJid, Subscription.State state)
subscriptionJid
- The subscriber JIDstate
- The requested new statepublic Subscription(Jid jid, String nodeId, String subscriptionId, Subscription.State state)
jid
- The JID the request was made undernodeId
- The node subscribed tosubscriptionId
- The id of this subscriptionstate
- The current state of the subscriptionpublic Subscription(Jid jid, String nodeId, String subscriptionId, Subscription.State state, boolean configRequired)
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 subscriptionpublic Subscription.State getState()
public boolean isConfigRequired()
getState()
is Subscription.State.unconfigured
.public XmlStringBuilder toXML(String enclosingNamespace)
Element
toXML
in interface Element
toXML
in class NodeExtension
enclosingNamespace
- the enclosing namespace or null
.