public final class Subscription extends Object implements Serializable
Should be stored in a SubscriptionStore
. Implementation is thread safe.
Constructor and Description |
---|
Subscription(NotificationCallback handler,
String clientToken,
String subscriptionId)
Constructor to be called before making the subscribe request.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getClientToken()
Returns the Opaque string provided by the client or
null for none. |
NotificationCallback |
getNotificationCallback()
Returns the notification callback called when a notification is received for this subscription.
|
String |
getSubscriptionExpires()
Returns the HTTP Date indicating the time at which the subscription will expire or
null
for an infinite TTL. |
String |
getSubscriptionId()
Returns the subscription UUID.
|
String |
getTopicId()
Returns the opaque ID for the subscribed resource that is stable across API versions.
|
int |
hashCode() |
Subscription |
processResponse(String subscriptionExpires,
String topicId)
Process subscribe response.
|
String |
toString() |
public Subscription(NotificationCallback handler, String clientToken, String subscriptionId)
handler
- notification handler called when a notification is received for this
subscriptionclientToken
- opaque string provided by the client or null
for nonesubscriptionId
- subscription UUIDpublic Subscription processResponse(String subscriptionExpires, String topicId)
subscriptionExpires
- HTTP Date indicating the time at which the subscription will expire
or null
for an infinite TTLtopicId
- opaque ID for the subscribed resource that is stable across API versionspublic NotificationCallback getNotificationCallback()
public String getClientToken()
null
for none.public String getSubscriptionExpires()
null
for an infinite TTL.public String getSubscriptionId()
public String getTopicId()
Copyright © 2010-2012 Google. All Rights Reserved.