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.
Field Value | |
---|---|
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.
Parameter | |
---|---|
Name | Description |
dataStoreFactory |
com.google.api.client.util.store.DataStoreFactory data store factory |
Returns | |
---|---|
Type | Description |
com.google.api.client.util.store.DataStore<StoredChannel> |
stored channel data store |
Exceptions | |
---|---|
Type | Description |
IOException |
Constructors
StoredChannel(UnparsedNotificationCallback notificationCallback)
public StoredChannel(UnparsedNotificationCallback notificationCallback)
Constructor with a random UUID using NotificationUtils#randomUuidString().
Parameter | |
---|---|
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.
Parameters | |
---|---|
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)
Parameter | |
---|---|
Name | Description |
other |
Object |
Returns | |
---|---|
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.
Returns | |
---|---|
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.
Returns | |
---|---|
Type | Description |
Long |
getId()
public String getId()
Returns the subscription UUID.
Returns | |
---|---|
Type | Description |
String |
getNotificationCallback()
public UnparsedNotificationCallback getNotificationCallback()
Returns the notification callback called when a notification is received for this subscription.
Returns | |
---|---|
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.
Returns | |
---|---|
Type | Description |
String |
hashCode()
public int hashCode()
Returns | |
---|---|
Type | Description |
int |
setClientToken(String clientToken)
public StoredChannel setClientToken(String clientToken)
Sets 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.
Parameter | |
---|---|
Name | Description |
clientToken |
String |
Returns | |
---|---|
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.
Parameter | |
---|---|
Name | Description |
expiration |
Long |
Returns | |
---|---|
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.
Parameter | |
---|---|
Name | Description |
topicId |
String |
Returns | |
---|---|
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.
Parameter | |
---|---|
Name | Description |
dataStore |
com.google.api.client.util.store.DataStore<StoredChannel> notification channel data store |
Returns | |
---|---|
Type | Description |
StoredChannel |
Exceptions | |
---|---|
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.
Parameter | |
---|---|
Name | Description |
dataStoreFactory |
com.google.api.client.util.store.DataStoreFactory data store factory |
Returns | |
---|---|
Type | Description |
StoredChannel |
Exceptions | |
---|---|
Type | Description |
IOException |
toString()
public String toString()
Returns | |
---|---|
Type | Description |
String |