com.notnoop.mpns
Enum MpnsResponse

java.lang.Object
  extended by java.lang.Enum<MpnsResponse>
      extended by com.notnoop.mpns.MpnsResponse
All Implemented Interfaces:
Serializable, Comparable<MpnsResponse>

public enum MpnsResponse
extends Enum<MpnsResponse>

Represents the logical response of MpnsService


Enum Constant Summary
BAD_REQUEST
          This error occurs when the web service sends a notification request with a bad XML document or malformed notification URI.
DISCONNECTED
          The notification was processed by WNS but the device is offline.
DROPPED_BY_CLIENT
          The push notification was received and dropped by the client.
EXPIRED
          The subscription is invalid and is not present on the Push Notification Service.
INACTIVATE_STATE
          The device is in an inactive state.
METHOD_NOT_ALLOWED
          Invalid method (PUT, DELETE, CREATE).
OVER_LIMIT
          This error occurs when an unauthenticated web service has reached the per day throttling limit for a subscription.
QUEUE_FULL
          Queue overflow.
QUEUED
          The notification request was accepted and queued for delivery.
RECEIVED
           
SERVICE_UNAVAILABLE
          The Push Notification Service is unable to process the request.
SUPPRESSED
          The push notification was received and dropped by the Push Notification Service.
UNAUTHORIZED
          Sending this notification is unauthorized.
UNDEFINED
          Undefined This is used for uninitialized responses and when we try to parse an error that does not fit above error matrix.
 
Method Summary
 String getDeviceConnectionStatus()
           
 String getNotificationStatus()
           
 int getResponseCode()
           
 String getSubscriptionStatus()
           
 boolean isSuccessful()
           
 boolean shouldRetry()
           
static MpnsResponse valueOf(String name)
          Returns the enum constant of this type with the specified name.
static MpnsResponse[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

RECEIVED

public static final MpnsResponse RECEIVED

DISCONNECTED

public static final MpnsResponse DISCONNECTED
The notification was processed by WNS but the device is offline.


QUEUED

public static final MpnsResponse QUEUED
The notification request was accepted and queued for delivery.


QUEUE_FULL

public static final MpnsResponse QUEUE_FULL
Queue overflow. The web service should re-send the notification later. A best practice is to use an exponential backoff algorithm in minute increments.


SUPPRESSED

public static final MpnsResponse SUPPRESSED
The push notification was received and dropped by the Push Notification Service. The Suppressed status can occur if the notification channel was configured to suppress push notifications for a particular push notification class.


DROPPED_BY_CLIENT

public static final MpnsResponse DROPPED_BY_CLIENT
The push notification was received and dropped by the client. This occurs if application is configured to not run in background or if battery saving is enabled. This state doesn't seem to be documented yet.


BAD_REQUEST

public static final MpnsResponse BAD_REQUEST
This error occurs when the web service sends a notification request with a bad XML document or malformed notification URI.


UNAUTHORIZED

public static final MpnsResponse UNAUTHORIZED
Sending this notification is unauthorized. This error can occur for one of the following reasons:


EXPIRED

public static final MpnsResponse EXPIRED
The subscription is invalid and is not present on the Push Notification Service. The web service should stop sending new notifications to this subscription, and drop the subscription state for its corresponding application session.


METHOD_NOT_ALLOWED

public static final MpnsResponse METHOD_NOT_ALLOWED
Invalid method (PUT, DELETE, CREATE). Only POST is allowed when sending a notification request.


OVER_LIMIT

public static final MpnsResponse OVER_LIMIT
This error occurs when an unauthenticated web service has reached the per day throttling limit for a subscription. The web service can try to re-send the push notification every one hour after receiving this error. The web service may need to wait up to 24 hours before normal notification flow will resume.


INACTIVATE_STATE

public static final MpnsResponse INACTIVATE_STATE
The device is in an inactive state. The web service may re-attempt sending the request one time per hour at maximum after receiving this error. If the web service violates the maximum of one re-attempt per hour, the Push Notification Service will de-register or permanently block the web service.


SERVICE_UNAVAILABLE

public static final MpnsResponse SERVICE_UNAVAILABLE
The Push Notification Service is unable to process the request. The web service should re-send the notification later. A best practice is to use an exponential backoff algorithm in minute increments.


UNDEFINED

public static final MpnsResponse UNDEFINED
Undefined This is used for uninitialized responses and when we try to parse an error that does not fit above error matrix.

Method Detail

values

public static MpnsResponse[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (MpnsResponse c : MpnsResponse.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static MpnsResponse valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getResponseCode

public int getResponseCode()

getNotificationStatus

public String getNotificationStatus()

getDeviceConnectionStatus

public String getDeviceConnectionStatus()

getSubscriptionStatus

public String getSubscriptionStatus()

isSuccessful

public boolean isSuccessful()

shouldRetry

public boolean shouldRetry()


Copyright © 2015. All Rights Reserved.