public final class StoredSubscription extends Object implements Serializable
SubscriptionStore
.
Implementation is thread safe.
Constructor and Description |
---|
StoredSubscription(NotificationCallback notificationCallback)
Constructor with a random UUID using
randomId() . |
StoredSubscription(NotificationCallback notificationCallback,
com.google.api.client.json.GenericJson subscriptionJson)
Constructor based on a JSON-formatted subscription response information.
|
StoredSubscription(NotificationCallback notificationCallback,
String id)
Constructor with a custom UUID.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getClientToken()
Returns the arbitrary string provided by the client associated with this subscription that is
delivered to the target address with each notification or
null for none. |
String |
getExpiration()
Returns the HTTP date indicating the time at which the subscription will expire or
null
for an infinite TTL. |
String |
getId()
Returns the subscription UUID.
|
NotificationCallback |
getNotificationCallback()
Returns the notification callback called when a notification is received for this subscription.
|
String |
getTopicId()
Returns the opaque ID for the subscribed resource that is stable across API versions or
null for none. |
int |
hashCode() |
static String |
randomId()
Returns a new random UUID to be used as a subscription ID.
|
StoredSubscription |
setClientToken(String clientToken)
Sets the the arbitrary string provided by the client associated with this subscription that is
delivered to the target address with each notification or
null for none. |
StoredSubscription |
setExpiration(String expiration)
Sets the HTTP date indicating the time at which the subscription will expire or
null
for an infinite TTL. |
StoredSubscription |
setTopicId(String topicId)
Sets the opaque ID for the subscribed resource that is stable across API versions or
null for none. |
String |
toString() |
public StoredSubscription(NotificationCallback notificationCallback)
randomId()
.notificationCallback
- notification handler called when a notification is received for
this subscriptionpublic StoredSubscription(NotificationCallback notificationCallback, String id)
notificationCallback
- notification handler called when a notification is received for
this subscriptionid
- subscription UUIDpublic StoredSubscription(NotificationCallback notificationCallback, com.google.api.client.json.GenericJson subscriptionJson)
notificationCallback
- notification handler called when a notification is received for
this subscriptionsubscriptionJson
- JSON-formatted subscription response information, where the:
"id"
has a JSON string value for the subscription ID"clientToken"
has a JSON string value for the client token (see
setClientToken(String)
)"expiration"
has a JSON string value for the client token (see
setExpiration(String)
)"topicId"
has a JSON string value for the client token (see
setTopicId(String)
)public NotificationCallback getNotificationCallback()
public String getClientToken()
null
for none.public StoredSubscription setClientToken(String clientToken)
null
for none.public String getExpiration()
null
for an infinite TTL.public StoredSubscription setExpiration(String expiration)
null
for an infinite TTL.public String getId()
public String getTopicId()
null
for none.public StoredSubscription setTopicId(String topicId)
null
for none.public static String randomId()
Copyright © 2010-2013 Google. All Rights Reserved.