• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2017 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *       http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.cloud.notification;
18 
19 import com.google.api.core.BetaApi;
20 import com.google.cloud.storage.Storage;
21 import java.util.List;
22 
23 /**
24  * An interface for Pub/Sub Notifications in Google Cloud Storage.
25  *
26  * <p>This is a light wrapper around a Storage client.
27  *
28  * @see <a href="https://cloud.google.com/storage/docs/pubsub-notifications">Google Cloud Pub/Sub
29  *     Notifications for Storage</a>
30  */
31 public interface Notification {
32 
33   /* Create a Notifications client wrapper on top of a given a Storage client. */
create(Storage storage)34   Notification create(Storage storage);
35 
36   /* Delete the specified notification on the specified bucket.
37    *
38    * @return true if the notification was deleted, or false if not.
39    */
40   @BetaApi
deleteNotification(String bucket, String notification)41   boolean deleteNotification(String bucket, String notification);
42 
43   /* List the notifications that are present on a given bucket. */
44   @BetaApi
listNotifications(String bucket)45   List<NotificationInfo> listNotifications(String bucket);
46 
47   /* Create a notification on a bucket. */
48   @BetaApi
createNotification(String bucket, NotificationInfo notification)49   NotificationInfo createNotification(String bucket, NotificationInfo notification);
50 }
51