com.relayrides.pushy.apns.util
Class SimpleApnsPushNotification

java.lang.Object
  extended by com.relayrides.pushy.apns.util.SimpleApnsPushNotification
All Implemented Interfaces:
ApnsPushNotification

public class SimpleApnsPushNotification
extends Object
implements ApnsPushNotification

A simple and immutable implementation of the ApnsPushNotification interface.

Author:
Jon Chambers
See Also:
ApnsPayloadBuilder, TokenUtil

Constructor Summary
SimpleApnsPushNotification(byte[] token, String payload)
          Constructs a new push notification with the given token and payload.
SimpleApnsPushNotification(byte[] token, String payload, Date invalidationTime)
          Constructs a new push notification with the given token, payload, and delivery expiration time.
 
Method Summary
 boolean equals(Object obj)
           
 Date getDeliveryInvalidationTime()
          Returns the time at which this push notification is no longer valid and should no longer be delivered.
 String getPayload()
          Returns the payload to include in this push notification.
 byte[] getToken()
          Returns the token of the device to which this push notification should be delivered.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleApnsPushNotification

public SimpleApnsPushNotification(byte[] token,
                                  String payload)
Constructs a new push notification with the given token and payload. No expiration time is set for the notification, so APNs will not attempt to store the notification for later delivery if the initial attempt fails.

Parameters:
token - the device token to which this push notification should be delivered
payload - the payload to include in this push notification

SimpleApnsPushNotification

public SimpleApnsPushNotification(byte[] token,
                                  String payload,
                                  Date invalidationTime)
Constructs a new push notification with the given token, payload, and delivery expiration time.

Parameters:
token - the device token to which this push notification should be delivered
payload - the payload to include in this push notification
invalidationTime - the time at which Apple's servers should stop trying to deliver this message; if null, no delivery attempts beyond the first will be made
Method Detail

getToken

public byte[] getToken()
Returns the token of the device to which this push notification should be delivered.

Specified by:
getToken in interface ApnsPushNotification
Returns:
the token of the device to which this push notification should be delivered

getPayload

public String getPayload()
Returns the payload to include in this push notification.

Specified by:
getPayload in interface ApnsPushNotification
Returns:
the payload to include in this push notification

getDeliveryInvalidationTime

public Date getDeliveryInvalidationTime()
Returns the time at which this push notification is no longer valid and should no longer be delivered.

Specified by:
getDeliveryInvalidationTime in interface ApnsPushNotification
Returns:
the time at which this push notification is no longer valid and should no longer be delivered
See Also:
Provider Communication with Apple Push Notification Service

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 RelayRides. All rights reserved.