net.rim.pushsdk.pap
Class StatusCode

java.lang.Object
  extended by net.rim.pushsdk.pap.StatusCode
All Implemented Interfaces:
Serializable

public class StatusCode
extends Object
implements Serializable

PAP code constants represent the codes that can be returned by the PPG and their user-friendly English textual descriptions.

Author:
mdicesare
See Also:
Serialized Form

Field Summary
static StatusCode ACCEPTED
          This code indicates that the request has been accepted for processing, but the final outcome is not yet known.
static StatusCode ADDRESS_ERROR
          The address supplied in the request was not in a recognized format or the PPG ascertained that the address was not valid for the network because it was determined not to be serviced by this PPG (i.e Not subscribed).
static StatusCode ADDRESS_NOT_FOUND
          The address supplied in the request could not be located by the PPG.
static StatusCode BAD_REQ
          General error/catch-all.
static StatusCode CANCELLATION_NOT_POSSIBLE
          The Push ID specified was found, but the corresponding message(s) could not be cancelled for some reason.
static StatusCode DUPLICATE_PUSH_ID
          The PPG has determined that the Push Initiator has violated the protocol rule that each new push submission must have a unique push ID.
static StatusCode EXPIRED
          This code indicates that the request failed because the message expired before it could be delivered.
static StatusCode FAILED
          The PPG experienced an error delivering the push to the device (e.g.
static StatusCode FORBIDDEN
          The request was refused.
static StatusCode INTERNAL_SERVER_ERROR
          Generic error: The server failed to fulfill an apparently valid request.
static StatusCode NOT_IMPLEMENTED
          The requested operation is not implemented in the PPG.
static StatusCode OK
          This code indicates that the action requested was successful.
static StatusCode OVER_HARD_PUSH_QUOTA
          This code indicates that the request has been rejected by the PPG because the daily push count quota has been exceeded.
static StatusCode OVER_SOFT_PUSH_QUOTA
          This code indicates that the request has been accepted for processing, but the final outcome is not yet known.
static StatusCode PORT_CLOSED
          Indicates that no application on the device is listening on the specified port (either the application is closed if it can be closed or it was removed).
static StatusCode PUSH_ABORTED_BY_DEVICE
          Push connection aborted by device.
static StatusCode PUSH_ID_NOT_FOUND
          This code is returned when an operation is requested on a previously submitted message and the PPG cannot find the message for the Push ID specified.
static StatusCode SERVICE_BLOCKED
          Device unable to receive push.
static StatusCode SERVICE_FAILURE
          The push failed.
static StatusCode SERVICE_UNAVAILABLE
          This code indicates that the server could not honour the request because the server is busy.
static StatusCode SPECIFIED_DELIVERY_METHOD_NOT_POSSIBLE
          The PPG could not deliver the message using the delivery-method specified in the request.
static StatusCode STATUS_QUERY_NOT_POSSIBLE
          The Push ID specified was found, but the corresponding address(es) are still being processed.
static StatusCode VERSION_NOT_SUPPORTED
          The version of PAP contained in the request is not supported.
 
Method Summary
 boolean equals(Object o)
          Returns true if two status codes are found to be equal and false otherwise.
 String getCode()
          Gets the status code returned by the PPG.
 String getDescription()
          Gets the description of the status code returned by the PPG.
static StatusCode getStatusCode(String codeString)
          Gets a status code object from a code string.
static Collection<StatusCode> getStatusCodes()
          Gets a collection of all the status codes.
 int hashCode()
          Returns a hashcode for this status code.
 String toString()
          Gets the string representation of the status code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OK

public static final StatusCode OK
This code indicates that the action requested was successful. It is used in response messages to say that the request was successfully carried out. Only application using Push Plus can receive this status code in the response of the status query or from a result notification/acknowledgement


ACCEPTED

public static final StatusCode ACCEPTED
This code indicates that the request has been accepted for processing, but the final outcome is not yet known. This code is used in response to a push submission to indicate that the message has been received by the PPG and seems to be well formed and valid.


OVER_SOFT_PUSH_QUOTA

public static final StatusCode OVER_SOFT_PUSH_QUOTA
This code indicates that the request has been accepted for processing, but the final outcome is not yet known. The PPG is indicating that the daily push count quota has been exceeded and you are approaching the hard limit where pushes will start being rejected. Future pushes should be delayed until the next day when more quota is available.

Note: This is a new status code supported by version 1.1 of BlackBerry Push Service PPG only (not BES)

Since:
1.1

BAD_REQ

public static final StatusCode BAD_REQ
General error/catch-all. This code indicates that the request was invalid in some way or the message was not understood. For example, malformed push request, invalid format or missing mandatory fields in message, malformed XML or using unsupported elements/attributes in the XML message, no active subscribers to push to, daily quota exceeded, invalid port number specified, specifying a notify URL when it wasn't expected by the PPG, etc.


FORBIDDEN

public static final StatusCode FORBIDDEN
The request was refused. (i.e. bad or missing username/password, etc.)


ADDRESS_ERROR

public static final StatusCode ADDRESS_ERROR
The address supplied in the request was not in a recognized format or the PPG ascertained that the address was not valid for the network because it was determined not to be serviced by this PPG (i.e Not subscribed). When used in a response result, and multiple recipients were specified in the corresponding push submission, this status code indicates that at least one address is incorrect.


ADDRESS_NOT_FOUND

public static final StatusCode ADDRESS_NOT_FOUND
The address supplied in the request could not be located by the PPG. This code is returned when an operation is requested on a previously submitted message and the PPG can not find the message for the address specified.


PUSH_ID_NOT_FOUND

public static final StatusCode PUSH_ID_NOT_FOUND
This code is returned when an operation is requested on a previously submitted message and the PPG cannot find the message for the Push ID specified.


DUPLICATE_PUSH_ID

public static final StatusCode DUPLICATE_PUSH_ID
The PPG has determined that the Push Initiator has violated the protocol rule that each new push submission must have a unique push ID.


CANCELLATION_NOT_POSSIBLE

public static final StatusCode CANCELLATION_NOT_POSSIBLE
The Push ID specified was found, but the corresponding message(s) could not be cancelled for some reason. For example, the message is currently being delivered over the wireless network and could not be recalled.


STATUS_QUERY_NOT_POSSIBLE

public static final StatusCode STATUS_QUERY_NOT_POSSIBLE
The Push ID specified was found, but the corresponding address(es) are still being processed. Status query is not possible at this time, try again later.


OVER_HARD_PUSH_QUOTA

public static final StatusCode OVER_HARD_PUSH_QUOTA
This code indicates that the request has been rejected by the PPG because the daily push count quota has been exceeded. Future pushes should be delayed until the next day when more quota is available

Note: This is a new status code supported by version 1.1 of BlackBerry Push Service PPG only (not BES)

Since:
1.1

INTERNAL_SERVER_ERROR

public static final StatusCode INTERNAL_SERVER_ERROR
Generic error: The server failed to fulfill an apparently valid request. Message should be retried at a later time.


NOT_IMPLEMENTED

public static final StatusCode NOT_IMPLEMENTED
The requested operation is not implemented in the PPG.


VERSION_NOT_SUPPORTED

public static final StatusCode VERSION_NOT_SUPPORTED
The version of PAP contained in the request is not supported.


SPECIFIED_DELIVERY_METHOD_NOT_POSSIBLE

public static final StatusCode SPECIFIED_DELIVERY_METHOD_NOT_POSSIBLE
The PPG could not deliver the message using the delivery-method specified in the request. Note: For an enterprise (BES) push, you must configure push.application.reliable.ports located in the rimpublic.properties of the BES for application level reliability to work.


SERVICE_FAILURE

public static final StatusCode SERVICE_FAILURE
The push failed. The operation may be retried. When pushing to an enterprise/BES environment you may receive this error code if the push message expires.

See Also:
StatusCode.EXPIRED

SERVICE_UNAVAILABLE

public static final StatusCode SERVICE_UNAVAILABLE
This code indicates that the server could not honour the request because the server is busy. Try again later; consider using an exponential back off retry algorithm


EXPIRED

public static final StatusCode EXPIRED
This code indicates that the request failed because the message expired before it could be delivered.


FAILED

public static final StatusCode FAILED
The PPG experienced an error delivering the push to the device (e.g. device is not active, push service is blocked on the device, etc.).


PORT_CLOSED

public static final StatusCode PORT_CLOSED
Indicates that no application on the device is listening on the specified port (either the application is closed if it can be closed or it was removed). This occurs only when the push was sent with confirmed/application level reliability.

Note: This status code is only supported by the BlackBerry Push Service PPG only (not BES). See the PUSH_ABORTED_BY_DEVICE constant instead.


SERVICE_BLOCKED

public static final StatusCode SERVICE_BLOCKED
Device unable to receive push. This may happen, for example, if push service is blocked for the device because the user has cancelled their service plan, deactivated their BlackBerry smartphone, has run out of time on a pre-paid data plan, etc...

Note: This is a new status code supported by version 1.1 of BlackBerry Push Service PPG only (not BES)

Since:
1.1

PUSH_ABORTED_BY_DEVICE

public static final StatusCode PUSH_ABORTED_BY_DEVICE
Push connection aborted by device. In an enterprise/BES environment this error may occur if it indicates that no application on the device is listening on the specified port (either the application is closed if it can be closed or it was removed). This occurs only when the push was sent with confirmed/application level reliability.

Note: This status code is only supported by the BlackBerry Enterprise server PPG only (not BIS). See the PORT_CLOSED constant instead.

Method Detail

getStatusCode

public static StatusCode getStatusCode(String codeString)
Gets a status code object from a code string.

Parameters:
codeString - string representation of a status code, e.g. "1001"
Returns:
the corresponding StatusCode object

getStatusCodes

public static Collection<StatusCode> getStatusCodes()
Gets a collection of all the status codes.

Returns:
a collection of all the status codes

getCode

public String getCode()
Gets the status code returned by the PPG.

Returns:
the code returned by the PPG

getDescription

public String getDescription()
Gets the description of the status code returned by the PPG.

Returns:
the English textual description of the code

equals

public boolean equals(Object o)
Returns true if two status codes are found to be equal and false otherwise.

Overrides:
equals in class Object
Returns:
whether two status codes are equal

hashCode

public int hashCode()
Returns a hashcode for this status code.

Overrides:
hashCode in class Object
Returns:
a hashcode for this status code

toString

public String toString()
Gets the string representation of the status code.

Overrides:
toString in class Object
Returns:
string representation of the status code, e.g. "1001"


Copyright © 2011 Research In Motion. All Rights Reserved.