Skip to content

Commit

Permalink
[Storage] Bucket Lock (googleapis#3727)
Browse files Browse the repository at this point in the history
* [Storage] Replay GCS Bucket Lock (googleapis#3645)

* Add support for defaultEventBasedHold

* Add support for Blob eventBasedHold

* Add support for blob temporary holds

* Remove Beta launch annotations for CMEK

* Add support for lockRetentionPolicy and RetentionPolicy

* Update FakeStorageRPC

* codacy-bot review fix (final only)

* Update getRetentionPolicyIsLocked() -> retentionPolicyIsLocked() and misc.

* Address comments

* Address comments

* Address comments.

* Small nits

* Fix additional comments

* [Storage] Bucket lock samples and bug fixes. (googleapis#3709)

* Fix issue in tests, write bucket lock samples, and resolve issue in client library

* Update documentation around Boolean returns to clarify different return caes.

* Fix broken unit test

* Address feedback

* Fix typo in comments
  • Loading branch information
frankyn authored Sep 28, 2018
1 parent c79f280 commit bcb28f2
Show file tree
Hide file tree
Showing 19 changed files with 1,255 additions and 285 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* <li>createBatch
* <li>checksums, etags
* <li>IAM operations</li>
* <li>BucketLock operations</li>
* </ul>
* </ul>
*/
Expand Down Expand Up @@ -520,6 +521,11 @@ public Notification createNotification(String bucket, Notification notification)
throw new UnsupportedOperationException();
}

@Override
public Bucket lockRetentionPolicy(Bucket bucket, Map<Option, ?> options) {
throw new UnsupportedOperationException();
}

@Override
public ServiceAccount getServiceAccount(String projectId) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,30 @@ Builder setCustomerEncryption(CustomerEncryption customerEncryption) {
return this;
}

@GcpLaunchStage.Beta
@Override
Builder setKmsKeyName(String kmsKeyName) {
infoBuilder.setKmsKeyName(kmsKeyName);
return this;
}

@Override
public Builder setEventBasedHold(Boolean eventBasedHold) {
infoBuilder.setEventBasedHold(eventBasedHold);
return this;
}

@Override
public Builder setTemporaryHold(Boolean temporaryHold) {
infoBuilder.setTemporaryHold(temporaryHold);
return this;
}

@Override
Builder setRetentionExpirationTime(Long retentionExpirationTime) {
infoBuilder.setRetentionExpirationTime(retentionExpirationTime);
return this;
}

@Override
public Blob build() {
return new Blob(storage, infoBuilder);
Expand Down
Loading

0 comments on commit bcb28f2

Please sign in to comment.