Package org.nuxeo.ecm.core.storage.sql
Class S3DirectBatchHandler
- java.lang.Object
-
- org.nuxeo.ecm.automation.server.jaxrs.batch.handler.AbstractBatchHandler
-
- org.nuxeo.ecm.core.storage.sql.S3DirectBatchHandler
-
- All Implemented Interfaces:
BatchHandler
public class S3DirectBatchHandler extends AbstractBatchHandler
Batch Handler allowing direct S3 upload.- Since:
- 10.1
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.automation.server.jaxrs.batch.handler.AbstractBatchHandler
BATCH_HANDLER_NAME, name, PROP_TRANSIENT_STORE_NAME, transientStoreName
-
-
Constructor Summary
Constructors Constructor Description S3DirectBatchHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.amazonaws.services.securitytoken.model.Credentials
assumeRole(com.amazonaws.services.securitytoken.model.AssumeRoleRequest request)
boolean
completeUpload(String batchId, String fileIndex, BatchFileInfo fileInfo)
Callback for the batch handler to execute post-upload actions.protected com.amazonaws.services.securitytoken.model.Credentials
getAwsCredentials(String batchId)
Batch
getBatch(String batchId)
Attempts to fetch a batch with the given id.protected BlobProvider
getBlobProvider()
static String
getCharset(String contentType)
static String
getMimeType(String contentType)
protected com.amazonaws.services.s3.transfer.TransferManager
getTransferManager()
protected void
initialize(Map<String,String> properties)
protected void
initializeBuilder(com.amazonaws.client.builder.AwsClientBuilder<?,?> builder, com.amazonaws.auth.AWSCredentialsProvider credentials)
protected com.amazonaws.services.s3.AmazonS3
initializeS3Client(com.amazonaws.auth.AWSCredentialsProvider credentials)
protected com.amazonaws.services.securitytoken.AWSSecurityTokenService
initializeSTSClient(com.amazonaws.auth.AWSCredentialsProvider credentials)
protected boolean
isValidDigest(String key)
protected void
move(String sourceKey, String destinationKey)
Map<String,Object>
refreshToken(String batchId)
Attempts to renew the credentials associated to this batch handler.-
Methods inherited from class org.nuxeo.ecm.automation.server.jaxrs.batch.handler.AbstractBatchHandler
generateBatchId, getBatchParameters, getName, getTransientStore, initialize, newBatch
-
-
-
-
Field Detail
-
ACCELERATE_MODE_ENABLED_PROPERTY
@Deprecated public static final String ACCELERATE_MODE_ENABLED_PROPERTY
Deprecated.since 11.1, useS3BinaryManager.ACCELERATE_MODE_PROPERTY
- See Also:
- Constant Field Values
-
POLICY_TEMPLATE_PROPERTY
public static final String POLICY_TEMPLATE_PROPERTY
- See Also:
- Constant Field Values
-
ROLE_ARN_PROPERTY
public static final String ROLE_ARN_PROPERTY
- Since:
- 10.10
- See Also:
- Constant Field Values
-
BLOB_PROVIDER_ID_PROPERTY
public static final String BLOB_PROVIDER_ID_PROPERTY
- Since:
- 11.1
- See Also:
- Constant Field Values
-
INFO_AWS_SECRET_KEY_ID
public static final String INFO_AWS_SECRET_KEY_ID
- See Also:
- Constant Field Values
-
INFO_AWS_SECRET_ACCESS_KEY
public static final String INFO_AWS_SECRET_ACCESS_KEY
- See Also:
- Constant Field Values
-
INFO_AWS_SESSION_TOKEN
public static final String INFO_AWS_SESSION_TOKEN
- See Also:
- Constant Field Values
-
INFO_BUCKET
public static final String INFO_BUCKET
- See Also:
- Constant Field Values
-
INFO_BASE_KEY
public static final String INFO_BASE_KEY
- See Also:
- Constant Field Values
-
INFO_EXPIRATION
public static final String INFO_EXPIRATION
- See Also:
- Constant Field Values
-
INFO_AWS_ENDPOINT
public static final String INFO_AWS_ENDPOINT
- Since:
- 11.1
- See Also:
- Constant Field Values
-
INFO_AWS_PATH_STYLE_ACCESS
public static final String INFO_AWS_PATH_STYLE_ACCESS
- Since:
- 11.1
- See Also:
- Constant Field Values
-
INFO_AWS_REGION
public static final String INFO_AWS_REGION
- See Also:
- Constant Field Values
-
INFO_USE_S3_ACCELERATE
public static final String INFO_USE_S3_ACCELERATE
- See Also:
- Constant Field Values
-
stsClient
protected com.amazonaws.services.securitytoken.AWSSecurityTokenService stsClient
-
amazonS3
protected com.amazonaws.services.s3.AmazonS3 amazonS3
-
endpoint
protected String endpoint
-
pathStyleAccessEnabled
protected boolean pathStyleAccessEnabled
-
region
protected String 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
-
-
Method Detail
-
initialize
protected void initialize(Map<String,String> properties)
- Overrides:
initialize
in classAbstractBatchHandler
-
initializeSTSClient
protected com.amazonaws.services.securitytoken.AWSSecurityTokenService initializeSTSClient(com.amazonaws.auth.AWSCredentialsProvider credentials)
-
initializeS3Client
protected com.amazonaws.services.s3.AmazonS3 initializeS3Client(com.amazonaws.auth.AWSCredentialsProvider credentials)
-
initializeBuilder
protected void initializeBuilder(com.amazonaws.client.builder.AwsClientBuilder<?,?> builder, com.amazonaws.auth.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 com.amazonaws.services.securitytoken.model.Credentials assumeRole(com.amazonaws.services.securitytoken.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 idfileIndex
- the file index within the batchfileInfo
- file information regarting the uploaded file- Returns:
true
if the action was success
-
isValidDigest
protected boolean isValidDigest(String key)
-
getBlobProvider
protected BlobProvider getBlobProvider()
-
getTransferManager
protected com.amazonaws.services.s3.transfer.TransferManager getTransferManager()
-
getAwsCredentials
protected com.amazonaws.services.securitytoken.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
-
-