net.rim.blackberry.api.push
Class PushApplicationStatus

java.lang.Object
  extended by net.rim.blackberry.api.push.PushApplicationStatus

public class PushApplicationStatus
extends Object

Provides mechanisms for handling the current status of the client-side push application.

Since:
BlackBerry API 5.0.0

Field Summary
static byte REASON_API_CALL
          Status change was initiated by API call
static byte REASON_INVALID_PARAMETERS
          Invalid parameters were provided that caused registration failure
static byte REASON_NETWORK_ERROR
          Communication failed due to network error
static byte REASON_REJECTED_BY_SERVER
          Registration was rejected by server
static byte REASON_SIM_CHANGE
          Constant for status reason initiated by SIM card change.
static byte STATUS_ACTIVE
          Subscription status client-side push application that is actively listening for active push application.
static byte STATUS_FAILED
          Subscription status of the client-side push application when subscription has failed and it is not listening for push messages.
static byte STATUS_NOT_REGISTERED
          Application didn't register for push messages
static byte STATUS_PENDING
          Subscription status of the client-side push application that requested push communication but was not confirmed yet.
 
Method Summary
 String getError()
          Returns error message indicating why the registration failed.
 byte getReason()
          Returns reason why the status has changed
 byte getStatus()
          Returns current registration status.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

STATUS_NOT_REGISTERED

public static final byte STATUS_NOT_REGISTERED
Application didn't register for push messages

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

STATUS_PENDING

public static final byte STATUS_PENDING
Subscription status of the client-side push application that requested push communication but was not confirmed yet.

This status is usually reported when push subscription requires server support and it was not completed yet, for example, due to the BlackBerry device being out of network coverage.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

STATUS_ACTIVE

public static final byte STATUS_ACTIVE
Subscription status client-side push application that is actively listening for active push application. Device listens for incoming push messages.

Note that server-side status may be different (e.g. suspended) which would block push messages.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

STATUS_FAILED

public static final byte STATUS_FAILED
Subscription status of the client-side push application when subscription has failed and it is not listening for push messages. This can occur during registration, for example, when the server rejected the the BlackBerry device or after registration when device firewall settings has changed preventing the application from listening.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

REASON_NETWORK_ERROR

public static final byte REASON_NETWORK_ERROR
Communication failed due to network error

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

REASON_REJECTED_BY_SERVER

public static final byte REASON_REJECTED_BY_SERVER
Registration was rejected by server

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

REASON_SIM_CHANGE

public static final byte REASON_SIM_CHANGE
Constant for status reason initiated by SIM card change.

If application was tracked by the BPAS and user replaced SIM card then the application will be unregistered and should perform user authorization and re-register if required.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

REASON_INVALID_PARAMETERS

public static final byte REASON_INVALID_PARAMETERS
Invalid parameters were provided that caused registration failure

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

REASON_API_CALL

public static final byte REASON_API_CALL
Status change was initiated by API call

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0


Method Detail

getStatus

public byte getStatus()
Returns current registration status.

Returns:
one of the PushApplicationStatus.STATUS_PENDING, PushApplicationStatus.STATUS_ACTIVE, PushApplicationStatus.STATUS_FAILED, PushApplicationStatus.STATUS_NOT_REGISTERED.
Since:
BlackBerry API 5.0.0

getError

public String getError()
Returns error message indicating why the registration failed. Used with PushApplicationStatus.STATUS_FAILED status code, otherwise null.

Returns:
error message
Since:
BlackBerry API 5.0.0

getReason

public byte getReason()
Returns reason why the status has changed

Returns:
one of the REASON_XXX constants
Since:
BlackBerry API 5.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.