Skip to content

Commit 7099cde

Browse files
author
Anirav Kareddy
committed
added enforceRotation support to builder for ReEncryptInstructionFileRequest
1 parent 7c015b2 commit 7099cde

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/software/amazon/encryption/s3/internal/ReEncryptInstructionFileRequest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ public class ReEncryptInstructionFileRequest {
1919
private final String key;
2020
private final RawKeyring newKeyring;
2121
private final String instructionFileSuffix;
22+
private final boolean enforceRotation;
2223

2324
private ReEncryptInstructionFileRequest(Builder builder) {
2425
bucket = builder.bucket;
2526
key = builder.key;
2627
newKeyring = builder.newKeyring;
2728
instructionFileSuffix = builder.instructionFileSuffix;
29+
enforceRotation = builder.enforceRotation;
2830
}
2931

3032
/**
@@ -56,6 +58,13 @@ public String instructionFileSuffix() {
5658
return instructionFileSuffix;
5759
}
5860

61+
/**
62+
* @return whether to enforce rotation for the re-encrypted instruction file
63+
*/
64+
public boolean enforceRotation() {
65+
return enforceRotation;
66+
}
67+
5968
/**
6069
* Creates a builder that can be used to configure and create a {@link ReEncryptInstructionFileRequest}
6170
*
@@ -74,6 +83,7 @@ public static class Builder {
7483
private String key;
7584
private RawKeyring newKeyring;
7685
private String instructionFileSuffix = DEFAULT_INSTRUCTION_FILE_SUFFIX;
86+
private boolean enforceRotation = false;
7787

7888
/**
7989
* Sets the S3 bucket name for the re-encryption of instruction file.
@@ -121,6 +131,17 @@ public Builder instructionFileSuffix(String instructionFileSuffix) {
121131
return this;
122132
}
123133

134+
/**
135+
* Sets whether to enforce rotation for the re-encrypted instruction file.
136+
*
137+
* @param enforceRotation whether to enforce rotation
138+
* @return a reference to this object so that method calls can be chained together.
139+
*/
140+
public Builder enforceRotation(boolean enforceRotation) {
141+
this.enforceRotation = enforceRotation;
142+
return this;
143+
}
144+
124145
/**
125146
* Validates and builds the ReEncryptInstructionFileRequest according
126147
* to the configuration options passed to the Builder object.

0 commit comments

Comments
 (0)