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 [com.google.api.client.util.Beta](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.Beta.md.txt)   

Support for notification channels to listen for changes to watched Google API resources.

## Classes

### [AbstractNotification](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.AbstractNotification.md.txt)

Beta   

Notification metadata sent to this client about a watched resource.

Implementation is not thread-safe.

### [NotificationUtils](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.NotificationUtils.md.txt)

Utilities for notifications and notification channels.

### [ResourceStates](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.ResourceStates.md.txt)

Beta   

Standard resource states used by notifications.

### [StoredChannel](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.StoredChannel.md.txt)

Beta   

Notification channel information to be stored in a data store.

Implementation is thread safe.

### [TypedNotification\<T\>](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.TypedNotification.md.txt)

Beta   

Notification metadata and parsed content sent to this client about a watched resource.

Implementation is not thread-safe.

### [TypedNotificationCallback\<T\>](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.TypedNotificationCallback.md.txt)

Beta   

Callback to receive notifications for watched resource in which the . Callback which is used to
receive typed [AbstractNotification](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.AbstractNotification.md.txt)s after subscribing to a topic.

Must NOT be implemented in form of an anonymous class as this will break serialization.

Implementation should be thread-safe. **Example usage:**

```java

 static class MyNotificationCallback
     extends JsonNotificationCallback{@literal <}listresponse{@literal>} {

   private static final long serialVersionUID = 1L;

   {@literal @}Override
   protected void onNotification
       (StoredChannel subscription, Notification notification, ListResponse content) {
     switch (notification.getResourceState()) {
       case ResourceStates.SYNC:
         break;
       case ResourceStates.EXISTS:
         break;
       case ResourceStates.NOT_EXISTS:
         break;
     }
   }

    {@literal @}Override
    protected ObjectParser getObjectParser(Notification notification) throws IOException {
      return new JsonObjectParser(new GsonFactory());
    }

    {@literal @}Override
    protected Class{@literal <}listresponse{@literal>} getDataClass() throws IOException {
      return ListResponse.class;
    }
 }
 
```

### [UnparsedNotification](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.UnparsedNotification.md.txt)

Beta   

Notification metadata and unparsed content stream sent to this client about a watched resource.

Implementation is not thread-safe.

## Interfaces

### [UnparsedNotificationCallback](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.notifications.UnparsedNotificationCallback.md.txt)

Beta   

Callback to receive unparsed notifications for watched resource.

Must NOT be implemented in form of an anonymous class since this would break serialization.

Should be thread-safe as several notifications might be processed at the same time. **Example
usage:**

```java

 static class MyNotificationCallback implements UnparsedNotificationCallback {

   private static final long serialVersionUID = 1L;

   {@literal @}Override
   public void onNotification(StoredChannel storedChannel, UnparsedNotification notification) {
     String contentType = notification.getContentType();
     InputStream contentStream = notification.getContentStream();
     switch (notification.getResourceState()) {
       case ResourceStates.SYNC:
         break;
       case ResourceStates.EXISTS:
         break;
       case ResourceStates.NOT_EXISTS:
         break;
     }
   }
 }
 
```