Smack

org.jivesoftware.smackx.pubsub
Class SubscribeForm

java.lang.Object
  extended by org.jivesoftware.smackx.Form
      extended by org.jivesoftware.smackx.pubsub.SubscribeForm

public class SubscribeForm
extends Form

A decorator for a Form to easily enable reading and updating of subscription options. All operations read or update the underlying DataForm.

Unlike the Form.setAnswer(XXX)} methods, which throw an exception if the field does not exist, all SubscribeForm.setXXX methods will create the field in the wrapped form if it does not already exist.

Author:
Robin Collier

Field Summary
 
Fields inherited from class org.jivesoftware.smackx.Form
ELEMENT, NAMESPACE, TYPE_CANCEL, TYPE_FORM, TYPE_RESULT, TYPE_SUBMIT
 
Constructor Summary
SubscribeForm(DataForm configDataForm)
           
SubscribeForm(Form subscribeOptionsForm)
           
SubscribeForm(FormType formType)
           
 
Method Summary
 int getDigestFrequency()
          Gets the minimum number of milliseconds between sending notification digests
 Date getExpiry()
          Get the time at which the leased subscription will expire, or has expired.
 Iterator<PresenceState> getShowValues()
          Gets the PresenceState for which an entity wants to receive notifications.
 boolean isDeliverOn()
          Determines if an entity wants to receive notifications.
 boolean isDigestOn()
          Determines if notifications should be delivered as aggregations or not.
 boolean isIncludeBody()
          Determines whether the entity wants to receive an XMPP message body in addition to the payload format.
 void setDeliverOn(boolean deliverNotifications)
          Sets whether an entity wants to receive notifications.
 void setDigestFrequency(int frequency)
          Sets the minimum number of milliseconds between sending notification digests
 void setDigestOn(boolean digestOn)
          Sets whether notifications should be delivered as aggregations or not.
 void setExpiry(Date expire)
          Sets the time at which the leased subscription will expire, or has expired.
 void setIncludeBody(boolean include)
          Sets whether the entity wants to receive an XMPP message body in addition to the payload format.
 void setShowValues(Collection<PresenceState> stateValues)
          Sets the list of PresenceState for which an entity wants to receive notifications.
 
Methods inherited from class org.jivesoftware.smackx.Form
addField, createAnswerForm, getDataFormToSend, getField, getFields, getFormFrom, getInstructions, getTitle, getType, setAnswer, setAnswer, setAnswer, setAnswer, setAnswer, setAnswer, setAnswer, setDefaultAnswer, setInstructions, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubscribeForm

public SubscribeForm(DataForm configDataForm)

SubscribeForm

public SubscribeForm(Form subscribeOptionsForm)

SubscribeForm

public SubscribeForm(FormType formType)
Method Detail

isDeliverOn

public boolean isDeliverOn()
Determines if an entity wants to receive notifications.

Returns:
true if want to receive, false otherwise

setDeliverOn

public void setDeliverOn(boolean deliverNotifications)
Sets whether an entity wants to receive notifications.

Parameters:
deliverNotifications -

isDigestOn

public boolean isDigestOn()
Determines if notifications should be delivered as aggregations or not.

Returns:
true to aggregate, false otherwise

setDigestOn

public void setDigestOn(boolean digestOn)
Sets whether notifications should be delivered as aggregations or not.

Parameters:
digestOn - true to aggregate, false otherwise

getDigestFrequency

public int getDigestFrequency()
Gets the minimum number of milliseconds between sending notification digests

Returns:
The frequency in milliseconds

setDigestFrequency

public void setDigestFrequency(int frequency)
Sets the minimum number of milliseconds between sending notification digests

Parameters:
frequency - The frequency in milliseconds

getExpiry

public Date getExpiry()
Get the time at which the leased subscription will expire, or has expired.

Returns:
The expiry date

setExpiry

public void setExpiry(Date expire)
Sets the time at which the leased subscription will expire, or has expired.

Parameters:
expire - The expiry date

isIncludeBody

public boolean isIncludeBody()
Determines whether the entity wants to receive an XMPP message body in addition to the payload format.

Returns:
true to receive the message body, false otherwise

setIncludeBody

public void setIncludeBody(boolean include)
Sets whether the entity wants to receive an XMPP message body in addition to the payload format.

Parameters:
include - true to receive the message body, false otherwise

getShowValues

public Iterator<PresenceState> getShowValues()
Gets the PresenceState for which an entity wants to receive notifications.

Returns:
iterator over the list of states

setShowValues

public void setShowValues(Collection<PresenceState> stateValues)
Sets the list of PresenceState for which an entity wants to receive notifications.

Parameters:
stateValues - The list of states

Smack

Copyright © 2003-2007 Jive Software.