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 subscribing to topics and receiving notifications on servlet-based platforms using
`jakarta.servlet` namespace.

## Classes

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

Beta   

Thread-safe Webhook Servlet to receive notifications using the `jakarta.servlet` namespace.

In order to use this servlet you should create a class inheriting from [NotificationServlet](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.extensions.servlet.notifications.jakarta.NotificationServlet.md.txt) and register the servlet in your web.xml.

It is a simple wrapper around [WebhookUtils#processWebhookNotification](https://docs.cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.extensions.servlet.notifications.WebhookUtils.md.txt#com_google_api_client_googleapis_extensions_servlet_notifications_WebhookUtils_processWebhookNotification_), so if you you
may alternatively call that method instead from your HttpServlet#doPost with no loss of
functionality. **Example usage:**

```java

 public class MyNotificationServlet extends NotificationServlet {

   private static final long serialVersionUID = 1L;

   public MyNotificationServlet() throws IOException {
     super(new SomeDataStoreFactory());
   }
 }
 
```

**Sample web.xml setup:**

```java

 {@literal <}servlet{@literal>}
 {@literal <}servlet-name{@literal>}MyNotificationServlet{@literal <} ervlet-name{@literal="">}
 {@literal <}servlet-class{@literal>}
     com.mypackage.MyNotificationServlet
 {@literal <} ervlet-class{@literal="">}
 {@literal <} ervlet{@literal="">}
 {@literal <}servlet-mapping{@literal>}
 {@literal <}servlet-name{@literal>}MyNotificationServlet{@literal <} ervlet-name{@literal="">}
 {@literal <}url-pattern{@literal>}/notifications{@literal <} rl-pattern{@literal="">}
 {@literal <} ervlet-mapping{@literal="">}
 
```

WARNING: by default it uses MemoryDataStoreFactory#getDefaultInstance() which means it
will NOT persist the notification channels when the servlet process dies, so it is a BAD CHOICE
for a production application. But it is a convenient choice when testing locally, in which case
you don't need to override it, and can simply reference it directly in your web.xml file. For
example:

```java

 {@literal <}servlet{@literal>}
 {@literal <}servlet-name{@literal>}NotificationServlet{@literal <} ervlet-name{@literal="">}
 {@literal <}servlet-class{@literal>}
     com.google.api.client.googleapis.extensions.servlet.notificationsNotificationServlet
 {@literal <} ervlet-class{@literal="">}
 {@literal <} ervlet{@literal="">}
 {@literal <}servlet-mapping{@literal>}
 {@literal <}servlet-name{@literal>}NotificationServlet{@literal <} ervlet-name{@literal="">}
 {@literal <}url-pattern{@literal>}/notifications{@literal <} rl-pattern{@literal="">}
 {@literal <} ervlet-mapping{@literal="">}
 
```

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

Beta   

Utilities for Webhook notifications using the `jakarta.servlet` namespace.