Skip to content

Commit fbf134d

Browse files
authored
---
yaml --- r: 8509 b: refs/heads/master c: 40b0da8 h: refs/heads/master i: 8507: 5802314
1 parent d35bd7d commit fbf134d

18 files changed

Lines changed: 1275 additions & 2 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ab102630bb3db277a0810c44b05100114e128e44
2+
refs/heads/master: 40b0da87d50d9d6e996d50dd158f686ba656f6c8
33
refs/heads/travis: 47e4fee4fd5af9b2a8ce46f23c72ec95f9b195b2
44
refs/heads/gh-pages: 3e16a39145437096333db5811e5c0292719c1823
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

trunk/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/FakeStorageRpc.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919
import com.google.api.services.storage.model.Bucket;
2020
import com.google.api.services.storage.model.BucketAccessControl;
21+
import com.google.api.services.storage.model.Notification;
2122
import com.google.api.services.storage.model.ObjectAccessControl;
2223
import com.google.api.services.storage.model.Policy;
24+
import com.google.api.services.storage.model.ServiceAccount;
2325
import com.google.api.services.storage.model.StorageObject;
2426
import com.google.api.services.storage.model.TestIamPermissionsResponse;
2527
import com.google.cloud.Tuple;
@@ -462,4 +464,24 @@ public Policy setIamPolicy(String bucket, Policy policy, Map<Option, ?> options)
462464
public TestIamPermissionsResponse testIamPermissions(String bucket, List<String> permissions, Map<Option, ?> options) {
463465
throw new UnsupportedOperationException();
464466
}
467+
468+
@Override
469+
public boolean deleteNotification(String bucket, String notification) {
470+
throw new UnsupportedOperationException();
471+
}
472+
473+
@Override
474+
public List<Notification> listNotifications(String bucket) {
475+
throw new UnsupportedOperationException();
476+
}
477+
478+
@Override
479+
public Notification createNotification(String bucket, Notification notification) {
480+
throw new UnsupportedOperationException();
481+
}
482+
483+
@Override
484+
public ServiceAccount getServiceAccount(String projectId) {
485+
return null;
486+
}
465487
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
Google Cloud Java Client for Cloud Pub/Sub Notifications
2+
=================================
3+
4+
5+
- [Product Documentation](https://cloud.google.com/storage/docs/pubsub-notifications)
6+
- [Client Library Documentation](https://googlecloudplatform.github.io/google-cloud-java/latest/apidocs/index.html?com/google/cloud/notification/package-summary.html)
7+
8+
Quickstart
9+
----------
10+
If you are using Maven, add this to your pom.xml file
11+
```xml
12+
<dependency>
13+
<groupId>com.google.cloud</groupId>
14+
<artifactId>google-cloud-notification</artifactId>
15+
<version>0.30.0-alpha</version>
16+
</dependency>
17+
```
18+
If you are using Gradle, add this to your dependencies
19+
```Groovy
20+
compile 'com.google.cloud:google-cloud-notification:0.30.0-alpha'
21+
```
22+
If you are using SBT, add this to your dependencies
23+
```Scala
24+
libraryDependencies += "com.google.cloud" % "google-cloud-notification" % "0.30.0-alpha"
25+
```
26+
27+
Authentication
28+
--------------
29+
30+
See the
31+
[Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication)
32+
section in the base directory's README.
33+
34+
About Google Cloud Pub/Sub Notifications
35+
----------------------------
36+
37+
Cloud Pub/Sub Notifications sends information about changes to objects in your buckets to Google Cloud Pub/Sub, where the information is added to a Cloud Pub/Sub topic of your choice in the form of messages. For example, you can track objects that are created and deleted in your bucket. Each notification contains information describing both the event that triggered it and the object that changed.
38+
39+
Troubleshooting
40+
---------------
41+
42+
To get help, follow the instructions in the [shared Troubleshooting document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/troubleshooting/readme.md#troubleshooting).
43+
44+
Java Versions
45+
-------------
46+
47+
Java 7 or above is required for using this client.
48+
49+
Versioning
50+
----------
51+
52+
This library follows [Semantic Versioning](http://semver.org/).
53+
54+
It is currently in major version zero (``0.y.z``), which means that anything
55+
may change at any time and the public API should not be considered
56+
stable.
57+
58+
Contributing
59+
------------
60+
61+
Contributions to this library are always welcome and highly encouraged.
62+
63+
See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started.
64+
65+
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information.
66+
67+
License
68+
-------
69+
70+
Apache 2.0 - See [LICENSE] for more information.
71+
72+
73+
[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CONTRIBUTING.md
74+
[code-of-conduct]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct
75+
[LICENSE]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/LICENSE
76+
[cloud-platform]: https://cloud.google.com/
77+
[developers-console]:https://console.developers.google.com/
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<?xml version="1.0"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<artifactId>google-cloud-notification</artifactId>
7+
<version>0.30.1-alpha-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
<name>Google Cloud Pub/Sub Notifications for Google Cloud Storage</name>
10+
<url>https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-notification
11+
</url>
12+
<description>
13+
Java idiomatic client for Google Cloud Notification.
14+
</description>
15+
<parent>
16+
<groupId>com.google.cloud</groupId>
17+
<artifactId>google-cloud-pom</artifactId>
18+
<version>0.30.1-alpha-SNAPSHOT</version>
19+
</parent>
20+
<properties>
21+
<site.installationModule>google-cloud-notification</site.installationModule>
22+
<artifact.version>${project.version}</artifact.version>
23+
</properties>
24+
<dependencies>
25+
<dependency>
26+
<groupId>io.netty</groupId>
27+
<artifactId>netty-tcnative-boringssl-static</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>${project.groupId}</groupId>
31+
<artifactId>google-cloud-core</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>${project.groupId}</groupId>
35+
<artifactId>google-cloud-storage</artifactId>
36+
</dependency>
37+
<dependency>
38+
<groupId>${project.groupId}</groupId>
39+
<artifactId>google-cloud-pubsub</artifactId>
40+
</dependency>
41+
<dependency>
42+
<groupId>${project.groupId}</groupId>
43+
<artifactId>google-cloud-core-grpc</artifactId>
44+
</dependency>
45+
<dependency>
46+
<groupId>com.google.api</groupId>
47+
<artifactId>gax-grpc</artifactId>
48+
</dependency>
49+
<dependency>
50+
<groupId>com.google.api</groupId>
51+
<artifactId>api-common</artifactId>
52+
</dependency>
53+
<dependency>
54+
<groupId>com.google.api.grpc</groupId>
55+
<artifactId>proto-google-cloud-pubsub-v1</artifactId>
56+
</dependency>
57+
<dependency>
58+
<groupId>com.google.api.grpc</groupId>
59+
<artifactId>grpc-google-cloud-pubsub-v1</artifactId>
60+
<scope>test</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>io.grpc</groupId>
64+
<artifactId>grpc-netty</artifactId>
65+
</dependency>
66+
<dependency>
67+
<groupId>io.grpc</groupId>
68+
<artifactId>grpc-stub</artifactId>
69+
</dependency>
70+
<dependency>
71+
<groupId>io.grpc</groupId>
72+
<artifactId>grpc-auth</artifactId>
73+
</dependency>
74+
<dependency>
75+
<groupId>${project.groupId}</groupId>
76+
<artifactId>google-cloud-core</artifactId>
77+
<type>test-jar</type>
78+
<scope>test</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>junit</groupId>
82+
<artifactId>junit</artifactId>
83+
<scope>test</scope>
84+
</dependency>
85+
<dependency>
86+
<groupId>org.mockito</groupId>
87+
<artifactId>mockito-all</artifactId>
88+
<version>1.9.5</version>
89+
<scope>test</scope>
90+
</dependency>
91+
</dependencies>
92+
<profiles>
93+
<profile>
94+
<id>doclint-java8-disable</id>
95+
<activation>
96+
<jdk>[1.8,)</jdk>
97+
</activation>
98+
<properties>
99+
<!-- add this to disable checking -->
100+
<javadoc.opts>-Xdoclint:none</javadoc.opts>
101+
</properties>
102+
</profile>
103+
</profiles>
104+
<build>
105+
<resources>
106+
<resource>
107+
<directory>./..</directory>
108+
<filtering>true</filtering>
109+
<includes>
110+
<include>project.properties</include>
111+
</includes>
112+
</resource>
113+
</resources>
114+
<plugins>
115+
<plugin>
116+
<artifactId>maven-antrun-plugin</artifactId>
117+
<version>1.4</version>
118+
<executions>
119+
<execution>
120+
<phase>process-resources</phase>
121+
<configuration>
122+
<tasks>
123+
<copy file="${project.build.outputDirectory}/project.properties"
124+
toFile="${project.build.outputDirectory}/com/google/cloud/notification/project.properties"
125+
overwrite="true" />
126+
</tasks>
127+
</configuration>
128+
<goals>
129+
<goal>run</goal>
130+
</goals>
131+
</execution>
132+
</executions>
133+
</plugin>
134+
<plugin>
135+
<groupId>org.codehaus.mojo</groupId>
136+
<artifactId>properties-maven-plugin</artifactId>
137+
<version>1.0-alpha-2</version>
138+
<executions>
139+
<execution>
140+
<phase>generate-resources</phase>
141+
<goals>
142+
<goal>write-project-properties</goal>
143+
</goals>
144+
<configuration>
145+
<outputFile>${project.build.outputDirectory}/project.properties</outputFile>
146+
</configuration>
147+
</execution>
148+
</executions>
149+
</plugin>
150+
<plugin>
151+
<groupId>org.codehaus.mojo</groupId>
152+
<artifactId>build-helper-maven-plugin</artifactId>
153+
<version>1.9.1</version>
154+
<executions>
155+
<execution>
156+
<phase>generate-sources</phase>
157+
<goals>
158+
<goal>add-source</goal>
159+
</goals>
160+
<configuration>
161+
<sources>
162+
<source>generated/src/main/java</source>
163+
</sources>
164+
</configuration>
165+
</execution>
166+
</executions>
167+
</plugin>
168+
<plugin>
169+
<groupId>org.apache.maven.plugins</groupId>
170+
<artifactId>maven-javadoc-plugin</artifactId>
171+
<version>2.10.3</version>
172+
<executions>
173+
<execution>
174+
<id>attach-javadocs</id>
175+
<goals>
176+
<goal>jar</goal>
177+
</goals>
178+
<configuration>
179+
<additionalparam>${javadoc.opts}</additionalparam>
180+
</configuration>
181+
</execution>
182+
</executions>
183+
</plugin>
184+
<plugin>
185+
<artifactId>maven-compiler-plugin</artifactId>
186+
<version>3.5.1</version>
187+
<configuration>
188+
<source>1.7</source>
189+
<target>1.7</target>
190+
<encoding>UTF-8</encoding>
191+
<compilerArgument>-Xlint:unchecked</compilerArgument>
192+
</configuration>
193+
</plugin>
194+
</plugins>
195+
</build>
196+
</project>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2017 Google Inc. All Rights Reserved.
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. */
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
41+
boolean deleteNotification(String bucket, String notification);
42+
43+
/* List the notifications that are present on a given bucket. */
44+
@BetaApi
45+
List<NotificationInfo> listNotifications(String bucket);
46+
47+
/* Create a notification on a bucket. */
48+
@BetaApi
49+
NotificationInfo createNotification(String bucket, NotificationInfo notification);
50+
}

0 commit comments

Comments
 (0)