Class S3DirectBatchHandler

All Implemented Interfaces:
BatchHandler

public class S3DirectBatchHandler extends AbstractBatchHandler
Batch Handler allowing direct S3 upload.
Since:
10.1
  • Field Details

    • POLICY_TEMPLATE_PROPERTY

      public static final String POLICY_TEMPLATE_PROPERTY
      See Also:
    • ROLE_ARN_PROPERTY

      public static final String ROLE_ARN_PROPERTY
      Since:
      10.10
      See Also:
    • BLOB_PROVIDER_ID_PROPERTY

      public static final String BLOB_PROVIDER_ID_PROPERTY
      Since:
      11.1
      See Also:
    • INFO_AWS_SECRET_KEY_ID

      public static final String INFO_AWS_SECRET_KEY_ID
      See Also:
    • INFO_AWS_SECRET_ACCESS_KEY

      public static final String INFO_AWS_SECRET_ACCESS_KEY
      See Also:
    • INFO_AWS_SESSION_TOKEN

      public static final String INFO_AWS_SESSION_TOKEN
      See Also:
    • INFO_BUCKET

      public static final String INFO_BUCKET
      See Also:
    • INFO_BASE_KEY

      public static final String INFO_BASE_KEY
      See Also:
    • INFO_EXPIRATION

      public static final String INFO_EXPIRATION
      See Also:
    • INFO_AWS_ENDPOINT

      public static final String INFO_AWS_ENDPOINT
      Since:
      11.1
      See Also:
    • INFO_AWS_PATH_STYLE_ACCESS

      public static final String INFO_AWS_PATH_STYLE_ACCESS
      Since:
      11.1
      See Also:
    • INFO_AWS_REGION

      public static final String INFO_AWS_REGION
      See Also:
    • INFO_USE_S3_ACCELERATE

      public static final String INFO_USE_S3_ACCELERATE
      See Also:
    • stsClient

      protected software.amazon.awssdk.services.sts.StsClient stsClient
    • amazonS3

      protected software.amazon.awssdk.services.s3.S3Client amazonS3
    • endpointOverride

      protected URI endpointOverride
    • pathStyleAccessEnabled

      protected boolean pathStyleAccessEnabled
    • region

      protected software.amazon.awssdk.regions.Region region
    • bucket

      protected String bucket
    • bucketPrefix

      protected String bucketPrefix
    • accelerateModeEnabled

      protected boolean accelerateModeEnabled
    • expiration

      protected int expiration
    • policy

      protected String policy
    • roleArn

      protected String roleArn
    • useServerSideEncryption

      protected boolean useServerSideEncryption
    • serverSideKMSKeyID

      protected String serverSideKMSKeyID
    • blobProviderId

      public String blobProviderId
  • Constructor Details

    • S3DirectBatchHandler

      public S3DirectBatchHandler()
  • Method Details

    • getMimeType

      public static String getMimeType(String contentType)
      Since:
      11.5
    • getCharset

      public static String getCharset(String contentType)
      Since:
      11.5
    • initialize

      protected void initialize(Map<String,String> properties)
      Overrides:
      initialize in class AbstractBatchHandler
    • initializeSTSClient

      protected software.amazon.awssdk.services.sts.StsClient initializeSTSClient(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentials)
    • initializeS3Client

      protected software.amazon.awssdk.services.s3.S3Client initializeS3Client(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentials)
    • getBatch

      public Batch getBatch(String batchId)
      Description copied from interface: BatchHandler
      Attempts to fetch a batch with the given id.
      Parameters:
      batchId - the batch id to fetch
      Returns:
      the batch with the given id, or null if not found
    • assumeRole

      protected software.amazon.awssdk.services.sts.model.Credentials assumeRole(software.amazon.awssdk.services.sts.model.AssumeRoleRequest request)
    • completeUpload

      public boolean completeUpload(String batchId, String fileIndex, BatchFileInfo fileInfo)
      Description copied from interface: BatchHandler
      Callback for the batch handler to execute post-upload actions. This is only typically used in third-party batch handlers.
      Parameters:
      batchId - the batch id
      fileIndex - the file index within the batch
      fileInfo - file information regarting the uploaded file
      Returns:
      true if the action was success
    • move

      protected void move(String sourceKey, String destinationKey)
    • isValidDigest

      protected boolean isValidDigest(String key)
    • getBlobProvider

      protected BlobProvider getBlobProvider()
    • getTransferManager

      protected software.amazon.awssdk.transfer.s3.S3TransferManager getTransferManager()
    • getAwsCredentials

      protected software.amazon.awssdk.services.sts.model.Credentials getAwsCredentials(String batchId)
    • refreshToken

      public Map<String,Object> refreshToken(String batchId)
      Description copied from interface: BatchHandler
      Attempts to renew the credentials associated to this batch handler. This is only typically used in third-party batch handlers.
      Parameters:
      batchId - the batch id
      Returns:
      the new credentials
      Since:
      11.1