com.relayrides.pushy.apns
Enum RejectedNotificationReason

java.lang.Object
  extended by java.lang.Enum<RejectedNotificationReason>
      extended by com.relayrides.pushy.apns.RejectedNotificationReason
All Implemented Interfaces:
Serializable, Comparable<RejectedNotificationReason>

public enum RejectedNotificationReason
extends Enum<RejectedNotificationReason>

An enumeration of error codes that may be returned by APNs to indicate why a push notification was rejected. With the exception of SHUTDOWN, all rejections are assumed to be permanent failures.

Author:
Jon Chambers

Enum Constant Summary
INVALID_PAYLOAD_SIZE
           
INVALID_TOKEN
           
INVALID_TOKEN_SIZE
           
INVALID_TOPIC_SIZE
           
MISSING_PAYLOAD
           
MISSING_TOKEN
           
MISSING_TOPIC
           
NO_ERROR
           
PROCESSING_ERROR
           
SHUTDOWN
          Indicates that the notification was accepted, but the connection is being shut down for maintenance.
UNKNOWN
           
 
Method Summary
static RejectedNotificationReason getByErrorCode(byte errorCode)
          Gets the rejection reason associated with the given error code.
 byte getErrorCode()
          Returns the one-byte error code associated with this rejection reason.
static RejectedNotificationReason valueOf(String name)
          Returns the enum constant of this type with the specified name.
static RejectedNotificationReason[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NO_ERROR

public static final RejectedNotificationReason NO_ERROR

PROCESSING_ERROR

public static final RejectedNotificationReason PROCESSING_ERROR

MISSING_TOKEN

public static final RejectedNotificationReason MISSING_TOKEN

MISSING_TOPIC

public static final RejectedNotificationReason MISSING_TOPIC

MISSING_PAYLOAD

public static final RejectedNotificationReason MISSING_PAYLOAD

INVALID_TOKEN_SIZE

public static final RejectedNotificationReason INVALID_TOKEN_SIZE

INVALID_TOPIC_SIZE

public static final RejectedNotificationReason INVALID_TOPIC_SIZE

INVALID_PAYLOAD_SIZE

public static final RejectedNotificationReason INVALID_PAYLOAD_SIZE

INVALID_TOKEN

public static final RejectedNotificationReason INVALID_TOKEN

SHUTDOWN

public static final RejectedNotificationReason SHUTDOWN

Indicates that the notification was accepted, but the connection is being shut down for maintenance. According to Apple's documentation:

A status code of 10 indicates that the APNs server closed the connection (for example, to perform maintenance). The notification identifier in the error response indicates the last notification that was successfully sent. Any notifications you sent after it have been discarded and must be resent. When you receive this status code, stop using this connection and open a new connection.


UNKNOWN

public static final RejectedNotificationReason UNKNOWN
Method Detail

values

public static RejectedNotificationReason[] 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 (RejectedNotificationReason c : RejectedNotificationReason.values())
    System.out.println(c);

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

valueOf

public static RejectedNotificationReason 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

getErrorCode

public byte getErrorCode()
Returns the one-byte error code associated with this rejection reason.

Returns:
the one-byte error code associated with this rejection reason

getByErrorCode

public static RejectedNotificationReason getByErrorCode(byte errorCode)
Gets the rejection reason associated with the given error code.

Parameters:
errorCode - the error code for which to retrieve a rejection reason
Returns:
the rejection reason associated with errorCode


Copyright © 2013 RelayRides. All rights reserved.