Class AWS2S3Configuration
- java.lang.Object
-
- org.apache.camel.component.aws2.s3.AWS2S3Configuration
-
-
Constructor Summary
Constructors Constructor Description AWS2S3Configuration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AWS2S3Configuration
copy()
String
getAccessKey()
software.amazon.awssdk.services.s3.S3Client
getAmazonS3Client()
software.amazon.awssdk.services.s3.presigner.S3Presigner
getAmazonS3Presigner()
String
getAwsKMSKeyId()
int
getBatchMessageNumber()
int
getBatchSize()
String
getBucketName()
String
getCustomerAlgorithm()
String
getCustomerKeyId()
String
getCustomerKeyMD5()
String
getDelimiter()
String
getDestinationBucket()
String
getDestinationBucketPrefix()
String
getDestinationBucketSuffix()
String
getDoneFileName()
String
getFileName()
String
getKeyName()
AWSS3NamingStrategyEnum
getNamingStrategy()
AWS2S3Operations
getOperation()
long
getPartSize()
String
getPolicy()
String
getPrefix()
String
getProxyHost()
Integer
getProxyPort()
software.amazon.awssdk.core.Protocol
getProxyProtocol()
String
getRegion()
AWSS3RestartingPolicyEnum
getRestartingPolicy()
String
getSecretKey()
String
getStorageClass()
long
getStreamingUploadTimeout()
String
getUriEndpointOverride()
boolean
isAutocloseBody()
boolean
isAutoCreateBucket()
boolean
isDeleteAfterRead()
boolean
isDeleteAfterWrite()
boolean
isIgnoreBody()
If it is true, the S3 Object Body will be ignored completely, if it is set to false the S3 Object will be put in the body.boolean
isIncludeBody()
boolean
isIncludeFolders()
boolean
isMoveAfterRead()
boolean
isMultiPartUpload()
boolean
isOverrideEndpoint()
boolean
isPojoRequest()
boolean
isStreamingUploadMode()
boolean
isTrustAllCertificates()
boolean
isUseAwsKMS()
boolean
isUseCustomerKey()
Boolean
isUseDefaultCredentialsProvider()
boolean
isUseSSES3()
void
setAccessKey(String accessKey)
Amazon AWS Access Keyvoid
setAmazonS3Client(software.amazon.awssdk.services.s3.S3Client amazonS3Client)
Reference to a `com.amazonaws.services.s3.AmazonS3` in the registry.void
setAmazonS3Presigner(software.amazon.awssdk.services.s3.presigner.S3Presigner amazonS3Presigner)
An S3 Presigner for Request, used mainly in createDownloadLink operationvoid
setAutocloseBody(boolean autocloseBody)
If this option is true and includeBody is false, then the S3Object.close() method will be called on exchange completion.void
setAutoCreateBucket(boolean autoCreateBucket)
Setting the autocreation of the S3 bucket bucketName.void
setAwsKMSKeyId(String awsKMSKeyId)
Define the id of KMS key to use in case KMS is enabledvoid
setBatchMessageNumber(int batchMessageNumber)
The number of messages composing a batch in streaming upload modevoid
setBatchSize(int batchSize)
The batch size (in bytes) in streaming upload modevoid
setBucketName(String bucketName)
Name of the bucket.void
setCustomerAlgorithm(String customerAlgorithm)
Define the customer algorithm to use in case CustomerKey is enabledvoid
setCustomerKeyId(String customerKeyId)
Define the id of Customer key to use in case CustomerKey is enabledvoid
setCustomerKeyMD5(String customerKeyMD5)
Define the MD5 of Customer key to use in case CustomerKey is enabledvoid
setDeleteAfterRead(boolean deleteAfterRead)
Delete objects from S3 after they have been retrieved.void
setDeleteAfterWrite(boolean deleteAfterWrite)
Delete file object after the S3 file has been uploadedvoid
setDelimiter(String delimiter)
The delimiter which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.void
setDestinationBucket(String destinationBucket)
Define the destination bucket where an object must be moved when moveAfterRead is set to true.void
setDestinationBucketPrefix(String destinationBucketPrefix)
Define the destination bucket prefix to use when an object must be moved and moveAfterRead is set to true.void
setDestinationBucketSuffix(String destinationBucketSuffix)
Define the destination bucket suffix to use when an object must be moved and moveAfterRead is set to true.void
setDoneFileName(String doneFileName)
If provided, Camel will only consume files if a done file exists.void
setFileName(String fileName)
To get the object from the bucket with the given file namevoid
setIgnoreBody(boolean ignoreBody)
void
setIncludeBody(boolean includeBody)
If it is true, the S3Object exchange will be consumed and put into the body and closed.void
setIncludeFolders(boolean includeFolders)
If it is true, the folders/directories will be consumed.void
setKeyName(String keyName)
Setting the key name for an element in the bucket through endpoint parametervoid
setMoveAfterRead(boolean moveAfterRead)
Move objects from S3 bucket to a different bucket after they have been retrieved.void
setMultiPartUpload(boolean multiPartUpload)
If it is true, camel will upload the file with multi part format, the part size is decided by the option of `partSize`void
setNamingStrategy(AWSS3NamingStrategyEnum namingStrategy)
The naming strategy to use in streaming upload modevoid
setOperation(AWS2S3Operations operation)
The operation to do in case the user don't want to do only an uploadvoid
setOverrideEndpoint(boolean overrideEndpoint)
Set the need for overidding the endpoint.void
setPartSize(long partSize)
Setup the partSize which is used in multi part upload, the default size is 25M.void
setPojoRequest(boolean pojoRequest)
If we want to use a POJO request as body or notvoid
setPolicy(String policy)
The policy for this queue to set in the `com.amazonaws.services.s3.AmazonS3#setBucketPolicy()` method.void
setPrefix(String prefix)
The prefix which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.void
setProxyHost(String proxyHost)
To define a proxy host when instantiating the SQS clientvoid
setProxyPort(Integer proxyPort)
Specify a proxy port to be used inside the client definition.void
setProxyProtocol(software.amazon.awssdk.core.Protocol proxyProtocol)
To define a proxy protocol when instantiating the S3 clientvoid
setRegion(String region)
The region in which S3 client needs to work.void
setRestartingPolicy(AWSS3RestartingPolicyEnum restartingPolicy)
The restarting policy to use in streaming upload modevoid
setSecretKey(String secretKey)
Amazon AWS Secret Keyvoid
setStorageClass(String storageClass)
The storage class to set in the `com.amazonaws.services.s3.model.PutObjectRequest` request.void
setStreamingUploadMode(boolean streamingUploadMode)
When stream mode is true the upload to bucket will be done in streamingvoid
setStreamingUploadTimeout(long streamingUploadTimeout)
While streaming upload mode is true, this option set the timeout to complete uploadvoid
setTrustAllCertificates(boolean trustAllCertificates)
If we want to trust all certificates in case of overriding the endpointvoid
setUriEndpointOverride(String uriEndpointOverride)
Set the overriding uri endpoint.void
setUseAwsKMS(boolean useAwsKMS)
Define if KMS must be used or notvoid
setUseCustomerKey(boolean useCustomerKey)
Define if Customer Key must be used or notvoid
setUseDefaultCredentialsProvider(Boolean useDefaultCredentialsProvider)
Set whether the S3 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.void
setUseSSES3(boolean useSSES3)
Define if SSE S3 must be used or not
-
-
-
Method Detail
-
getPartSize
public long getPartSize()
-
setPartSize
public void setPartSize(long partSize)
Setup the partSize which is used in multi part upload, the default size is 25M.
-
isMultiPartUpload
public boolean isMultiPartUpload()
-
setMultiPartUpload
public void setMultiPartUpload(boolean multiPartUpload)
If it is true, camel will upload the file with multi part format, the part size is decided by the option of `partSize`
-
getAccessKey
public String getAccessKey()
-
setAccessKey
public void setAccessKey(String accessKey)
Amazon AWS Access Key
-
getSecretKey
public String getSecretKey()
-
setSecretKey
public void setSecretKey(String secretKey)
Amazon AWS Secret Key
-
getAmazonS3Client
public software.amazon.awssdk.services.s3.S3Client getAmazonS3Client()
-
setAmazonS3Client
public void setAmazonS3Client(software.amazon.awssdk.services.s3.S3Client amazonS3Client)
Reference to a `com.amazonaws.services.s3.AmazonS3` in the registry.
-
getPrefix
public String getPrefix()
-
setPrefix
public void setPrefix(String prefix)
The prefix which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.
-
getDelimiter
public String getDelimiter()
-
setDelimiter
public void setDelimiter(String delimiter)
The delimiter which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.
-
getDoneFileName
public String getDoneFileName()
-
setDoneFileName
public void setDoneFileName(String doneFileName)
If provided, Camel will only consume files if a done file exists.
-
setIncludeFolders
public void setIncludeFolders(boolean includeFolders)
If it is true, the folders/directories will be consumed. If it is false, they will be ignored, and Exchanges will not be created for those
-
isIncludeFolders
public boolean isIncludeFolders()
-
getBucketName
public String getBucketName()
-
setBucketName
public void setBucketName(String bucketName)
Name of the bucket. The bucket will be created if it doesn't already exists.
-
getFileName
public String getFileName()
-
setFileName
public void setFileName(String fileName)
To get the object from the bucket with the given file name
-
getRegion
public String getRegion()
-
setRegion
public void setRegion(String region)
The region in which S3 client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id()
-
setIncludeBody
public void setIncludeBody(boolean includeBody)
If it is true, the S3Object exchange will be consumed and put into the body and closed. If false the S3Object stream will be put raw into the body and the headers will be set with the S3 object metadata. This option is strongly related to autocloseBody option. In case of setting includeBody to true because the S3Object stream will be consumed then it will also be closed, while in case of includeBody false then it will be up to the caller to close the S3Object stream. However setting autocloseBody to true when includeBody is false it will schedule to close the S3Object stream automatically on exchange completion.
-
isIncludeBody
public boolean isIncludeBody()
-
isIgnoreBody
public boolean isIgnoreBody()
If it is true, the S3 Object Body will be ignored completely, if it is set to false the S3 Object will be put in the body. Setting this to true, will override any behavior defined by includeBody option.
-
setIgnoreBody
public void setIgnoreBody(boolean ignoreBody)
-
isDeleteAfterRead
public boolean isDeleteAfterRead()
-
setDeleteAfterRead
public void setDeleteAfterRead(boolean deleteAfterRead)
Delete objects from S3 after they have been retrieved. The delete is only performed if the Exchange is committed. If a rollback occurs, the object is not deleted. If this option is false, then the same objects will be retrieve over and over again on the polls. Therefore you need to use the Idempotent Consumer EIP in the route to filter out duplicates. You can filter using theAWS2S3Constants.BUCKET_NAME
andAWS2S3Constants.KEY
headers, or only theAWS2S3Constants.KEY
header.
-
isMoveAfterRead
public boolean isMoveAfterRead()
-
setMoveAfterRead
public void setMoveAfterRead(boolean moveAfterRead)
Move objects from S3 bucket to a different bucket after they have been retrieved. To accomplish the operation the destinationBucket option must be set. The copy bucket operation is only performed if the Exchange is committed. If a rollback occurs, the object is not moved.
-
getDestinationBucket
public String getDestinationBucket()
-
setDestinationBucket
public void setDestinationBucket(String destinationBucket)
Define the destination bucket where an object must be moved when moveAfterRead is set to true.
-
getDestinationBucketPrefix
public String getDestinationBucketPrefix()
-
setDestinationBucketPrefix
public void setDestinationBucketPrefix(String destinationBucketPrefix)
Define the destination bucket prefix to use when an object must be moved and moveAfterRead is set to true.
-
getDestinationBucketSuffix
public String getDestinationBucketSuffix()
-
setDestinationBucketSuffix
public void setDestinationBucketSuffix(String destinationBucketSuffix)
Define the destination bucket suffix to use when an object must be moved and moveAfterRead is set to true.
-
isDeleteAfterWrite
public boolean isDeleteAfterWrite()
-
setDeleteAfterWrite
public void setDeleteAfterWrite(boolean deleteAfterWrite)
Delete file object after the S3 file has been uploaded
-
getPolicy
public String getPolicy()
-
setPolicy
public void setPolicy(String policy)
The policy for this queue to set in the `com.amazonaws.services.s3.AmazonS3#setBucketPolicy()` method.
-
getStorageClass
public String getStorageClass()
-
setStorageClass
public void setStorageClass(String storageClass)
The storage class to set in the `com.amazonaws.services.s3.model.PutObjectRequest` request.
-
getProxyProtocol
public software.amazon.awssdk.core.Protocol getProxyProtocol()
-
setProxyProtocol
public void setProxyProtocol(software.amazon.awssdk.core.Protocol proxyProtocol)
To define a proxy protocol when instantiating the S3 client
-
getProxyHost
public String getProxyHost()
-
setProxyHost
public void setProxyHost(String proxyHost)
To define a proxy host when instantiating the SQS client
-
getProxyPort
public Integer getProxyPort()
-
setProxyPort
public void setProxyPort(Integer proxyPort)
Specify a proxy port to be used inside the client definition.
-
getOperation
public AWS2S3Operations getOperation()
-
setOperation
public void setOperation(AWS2S3Operations operation)
The operation to do in case the user don't want to do only an upload
-
isAutocloseBody
public boolean isAutocloseBody()
-
setAutocloseBody
public void setAutocloseBody(boolean autocloseBody)
If this option is true and includeBody is false, then the S3Object.close() method will be called on exchange completion. This option is strongly related to includeBody option. In case of setting includeBody to false and autocloseBody to false, it will be up to the caller to close the S3Object stream. Setting autocloseBody to true, will close the S3Object stream automatically.
-
isUseAwsKMS
public boolean isUseAwsKMS()
-
setUseAwsKMS
public void setUseAwsKMS(boolean useAwsKMS)
Define if KMS must be used or not
-
getAwsKMSKeyId
public String getAwsKMSKeyId()
-
setAwsKMSKeyId
public void setAwsKMSKeyId(String awsKMSKeyId)
Define the id of KMS key to use in case KMS is enabled
-
isUseCustomerKey
public boolean isUseCustomerKey()
-
setUseCustomerKey
public void setUseCustomerKey(boolean useCustomerKey)
Define if Customer Key must be used or not
-
getCustomerKeyId
public String getCustomerKeyId()
-
setCustomerKeyId
public void setCustomerKeyId(String customerKeyId)
Define the id of Customer key to use in case CustomerKey is enabled
-
getCustomerKeyMD5
public String getCustomerKeyMD5()
-
setCustomerKeyMD5
public void setCustomerKeyMD5(String customerKeyMD5)
Define the MD5 of Customer key to use in case CustomerKey is enabled
-
getCustomerAlgorithm
public String getCustomerAlgorithm()
-
setCustomerAlgorithm
public void setCustomerAlgorithm(String customerAlgorithm)
Define the customer algorithm to use in case CustomerKey is enabled
-
setUseDefaultCredentialsProvider
public void setUseDefaultCredentialsProvider(Boolean useDefaultCredentialsProvider)
Set whether the S3 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.
-
isUseDefaultCredentialsProvider
public Boolean isUseDefaultCredentialsProvider()
-
isAutoCreateBucket
public boolean isAutoCreateBucket()
-
setAutoCreateBucket
public void setAutoCreateBucket(boolean autoCreateBucket)
Setting the autocreation of the S3 bucket bucketName. This will apply also in case of moveAfterRead option enabled and it will create the destinationBucket if it doesn't exist already.
-
getKeyName
public String getKeyName()
-
setKeyName
public void setKeyName(String keyName)
Setting the key name for an element in the bucket through endpoint parameter
-
isOverrideEndpoint
public boolean isOverrideEndpoint()
-
setOverrideEndpoint
public void setOverrideEndpoint(boolean overrideEndpoint)
Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option
-
getUriEndpointOverride
public String getUriEndpointOverride()
-
setUriEndpointOverride
public void setUriEndpointOverride(String uriEndpointOverride)
Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option
-
isPojoRequest
public boolean isPojoRequest()
-
setPojoRequest
public void setPojoRequest(boolean pojoRequest)
If we want to use a POJO request as body or not
-
isTrustAllCertificates
public boolean isTrustAllCertificates()
-
setTrustAllCertificates
public void setTrustAllCertificates(boolean trustAllCertificates)
If we want to trust all certificates in case of overriding the endpoint
-
getAmazonS3Presigner
public software.amazon.awssdk.services.s3.presigner.S3Presigner getAmazonS3Presigner()
-
setAmazonS3Presigner
public void setAmazonS3Presigner(software.amazon.awssdk.services.s3.presigner.S3Presigner amazonS3Presigner)
An S3 Presigner for Request, used mainly in createDownloadLink operation
-
isStreamingUploadMode
public boolean isStreamingUploadMode()
-
setStreamingUploadMode
public void setStreamingUploadMode(boolean streamingUploadMode)
When stream mode is true the upload to bucket will be done in streaming
-
getBatchMessageNumber
public int getBatchMessageNumber()
-
setBatchMessageNumber
public void setBatchMessageNumber(int batchMessageNumber)
The number of messages composing a batch in streaming upload mode
-
getBatchSize
public int getBatchSize()
-
setBatchSize
public void setBatchSize(int batchSize)
The batch size (in bytes) in streaming upload mode
-
getNamingStrategy
public AWSS3NamingStrategyEnum getNamingStrategy()
-
setNamingStrategy
public void setNamingStrategy(AWSS3NamingStrategyEnum namingStrategy)
The naming strategy to use in streaming upload mode
-
getStreamingUploadTimeout
public long getStreamingUploadTimeout()
-
setStreamingUploadTimeout
public void setStreamingUploadTimeout(long streamingUploadTimeout)
While streaming upload mode is true, this option set the timeout to complete upload
-
getRestartingPolicy
public AWSS3RestartingPolicyEnum getRestartingPolicy()
-
setRestartingPolicy
public void setRestartingPolicy(AWSS3RestartingPolicyEnum restartingPolicy)
The restarting policy to use in streaming upload mode
-
isUseSSES3
public boolean isUseSSES3()
-
setUseSSES3
public void setUseSSES3(boolean useSSES3)
Define if SSE S3 must be used or not
-
copy
public AWS2S3Configuration copy()
-
-