public final class SubscribeOptions
extends java.lang.Object
Represents a standardized DataForm
with form type http://jabber.org/protocol/pubsub#subscribe_options
, which can be used to configure a node subscription.
DataForm
to retrieve standard data from it, use:
SubscribeOptions subscribeOptions = new SubscribeOptions(dataForm);
To build a form:
SubscribeOptions subscribeOptions = SubscribeOptions.builder()
.deliver(true)
.digest(true)
.digestFrequency(3)
.includeBody(true)
.temporary(true)
.showValues(Arrays.asList(AbstractPresence.Show.AWAY, AbstractPresence.Show.CHAT, null))
.subscriptionType(SubscribeOptions.SubscriptionType.NODES)
.subscriptionDepth(-1)
.build();
Modifier and Type | Class and Description |
---|---|
static class |
SubscribeOptions.Builder
A builder for the subscribe options.
|
static class |
SubscribeOptions.SubscriptionType
The subscription type.
|
Constructor and Description |
---|
SubscribeOptions(DataForm dataForm) |
Modifier and Type | Method and Description |
---|---|
static SubscribeOptions.Builder |
builder()
Creates a builder to build subscribe options.
|
DataForm |
getDataForm()
Gets the underlying data form.
|
java.lang.Integer |
getDigestFrequency()
The minimum number of milliseconds between sending any two notification digests
|
java.time.Instant |
getExpire()
The DateTime at which a leased subscription will end or has ended.
|
java.util.List<Presence.Show> |
getShowValues()
Gets the show values.
|
java.lang.Integer |
getSubscriptionDepth()
Gets the subscription depth.
|
SubscribeOptions.SubscriptionType |
getSubscriptionType()
Gets the subscription type.
|
java.lang.Boolean |
isDeliver()
Whether an entity wants to receive or disable notifications.
|
java.lang.Boolean |
isDigest()
Whether an entity wants to receive digests (aggregations) of notifications or all notifications individually.
|
java.lang.Boolean |
isIncludeBody()
Whether an entity wants to receive an XMPP message body in addition to the payload format.
|
boolean |
isTemporary()
Whether the subscription is temporary, i.e. presence-based.
|
public SubscribeOptions(DataForm dataForm)
public static SubscribeOptions.Builder builder()
Creates a builder to build subscribe options.
public final DataForm getDataForm()
Gets the underlying data form.
public final java.lang.Boolean isDeliver()
Whether an entity wants to receive or disable notifications.
public java.lang.Boolean isDigest()
Whether an entity wants to receive digests (aggregations) of notifications or all notifications individually.
public final java.lang.Integer getDigestFrequency()
The minimum number of milliseconds between sending any two notification digests
public final java.time.Instant getExpire()
The DateTime at which a leased subscription will end or has ended.
public final java.lang.Boolean isIncludeBody()
Whether an entity wants to receive an XMPP message body in addition to the payload format.
public final java.util.List<Presence.Show> getShowValues()
Gets the show values.
public final SubscribeOptions.SubscriptionType getSubscriptionType()
Gets the subscription type.
public final java.lang.Integer getSubscriptionDepth()
Gets the subscription depth. A negative value of -1 represents “all”.
public final boolean isTemporary()
Whether the subscription is temporary, i.e. presence-based.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.