Class S3Owner
java.lang.Object
org.apache.hadoop.ozone.s3.endpoint.S3Owner
Represents an owner of S3 resources in the Ozone S3 compatibility layer.
This class models the Owner XML element in S3 responses, containing both a unique ID
and a display name for the owner of buckets and objects.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()static booleanhasBucketOwnershipVerificationConditions(javax.ws.rs.core.HttpHeaders headers) Checks whether the HTTP headers contain a bucket ownership verification conditions, specifically if either the `expected-bucket-owner` or `expected-source-bucket-owner` header is present and not empty.static S3OwnervoidsetDisplayName(String name) voidtoString()static voidverifyBucketOwnerCondition(javax.ws.rs.core.HttpHeaders headers, String bucketName, String bucketOwner) Verify the bucket owner condition.static voidverifyBucketOwnerConditionOnCopyOperation(javax.ws.rs.core.HttpHeaders headers, String sourceBucketName, String sourceOwner, String destBucketName, String destOwner) Verify the bucket owner condition on copy operation.
-
Field Details
-
DEFAULT_S3OWNER_ID
- See Also:
-
DEFAULT_S3_OWNER
-
-
Constructor Details
-
S3Owner
public S3Owner() -
S3Owner
-
-
Method Details
-
of
-
getDisplayName
-
setDisplayName
-
getId
-
setId
-
toString
-
hasBucketOwnershipVerificationConditions
public static boolean hasBucketOwnershipVerificationConditions(javax.ws.rs.core.HttpHeaders headers) Checks whether the HTTP headers contain a bucket ownership verification conditions, specifically if either the `expected-bucket-owner` or `expected-source-bucket-owner` header is present and not empty.- Parameters:
headers- the HTTP headers to check- Returns:
- true if either bucket ownership verification condition header is present and not empty, false otherwise
-
verifyBucketOwnerCondition
public static void verifyBucketOwnerCondition(javax.ws.rs.core.HttpHeaders headers, String bucketName, String bucketOwner) throws OS3Exception Verify the bucket owner condition.- Parameters:
headers- HTTP headersbucketName- bucket namebucketOwner- bucket owner- Throws:
OS3Exception- if the expected bucket owner does not match
-
verifyBucketOwnerConditionOnCopyOperation
public static void verifyBucketOwnerConditionOnCopyOperation(javax.ws.rs.core.HttpHeaders headers, String sourceBucketName, String sourceOwner, String destBucketName, String destOwner) throws OS3Exception Verify the bucket owner condition on copy operation.- Parameters:
headers- HTTP headerssourceBucketName- source bucket namesourceOwner- source bucket ownerdestBucketName- dest bucket namedestOwner- destination bucket owner- Throws:
OS3Exception- if the expected source or destination bucket owner does not match
-