GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: expose the methods of Notifications by athakor · Pull Request #399 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.

feat: expose the methods of Notifications #399

Merged
sydney-munro merged 18 commits into googleapis:main from athakor:storage-notification-138
Mar 25, 2022

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat: expose the methods of Notifications #399

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9df0f93
feat: expose bucket notifications apis
athakor Jun 26, 2020
ce09c25
feat: expose bucket notifications apis
athakor Jun 29, 2020
8489ff2
feat: simplified the code and fixed the review changes
athakor Jul 2, 2020
9d0e8c4
feat: fix review changes
athakor Jul 6, 2020
cd3776f
feat: addressed review changes
athakor Jul 13, 2020
ec7c50c
feat: change javaDoc
athakor Jul 13, 2020
500e025
feat: addressed review changes
athakor Jul 14, 2020
0dbf979
feat: fix review changes
athakor Jul 14, 2020
915dca4
feat: addressed few nits
athakor Jul 15, 2020
2897b6b
feat: fix review changes
athakor Jul 15, 2020
45ae9d9
feat: fix minor changes and change the tests to provide better coverage
athakor Jul 15, 2020
296d5e5
feat: add more checks in test
athakor Jul 16, 2020
9723a54
feat: updated checks
athakor Jul 16, 2020
a4bdc42
feat: address the additional comments
athakor Jul 24, 2020
7cbda36
feat: addressed the nits
athakor Jul 27, 2020
50e77a8
feat: update test method name
athakor Jul 27, 2020
ea6fc35
Fix StorageImpl
sydney-munro Mar 18, 2022
9d97576
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Mar 18, 2022
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

25 changes: 25 additions & 0 deletions 25 google-cloud-storage/clirr-ignored-differences.xml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,29 @@
<method>BucketInfo$LifecycleRule$LifecycleAction()</method>
<differenceType>7004</differenceType>
</difference>
<difference>
<className>com/google/cloud/storage/Storage</className>
Comment thread

@elharo elharo Jul 18, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a major version bump.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@athakor athakor Jul 22, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a major version bump.

@frankyn what do you think about this??

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@frankyn frankyn Jul 22, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've done it for others and updated the README.md to reflect this quirk in updates of the Interface. We haven't hit customer issues with these interface changes.

We are going to move forward with similar changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
<method>*.Notification createNotification(*.String, *.NotificationInfo)</method>
<differenceType>7012</differenceType>
</difference>
<difference>
<className>com/google/cloud/storage/Storage</className>
<method>*.Notification getNotification(*.String, *.String)</method>
<differenceType>7012</differenceType>
</difference>
<difference>
<className>com/google/cloud/storage/Storage</className>
<method>java.util.List listNotifications(*.String)</method>
<differenceType>7012</differenceType>
</difference>
<difference>
<className>com/google/cloud/storage/Storage</className>
<method>boolean deleteNotification(*.String, *.String)</method>
<differenceType>7012</differenceType>
</difference>
<difference>
<className>com/google/cloud/storage/spi/v1/StorageRpc</className>
<method>*.model.Notification getNotification(*.String, *.String)</method>
<differenceType>7012</differenceType>
</difference>
</differences>
5 changes: 5 additions & 0 deletions 5 google-cloud-storage/pom.xml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
Expand Down
139 changes: 139 additions & 0 deletions 139 google-cloud-storage/src/main/java/com/google/cloud/storage/Notification.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.storage;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Map;
import java.util.Objects;

/**
* The class representing Pub/Sub notifications for the Storage. See <a
* href="https://cloud.google.com/storage/docs/pubsub-notifications">pubsub-notifications</a> for
* details.
*/
Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

public class Notification extends NotificationInfo {

private final StorageOptions options;
private transient Storage storage;

/** Builder for {@code Notification}. */
public static class Builder extends NotificationInfo.Builder {
private final Storage storage;
private final NotificationInfo.BuilderImpl infoBuilder;

Builder(Notification notification) {
Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

this.storage = notification.storage;
this.infoBuilder = new NotificationInfo.BuilderImpl(notification);
}

@Override
Builder setNotificationId(String notificationId) {
infoBuilder.setNotificationId(notificationId);
return this;
}
Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.


@Override
public Builder setSelfLink(String selfLink) {
infoBuilder.setSelfLink(selfLink);
return this;
}

@Override
public Builder setTopic(String topic) {
infoBuilder.setTopic(topic);
return this;
}
Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.


@Override
public Builder setPayloadFormat(PayloadFormat payloadFormat) {
infoBuilder.setPayloadFormat(payloadFormat);
return this;
}

@Override
public Builder setObjectNamePrefix(String objectNamePrefix) {
infoBuilder.setObjectNamePrefix(objectNamePrefix);
return this;
}

@Override
public Builder setEventTypes(EventType... eventTypes) {
infoBuilder.setEventTypes(eventTypes);
return this;
}
Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.


@Override
public Builder setEtag(String etag) {
infoBuilder.setEtag(etag);
return this;
}

@Override
public Builder setCustomAttributes(Map<String, String> customAttributes) {
infoBuilder.setCustomAttributes(customAttributes);
return this;
}

@Override
public Notification build() {
return new Notification(storage, infoBuilder);
}
}

Notification(Storage storage, NotificationInfo.BuilderImpl infoBuilder) {
Comment thread
athakor marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

super(infoBuilder);
this.storage = checkNotNull(storage);
this.options = storage.getOptions();
}

/** Returns the notification's {@code Storage} object used to issue requests. */
public Storage getStorage() {
return storage;
}

@Override
public Builder toBuilder() {
return new Notification.Builder(this);
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
Notification notification = (Notification) o;
return Objects.equals(toPb(), notification.toPb())
&& Objects.equals(options, notification.options);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), options, storage);
}

static Notification fromPb(
Storage storage, com.google.api.services.storage.model.Notification notificationPb) {
return new Notification(
storage, new NotificationInfo.BuilderImpl(NotificationInfo.fromPb(notificationPb)));
}
}
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.