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.
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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class StoredChannel (2.8.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.8.1 (latest)](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.StoredChannel)\n- [2.8.0](/java/docs/reference/google-api-client/2.8.0/com.google.api.client.googleapis.notifications.StoredChannel)\n- [2.7.2](/java/docs/reference/google-api-client/2.7.2/com.google.api.client.googleapis.notifications.StoredChannel)\n- [2.6.0](/java/docs/reference/google-api-client/2.6.0/com.google.api.client.googleapis.notifications.StoredChannel)\n- [2.5.1](/java/docs/reference/google-api-client/2.5.1/com.google.api.client.googleapis.notifications.StoredChannel)\n- [2.4.1](/java/docs/reference/google-api-client/2.4.1/com.google.api.client.googleapis.notifications.StoredChannel)\n- [2.1.2](/java/docs/reference/google-api-client/2.1.2/com.google.api.client.googleapis.notifications.StoredChannel)\n- [2.0.1](/java/docs/reference/google-api-client/2.0.1/com.google.api.client.googleapis.notifications.StoredChannel)\n- [1.35.2](/java/docs/reference/google-api-client/1.35.2/com.google.api.client.googleapis.notifications.StoredChannel)\n- [1.34.1](/java/docs/reference/google-api-client/1.34.1/com.google.api.client.googleapis.notifications.StoredChannel)\n- [1.33.4](/java/docs/reference/google-api-client/1.33.4/com.google.api.client.googleapis.notifications.StoredChannel) \n\n public final class StoredChannel implements Serializable\n\nBeta \n\nNotification channel information to be stored in a data store.\n\nImplementation is thread safe. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e StoredChannel \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Fields\n-------------\n\n### DEFAULT_DATA_STORE_ID\n\n public static final String DEFAULT_DATA_STORE_ID\n\nDefault data store ID.\n\nStatic Methods\n--------------\n\n### getDefaultDataStore(DataStoreFactory dataStoreFactory)\n\n public static DataStore\u003cStoredChannel\u003e getDefaultDataStore(DataStoreFactory dataStoreFactory)\n\nReturns the stored channel data store using the ID [#DEFAULT_DATA_STORE_ID](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.StoredChannel#com_google_api_client_googleapis_notifications_StoredChannel_DEFAULT_DATA_STORE_ID).\n\nConstructors\n------------\n\n### StoredChannel(UnparsedNotificationCallback notificationCallback)\n\n public StoredChannel(UnparsedNotificationCallback notificationCallback)\n\nConstructor with a random UUID using [NotificationUtils#randomUuidString()](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.NotificationUtils#com_google_api_client_googleapis_notifications_NotificationUtils_randomUuidString__).\n\n### StoredChannel(UnparsedNotificationCallback notificationCallback, String id)\n\n public StoredChannel(UnparsedNotificationCallback notificationCallback, String id)\n\nConstructor with a custom UUID.\n\nMethods\n-------\n\n### equals(Object other)\n\n public boolean equals(Object other)\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### getClientToken()\n\n public String getClientToken()\n\nReturns the arbitrary string provided by the client associated with this subscription that is\ndelivered to the target address with each notification or `null` for none.\n\n### getExpiration()\n\n public Long getExpiration()\n\nReturns the milliseconds in Unix time at which the subscription will expire or `null` for\nan infinite TTL.\n\n### getId()\n\n public String getId()\n\nReturns the subscription UUID.\n\n### getNotificationCallback()\n\n public UnparsedNotificationCallback getNotificationCallback()\n\nReturns the notification callback called when a notification is received for this subscription.\n\n### getTopicId()\n\n public String getTopicId()\n\nReturns the opaque ID for the subscribed resource that is stable across API versions or `\nnull` for none.\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)\n\n### setClientToken(String clientToken)\n\n public StoredChannel setClientToken(String clientToken)\n\nSets the arbitrary string provided by the client associated with this subscription that is\ndelivered to the target address with each notification or `null` for none.\n\n### setExpiration(Long expiration)\n\n public StoredChannel setExpiration(Long expiration)\n\nSets the milliseconds in Unix time at which the subscription will expire or `null` for an\ninfinite TTL.\n\n### setTopicId(String topicId)\n\n public StoredChannel setTopicId(String topicId)\n\nSets the opaque ID for the subscribed resource that is stable across API versions or `\nnull` for none.\n\n### store(DataStore\\\u003cStoredChannel\\\u003e dataStore)\n\n public StoredChannel store(DataStore\u003cStoredChannel\u003e dataStore)\n\nStores this notification channel in the given notification channel data store.\n\nIt is important that this method be called before the watch HTTP request is made in case the\nnotification is received before the watch HTTP response is received.\n\n### store(DataStoreFactory dataStoreFactory)\n\n public StoredChannel store(DataStoreFactory dataStoreFactory)\n\nStores this notification channel in the notification channel data store, which is derived from\n[#getDefaultDataStore(DataStoreFactory)](/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.StoredChannel#com_google_api_client_googleapis_notifications_StoredChannel_getDefaultDataStore_com_google_api_client_util_store_DataStoreFactory_) on the given data store factory.\n\nIt is important that this method be called before the watch HTTP request is made in case the\nnotification is received before the watch HTTP response is received.\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]