Class StoredChannel (2.1.2)

public final class StoredChannel implements Serializable

Beta
Notification channel information to be stored in a data store.

Implementation is thread safe.

Inheritance

Object > StoredChannel

Implements

Serializable

Static Fields

DEFAULT_DATA_STORE_ID

public static final String DEFAULT_DATA_STORE_ID

Default data store ID.

Field Value
TypeDescription
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
NameDescription
dataStoreFactorycom.google.api.client.util.store.DataStoreFactory

data store factory

Returns
TypeDescription
com.google.api.client.util.store.DataStore<StoredChannel>

stored channel data store

Exceptions
TypeDescription
IOException

Constructors

StoredChannel(UnparsedNotificationCallback notificationCallback)

public StoredChannel(UnparsedNotificationCallback notificationCallback)

Constructor with a random UUID using NotificationUtils#randomUuidString().

Parameter
NameDescription
notificationCallbackUnparsedNotificationCallback

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
NameDescription
notificationCallbackUnparsedNotificationCallback

notification handler called when a notification is received for this subscription

idString

subscription UUID

Methods

equals(Object other)

public boolean equals(Object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
boolean
Overrides

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
TypeDescription
String

getExpiration()

public Long getExpiration()

Returns the milliseconds in Unix time at which the subscription will expire or null for an infinite TTL.

Returns
TypeDescription
Long

getId()

public String getId()

Returns the subscription UUID.

Returns
TypeDescription
String

getNotificationCallback()

public UnparsedNotificationCallback getNotificationCallback()

Returns the notification callback called when a notification is received for this subscription.

Returns
TypeDescription
UnparsedNotificationCallback

getTopicId()

public String getTopicId()

Returns the opaque ID for the subscribed resource that is stable across API versions or null for none.

Returns
TypeDescription
String

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

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.

Parameter
NameDescription
clientTokenString
Returns
TypeDescription
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
NameDescription
expirationLong
Returns
TypeDescription
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
NameDescription
topicIdString
Returns
TypeDescription
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
NameDescription
dataStorecom.google.api.client.util.store.DataStore<StoredChannel>

notification channel data store

Returns
TypeDescription
StoredChannel
Exceptions
TypeDescription
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
NameDescription
dataStoreFactorycom.google.api.client.util.store.DataStoreFactory

data store factory

Returns
TypeDescription
StoredChannel
Exceptions
TypeDescription
IOException

toString()

public String toString()
Returns
TypeDescription
String
Overrides