Class S3Owner

java.lang.Object
org.apache.hadoop.ozone.s3.endpoint.S3Owner

public class S3Owner extends Object
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 Details

  • Constructor Details

    • S3Owner

      public S3Owner()
    • S3Owner

      public S3Owner(String id, String displayName)
  • Method Details

    • of

      public static S3Owner of(String displayName)
    • getDisplayName

      public String getDisplayName()
    • setDisplayName

      public void setDisplayName(String name)
    • getId

      public String getId()
    • setId

      public void setId(String id)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 headers
      bucketName - bucket name
      bucketOwner - 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 headers
      sourceBucketName - source bucket name
      sourceOwner - source bucket owner
      destBucketName - dest bucket name
      destOwner - destination bucket owner
      Throws:
      OS3Exception - if the expected source or destination bucket owner does not match