2.9.3 (latest) 2.9.2 2.8.1 2.7.2 2.6.0 2.5.1 2.4.1 2.1.2 2.0.1 1.35.2 1.34.1 1.33.4

```java
public final class StoredChannel implements Serializable
```
Beta   

Notification channel information to be stored in a data store.

Implementation is thread safe.

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> StoredChannel

## Implements

[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### DEFAULT_DATA_STORE_ID

```java
public static final String DEFAULT_DATA_STORE_ID
```
Default data store ID.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `String` |   |

## Static Methods

### getDefaultDataStore(DataStoreFactory dataStoreFactory)

```java
public static DataStore<StoredChannel> getDefaultDataStore(DataStoreFactory dataStoreFactory)
```
Returns the stored channel data store using the ID [#DEFAULT_DATA_STORE_ID](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.StoredChannel.md.txt#com_google_api_client_googleapis_notifications_StoredChannel_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)

```java
public StoredChannel(UnparsedNotificationCallback notificationCallback)
```
Constructor with a random UUID using [NotificationUtils#randomUuidString()](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.NotificationUtils.md.txt#com_google_api_client_googleapis_notifications_NotificationUtils_randomUuidString__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `notificationCallback` | `UnparsedNotificationCallback` notification handler called when a notification is received for this subscription |

### StoredChannel(UnparsedNotificationCallback notificationCallback, String id)

```java
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)

```java
public boolean equals(Object other)
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `Object` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `boolean` |   |

**Overrides** [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)

### getClientToken()

```java
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()

```java
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()

```java
public String getId()
```
Returns the subscription UUID.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `String` |   |

### getNotificationCallback()

```java
public UnparsedNotificationCallback getNotificationCallback()
```
Returns the notification callback called when a notification is received for this subscription.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `UnparsedNotificationCallback` |   |

### getTopicId()

```java
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()

```java
public int hashCode()
```

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

**Overrides** [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)

### setClientToken(String clientToken)

```java
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)

```java
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)

```java
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)

```java
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)

```java
public StoredChannel store(DataStoreFactory dataStoreFactory)
```
Stores this notification channel in the notification channel data store, which is derived from
[#getDefaultDataStore(DataStoreFactory)](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.StoredChannel.md.txt#com_google_api_client_googleapis_notifications_StoredChannel_getDefaultDataStore_com_google_api_client_util_store_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()

```java
public String toString()
```

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `String` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)