@Beta
public final class StoredChannel
extends java.lang.Object
implements java.io.Serializable
Beta
Implementation is thread safe.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DATA_STORE_ID
Default data store ID.
|
Constructor and Description |
---|
StoredChannel(UnparsedNotificationCallback notificationCallback)
Constructor with a random UUID using
NotificationUtils.randomUuidString() . |
StoredChannel(UnparsedNotificationCallback notificationCallback,
java.lang.String id)
Constructor with a custom UUID.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.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. |
static com.google.api.client.util.store.DataStore<StoredChannel> |
getDefaultDataStore(com.google.api.client.util.store.DataStoreFactory dataStoreFactory)
Returns the stored channel data store using the ID
DEFAULT_DATA_STORE_ID . |
java.lang.Long |
getExpiration()
Returns the milliseconds in Unix time at which the subscription will expire or
null for
an infinite TTL. |
java.lang.String |
getId()
Returns the subscription UUID.
|
UnparsedNotificationCallback |
getNotificationCallback()
Returns the notification callback called when a notification is received for this subscription.
|
java.lang.String |
getTopicId()
Returns the opaque ID for the subscribed resource that is stable across API versions or
null for none. |
int |
hashCode() |
StoredChannel |
setClientToken(java.lang.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. |
StoredChannel |
setExpiration(java.lang.Long expiration)
Sets the milliseconds in Unix time at which the subscription will expire or
null for an
infinite TTL. |
StoredChannel |
setTopicId(java.lang.String topicId)
Sets the opaque ID for the subscribed resource that is stable across API versions or
null for none. |
StoredChannel |
store(com.google.api.client.util.store.DataStore<StoredChannel> dataStore)
Stores this notification channel in the given notification channel data store.
|
StoredChannel |
store(com.google.api.client.util.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. |
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_DATA_STORE_ID
public StoredChannel(UnparsedNotificationCallback notificationCallback)
NotificationUtils.randomUuidString()
.notificationCallback
- notification handler called when a notification is received for
this subscriptionpublic StoredChannel(UnparsedNotificationCallback notificationCallback, java.lang.String id)
notificationCallback
- notification handler called when a notification is received for
this subscriptionid
- subscription UUIDpublic StoredChannel store(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) throws java.io.IOException
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.
dataStoreFactory
- data store factoryjava.io.IOException
public StoredChannel store(com.google.api.client.util.store.DataStore<StoredChannel> dataStore) throws java.io.IOException
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.
dataStore
- notification channel data storejava.io.IOException
public UnparsedNotificationCallback getNotificationCallback()
public java.lang.String getClientToken()
null
for none.public StoredChannel setClientToken(java.lang.String clientToken)
null
for none.public java.lang.Long getExpiration()
null
for
an infinite TTL.public StoredChannel setExpiration(java.lang.Long expiration)
null
for an
infinite TTL.public java.lang.String getId()
public java.lang.String getTopicId()
null
for none.public StoredChannel setTopicId(java.lang.String topicId)
null
for none.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static com.google.api.client.util.store.DataStore<StoredChannel> getDefaultDataStore(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) throws java.io.IOException
DEFAULT_DATA_STORE_ID
.dataStoreFactory
- data store factoryjava.io.IOException
Copyright © 2010-2018 Google. All Rights Reserved.