net.rim.pushsdk.push
Class StatusResult

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

public class StatusResult
extends Object

Represents the result of a status query including the response from the PPG and 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 at the time of the status query).

Note: The three invalid subscriber sets are populated only if addresses were provided in the request and the push service is not storing push requests.

Author:
mdicesare

Constructor Summary
StatusResult(String pushId, String pushAppId)
          Constructs a status result with the given push id.
 
Method Summary
protected  void addOutcome(String address, StatusCode code, String description, Date eventTime, MessageState messageState, Boolean applicationReliable)
          Adds an outcome to the status result.
 Set<String> getDoNotExistSubscriberIds()
          Returns the collection of subscriber ids that could not be found in storage.
 Set<String> getInactiveSubscriberIds()
          Returns the collection of subscriber ids that match inactive subscribers.
 List<PushOutcome> getOutcomes()
          Returns the address-specific push outcomes.
 String getPushAppId()
          Gets the id of the push application.
 String getPushId()
          Gets the id of the push.
 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 setInactiveSubscriberIds(Set<String> inactiveSubscriberIds)
          Sets the collection of subscriber ids that match inactive subscribers.
 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

StatusResult

public StatusResult(String pushId,
                    String pushAppId)
Constructs a status result with the given push id.

Parameters:
pushId - the id of a push
Method Detail

getPushId

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

Returns:
the push id

getPushAppId

public String getPushAppId()
Gets the id of the push application.

Returns:
the push app id

getOutcomes

public List<PushOutcome> getOutcomes()
Returns the address-specific push outcomes. If the address is null, then the outcome pertains to all addresses for the request.

Returns:
a list of outcomes

addOutcome

protected void addOutcome(String address,
                          StatusCode code,
                          String description,
                          Date eventTime,
                          MessageState messageState,
                          Boolean applicationReliable)
Adds an outcome to the status result.

Parameters:
address - the address associated with the outcome. If the outcome pertains to all addresses, this address would be null. For a public (BIS) push, the address corresponds to a subscriber ID. For an enterprise (BES) push, this would be the underlying address, if subscription is being bypassed.
code - the status code associated with the outcome
description - the textual description of the outcome
eventTime - the date at which the outcome was decided
messageState - the current state of the outcome
applicationReliable - whether or not the delivery method of the request was application-level reliable (null is possible for enterprise (BES), since sometimes the delivery method is not always indicated in the outcome)

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

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.