net.rim.pushsdk.push
Class PushParameters

java.lang.Object
  extended by net.rim.pushsdk.push.PushParameters
All Implemented Interfaces:
Serializable

public class PushParameters
extends Object
implements Serializable

Parameters that define the characteristics of a push message to send.

Author:
mdicesare
See Also:
Serialized Form

Field Summary
protected  List<String> addresses
           
protected  String applicationId
           
protected  Content content
           
protected  Date deliverBeforeTimestamp
           
protected  Boolean isApplicationReliable
           
protected  String pushId
           
 
Constructor Summary
PushParameters()
          Default PushParameters constructor.
PushParameters(String applicationId, List<String> addresses, Content content)
          Create a PushParameters
PushParameters(String applicationId, String address, Content content)
          Create a PushParameters object with the specified attributes.
 
Method Summary
 String getAddress()
          Gets the one address being pushed to (if only one was specified).
 List<String> getAddresses()
          Gets the list of addresses to be pushed to.
 String getApplicationId()
          Gets the id of the application to push to.
 Boolean getApplicationReliable()
          Whether or not a push message should have application-level reliability.
 Content getContent()
          Gets the content to be pushed.
 Date getDeliverBeforeTimestamp()
          Gets the expiry time of the push message.
 String getPushId()
          Gets the id of the push message.
 void setAddress(String address)
          Sets the one address being pushed to.
 void setAddresses(List<String> addresses)
          Sets the list of subscriber addresses to push to.
 void setApplicationId(String applicationId)
          Sets the id of the application to push to.
 void setApplicationReliable(Boolean isApplicationReliable)
          Sets whether or not a push should have application-level reliability.
 void setContent(Content content)
          Sets the content to push.
 void setDeliverBeforeTimestamp(Date deliverBeforeTimestamp)
          Optionally set the expiry time of the message.
 void setPushId(String pushId)
          Optionally set the id of the push message.
 String toString()
          Constructs a String with all attributes in name = value format.
 void validate(boolean isBESPush)
          Deprecated. As of release 1.1, replaced by validate(PushApplicationType)
 void validate(PushApplicationType applicationType)
          Validates that the mandatory parameters are set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

applicationId

protected String applicationId

pushId

protected String pushId

deliverBeforeTimestamp

protected Date deliverBeforeTimestamp

isApplicationReliable

protected Boolean isApplicationReliable

addresses

protected List<String> addresses

content

protected Content content
Constructor Detail

PushParameters

public PushParameters()
Default PushParameters constructor.


PushParameters

public PushParameters(String applicationId,
                      List<String> addresses,
                      Content content)
Create a PushParameters
Parameters:
applicationId - the unique id of the push application to push the data to
addresses - list of addresses to push the message to, push_all for all subscribers
content - the content of the push message

PushParameters

public PushParameters(String applicationId,
                      String address,
                      Content content)
Create a PushParameters object with the specified attributes.

Parameters:
applicationId - the unique id of the push application to push the data to
address - address to push the message to, push_all for all subscribers
content - the content of the push message
Method Detail

getApplicationId

public String getApplicationId()
Gets the id of the application to push to.

Returns:
the push application id

setApplicationId

public void setApplicationId(String applicationId)
Sets the id of the application to push to.

Parameters:
applicationId - the id of the application

getPushId

public String getPushId()
Gets the id of the push message.

Returns:
the push id; null, if the id of the push message should be generated automatically

setPushId

public void setPushId(String pushId)
Optionally set the id of the push message.

Parameters:
pushId - the push id to use; if null, an IdGenerator will be used to automatically generate a push id by the PushService
See Also:
IdGenerator

getDeliverBeforeTimestamp

public Date getDeliverBeforeTimestamp()
Gets the expiry time of the push message.

Returns:
the push message's expiry time; null, if the default time-to-live should be used from the push application the message is associated with

setDeliverBeforeTimestamp

public void setDeliverBeforeTimestamp(Date deliverBeforeTimestamp)
Optionally set the expiry time of the message.

Parameters:
deliverBeforeTimestamp - the expiry date of the push; if null, the default message time-to-live for push application being pushed to will be used (see the getDefaultPushLiveTime() method).
See Also:
PushApplication

getApplicationReliable

public Boolean getApplicationReliable()
Whether or not a push message should have application-level reliability.

Returns:
true if the push message should be application-level reliable, false if it should not have application-level reliability, and null if the default value from the push application (specified by the application id) should be used

setApplicationReliable

public void setApplicationReliable(Boolean isApplicationReliable)
Sets whether or not a push should have application-level reliability. Note: Null can be passed in. This will cause the default reliability of the push application being pushed to be used.

Parameters:
isApplicationReliable - if a push is application reliable; if null, the default application-level reliability for the push application being pushed to will be used (see the isApplicationReliable() method of PushApplication).
See Also:
PushApplication

getAddresses

public List<String> getAddresses()
Gets the list of addresses to be pushed to.

Returns:
the list of addresses to be pushed to

getAddress

public String getAddress()
Gets the one address being pushed to (if only one was specified).

Returns:
the one address being pushed to

setAddresses

public void setAddresses(List<String> addresses)
Sets the list of subscriber addresses to push to. These addresses should match valid subscriber ids (unless subscription was bypassed, in which case these should be client addresses).

Parameters:
addresses - the subscriber addresses

setAddress

public void setAddress(String address)
Sets the one address being pushed to.

Parameters:
address - the one address to push to

getContent

public Content getContent()
Gets the content to be pushed.

Returns:
the content being pushed

setContent

public void setContent(Content content)
Sets the content to push.

Parameters:
content - the content

validate

@Deprecated
public void validate(boolean isBESPush)
Deprecated. As of release 1.1, replaced by validate(PushApplicationType)

Validates that the mandatory parameters are set. The application id should not be null, at least one address should be specified, and the content cannot be empty for a public (BIS) push.

Parameters:
isBESPush - if this push is being send to a enterprise/BES PPG
Throws:
IllegalArgumentException - if any of the mandatory parameters are null or invalid

validate

public void validate(PushApplicationType applicationType)
Validates that the mandatory parameters are set. The application id should not be null, at least one address should be specified, and the content cannot be empty if sending to the public (BIS) PPG.

Parameters:
applicationType - the type of application this push message is being sent to (i.e. public/BIS, enterprise/BES or both)
Throws:
IllegalArgumentException - if any of the mandatory parameters are null or invalid
Since:
1.1

toString

public String toString()
Constructs a String with all attributes in name = value format.

Overrides:
toString in class Object
Returns:
a String representation of this object.


Copyright © 2011 Research In Motion. All Rights Reserved.