net.rim.pushsdk.push
Class PushResult

java.lang.Object
  extended by net.rim.pushsdk.push.PushResult

public class PushResult
extends Object

Represents the interim result of a push submission including the set of results for subscribers that failed to be pushed to due to an error on the PPG end, the sets of subscriber ids that were not sent to the PPG because they were invalid in some way (i.e. they do not exist, are inactive, or are suspended) and the approximate remaining quota for the day (in number of pushes).

Keep in mind, if your push application has a type of "Public+Enterprise Push", the push will potentially be sent to two PPGs (i.e. both the public/BIS and enterprise/BES PPG simultaneously) and therefore the getCode() method will return an approximated status. As a rule, if one or both PPGs accept the push request, the getCode() method will return ACCEPTED (except if DUPLICATE_PUSH_ID is returned, in which case, the push is considered failed). If both PPGs reject the push request, the public/BIS PPG status code will be returned.

For a push application with a service level of Push Plus, the final outcome of the push delivery (i.e. whether the push was successfully received by the device/application) must be obtained by issuing a status query call or, if acknowledgements are being used, the result of the push will arrive asynchronously when the final outcome is known by the PPG.

For a push application with a service level of Push Essentials, it is more difficult to determine the true status of a push since no querying APIs are available after the push is sent. The final delivery outcome to individual subscribers cannot be determined.

Author:
mdicesare
See Also:
PushApplicationType, StatusCode, FailedPushResult

Constructor Summary
PushResult()
          Default constructor
PushResult(String pushId, StatusCode code, String description)
          Constructs a push result with the given push id, status code, and status description.
 
Method Summary
 StatusCode getCode()
          Gets the status code returned from the PPG for the push submission.
 String getDescription()
          Gets the textual description of the status code returned by the PPG for the push submission.
 Set<String> getDoNotExistSubscriberIds()
          Returns the collection of subscriber ids that could not be found in storage.
 Set<FailedPushResult> getFailedPushResults()
          Returns the collection of results for subscribers that were attempted to push to, but failed for whatever reason, e.g.
 Set<String> getInactiveSubscriberIds()
          Returns the collection of subscriber ids that match inactive subscribers.
 String getPushId()
          Gets the id of the push.
 long getRemainingQuota()
          Returns the remaining quota (in number of pushes) for the specified push application.
 Set<String> getSuspendedSubscriberIds()
          Returns the collection of subscriber ids that match suspended subscribers.
 void setDoNotExistSubscriberIds(Set<String> doNotExistSubscriberIds)
          Sets the collection of subscriber ids that could not be found in storage.
 void setFailedPushResults(Set<FailedPushResult> failedPushResults)
          Sets the collection of results for subscribers that were attempted to push to, but failed for whatever reason, e.g.
 void setInactiveSubscriberIds(Set<String> inactiveSubscriberIds)
          Sets the collection of subscriber ids that match inactive subscribers.
 void setPushId(String pushId)
          Sets the id of the push.
 void setRemainingQuota(long remainingQuota)
          Sets the remaining quota (in number of pushes) for the specified push application.
 void setSuspendedSubscriberIds(Set<String> suspendedSubscriberIds)
          Sets the collection of subscriber ids that match suspended subscribers.
 String toString()
          Constructs a String with all attributes in name = value format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PushResult

public PushResult()
Default constructor


PushResult

public PushResult(String pushId,
                  StatusCode code,
                  String description)
Constructs a push result with the given push id, status code, and status description.

Parameters:
pushId - the id of a push
code - the status of the push attempt
description - a textual description of the status
Method Detail

setPushId

public void setPushId(String pushId)
Sets the id of the push.

Parameters:
pushId - the push id

getPushId

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

Returns:
the push id

getCode

public StatusCode getCode()
Gets the status code returned from the PPG for the push submission.

IMPORTANT NOTE: This status code may be an approximation of the real status code if there were multiple PPGs being pushed to (i.e. the push application involved is of type "Public+Enterprise Push"). The true status of the push should be obtained from examining the status of each subscriber pushed to.

Returns:
the response code

getDescription

public String getDescription()
Gets the textual description of the status code returned by the PPG for the push submission.

IMPORTANT NOTE: This status code description may be an approximation of the real status code description if there were multiple PPGs being pushed to (i.e. the push application involved is of type "Public+Enterprise Push"). The true status of the push should be obtained from examining the status code description of each subscriber pushed to.

Returns:
the textual result of the push operation

setDoNotExistSubscriberIds

public void setDoNotExistSubscriberIds(Set<String> doNotExistSubscriberIds)
Sets the collection of subscriber ids that could not be found in storage.

Parameters:
doNotExistSubscriberIds - a collection of ids for non-existent subscribers

getDoNotExistSubscriberIds

public Set<String> getDoNotExistSubscriberIds()
Returns the collection of subscriber ids that could not be found in storage.

Returns:
the collection of ids for non-existent subscribers

setInactiveSubscriberIds

public void setInactiveSubscriberIds(Set<String> inactiveSubscriberIds)
Sets the collection of subscriber ids that match inactive subscribers.

Parameters:
inactiveSubscriberIds - a collection of ids for inactive subscribers

getInactiveSubscriberIds

public Set<String> getInactiveSubscriberIds()
Returns the collection of subscriber ids that match inactive subscribers.

Returns:
the collection of ids for inactive subscribers

setSuspendedSubscriberIds

public void setSuspendedSubscriberIds(Set<String> suspendedSubscriberIds)
Sets the collection of subscriber ids that match suspended subscribers.

Parameters:
suspendedSubscriberIds - a collection of ids for suspended subscribers

getSuspendedSubscriberIds

public Set<String> getSuspendedSubscriberIds()
Returns the collection of subscriber ids that match suspended subscribers.

Returns:
the collection of ids for suspended subscribers

getFailedPushResults

public Set<FailedPushResult> getFailedPushResults()
Returns the collection of results for subscribers that were attempted to push to, but failed for whatever reason, e.g. the PPG could not be contacted, a duplicate push ID was found, etc. See the FailedPushResult class for more details.

Returns:
the collection of failed push results for subscribers
Since:
1.1
See Also:
FailedPushResult

setFailedPushResults

public void setFailedPushResults(Set<FailedPushResult> failedPushResults)
Sets the collection of results for subscribers that were attempted to push to, but failed for whatever reason, e.g. the PPG could not be contacted, a duplicate push ID was found, etc. See the FailedPushResult class for more details.

Parameters:
failedPushResults - the collection of failed push results for subscribers
Since:
1.1
See Also:
FailedPushResult

getRemainingQuota

public long getRemainingQuota()
Returns the remaining quota (in number of pushes) for the specified push application.

Returns:
the remaining quota

setRemainingQuota

public void setRemainingQuota(long remainingQuota)
Sets the remaining quota (in number of pushes) for the specified push application.

Parameters:
remainingQuota - a remaining quota

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.