public final class StoredChannel implements Serializable
Beta
Notification channel information to be stored in a data store.
Implementation is thread safe.
Implements
SerializableStatic Fields
DEFAULT_DATA_STORE_ID
public static final String DEFAULT_DATA_STORE_ID
Default data store ID.
Type | Description |
String |
Static Methods
getDefaultDataStore(DataStoreFactory dataStoreFactory)
public static DataStore<StoredChannel> getDefaultDataStore(DataStoreFactory dataStoreFactory)
Returns the stored channel data store using the ID #DEFAULT_DATA_STORE_ID.
Name | Description |
dataStoreFactory | com.google.api.client.util.store.DataStoreFactory data store factory |
Type | Description |
com.google.api.client.util.store.DataStore<StoredChannel> | stored channel data store |
Type | Description |
IOException |
Constructors
StoredChannel(UnparsedNotificationCallback notificationCallback)
public StoredChannel(UnparsedNotificationCallback notificationCallback)
Constructor with a random UUID using NotificationUtils#randomUuidString().
Name | Description |
notificationCallback | UnparsedNotificationCallback notification handler called when a notification is received for this subscription |
StoredChannel(UnparsedNotificationCallback notificationCallback, String id)
public StoredChannel(UnparsedNotificationCallback notificationCallback, String id)
Constructor with a custom UUID.
Name | Description |
notificationCallback | UnparsedNotificationCallback notification handler called when a notification is received for this subscription |
id | String subscription UUID |
Methods
equals(Object other)
public boolean equals(Object other)
Name | Description |
other | Object |
Type | Description |
boolean |
getClientToken()
public 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.
Type | Description |
String |
getExpiration()
public Long getExpiration()
Returns the milliseconds in Unix time at which the subscription will expire or null
for
an infinite TTL.
Type | Description |
Long |
getId()
public String getId()
Returns the subscription UUID.
Type | Description |
String |
getNotificationCallback()
public UnparsedNotificationCallback getNotificationCallback()
Returns the notification callback called when a notification is received for this subscription.
Type | Description |
UnparsedNotificationCallback |
getTopicId()
public String getTopicId()
Returns the opaque ID for the subscribed resource that is stable across API versions or
null
for none.
Type | Description |
String |
hashCode()
public int hashCode()
Type | Description |
int |
setClientToken(String clientToken)
public StoredChannel 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.
Name | Description |
clientToken | String |
Type | Description |
StoredChannel |
setExpiration(Long expiration)
public StoredChannel setExpiration(Long expiration)
Sets the milliseconds in Unix time at which the subscription will expire or null
for an
infinite TTL.
Name | Description |
expiration | Long |
Type | Description |
StoredChannel |
setTopicId(String topicId)
public StoredChannel setTopicId(String topicId)
Sets the opaque ID for the subscribed resource that is stable across API versions or
null
for none.
Name | Description |
topicId | String |
Type | Description |
StoredChannel |
store(DataStore<StoredChannel> dataStore)
public StoredChannel store(DataStore<StoredChannel> dataStore)
Stores this notification channel in the given notification channel data store.
It is important that this method be called before the watch HTTP request is made in case the notification is received before the watch HTTP response is received.
Name | Description |
dataStore | com.google.api.client.util.store.DataStore<StoredChannel> notification channel data store |
Type | Description |
StoredChannel |
Type | Description |
IOException |
store(DataStoreFactory dataStoreFactory)
public StoredChannel store(DataStoreFactory dataStoreFactory)
Stores this notification channel in the notification channel data store, which is derived from #getDefaultDataStore(DataStoreFactory) on the given data store factory.
It is important that this method be called before the watch HTTP request is made in case the notification is received before the watch HTTP response is received.
Name | Description |
dataStoreFactory | com.google.api.client.util.store.DataStoreFactory data store factory |
Type | Description |
StoredChannel |
Type | Description |
IOException |
toString()
public String toString()
Type | Description |
String |