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 org.jxmpp.jid.Jid |
jid |
protected Subscription.State |
state |
Constructor and Description |
---|
Subscription(org.jxmpp.jid.Jid subscriptionJid)
Used to constructs a subscription request to the root node with the specified
JID.
|
Subscription(org.jxmpp.jid.Jid subscriptionJid,
String nodeId)
Used to constructs a subscription request to the specified node with the specified
JID.
|
Subscription(org.jxmpp.jid.Jid jid,
String nodeId,
String subscriptionId,
Subscription.State state)
Constructs a representation of a subscription reply to the specified node
and JID.
|
Subscription(org.jxmpp.jid.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(org.jxmpp.jid.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.
|
org.jxmpp.jid.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 org.jxmpp.jid.Jid jid
protected Subscription.State state
protected boolean configRequired
public Subscription(org.jxmpp.jid.Jid subscriptionJid)
subscriptionJid
- The subscriber JIDpublic Subscription(org.jxmpp.jid.Jid subscriptionJid, String nodeId)
subscriptionJid
- The subscriber JIDnodeId
- The node idpublic Subscription(org.jxmpp.jid.Jid subscriptionJid, Subscription.State state)
subscriptionJid
- The subscriber JIDstate
- The requested new statepublic Subscription(org.jxmpp.jid.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(org.jxmpp.jid.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 org.jxmpp.jid.Jid getJid()
public 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
.