public static enum ReconnectPolicy.Provided extends Enum<ReconnectPolicy.Provided>
Enum Constant and Description |
---|
EVERY_HALF_HOUR
Makes a new connection if the current connection has lasted for more than half an hour.
|
EVERY_NOTIFICATION
Makes a new connection for every message being sent.
|
NEVER
Only reconnect if absolutely needed, e.g.
|
Modifier and Type | Method and Description |
---|---|
static ReconnectPolicy.Provided |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ReconnectPolicy.Provided[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ReconnectPolicy.Provided NEVER
Apple recommends using a persistent connection. This improves the latency of sending push notification messages.
The down-side is that once the connection is closed ungracefully (e.g. because Apple server drops it), the library wouldn't detect such failure and not warn against the messages sent after the drop before the detection.
public static final ReconnectPolicy.Provided EVERY_HALF_HOUR
This is the recommended mode.
This is the sweat-spot in my experiments between dropped connections while minimizing latency.
public static final ReconnectPolicy.Provided EVERY_NOTIFICATION
public static ReconnectPolicy.Provided[] values()
for (ReconnectPolicy.Provided c : ReconnectPolicy.Provided.values()) System.out.println(c);
public static ReconnectPolicy.Provided valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2015. All rights reserved.