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 AWS2S3Configurationcopy()StringgetAccessKey()software.amazon.awssdk.services.s3.S3ClientgetAmazonS3Client()software.amazon.awssdk.services.s3.presigner.S3PresignergetAmazonS3Presigner()StringgetAwsKMSKeyId()intgetBatchMessageNumber()intgetBatchSize()StringgetBucketName()StringgetCustomerAlgorithm()StringgetCustomerKeyId()StringgetCustomerKeyMD5()StringgetDelimiter()StringgetDestinationBucket()StringgetDestinationBucketPrefix()StringgetDestinationBucketSuffix()StringgetDoneFileName()StringgetFileName()StringgetKeyName()AWSS3NamingStrategyEnumgetNamingStrategy()AWS2S3OperationsgetOperation()longgetPartSize()StringgetPolicy()StringgetPrefix()StringgetProxyHost()IntegergetProxyPort()software.amazon.awssdk.core.ProtocolgetProxyProtocol()StringgetRegion()AWSS3RestartingPolicyEnumgetRestartingPolicy()StringgetSecretKey()StringgetStorageClass()longgetStreamingUploadTimeout()StringgetUriEndpointOverride()booleanisAutocloseBody()booleanisAutoCreateBucket()booleanisDeleteAfterRead()booleanisDeleteAfterWrite()booleanisIgnoreBody()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.booleanisIncludeBody()booleanisIncludeFolders()booleanisMoveAfterRead()booleanisMultiPartUpload()booleanisOverrideEndpoint()booleanisPojoRequest()booleanisStreamingUploadMode()booleanisTrustAllCertificates()booleanisUseAwsKMS()booleanisUseCustomerKey()BooleanisUseDefaultCredentialsProvider()voidsetAccessKey(String accessKey)Amazon AWS Access KeyvoidsetAmazonS3Client(software.amazon.awssdk.services.s3.S3Client amazonS3Client)Reference to a `com.amazonaws.services.s3.AmazonS3` in the registry.voidsetAmazonS3Presigner(software.amazon.awssdk.services.s3.presigner.S3Presigner amazonS3Presigner)An S3 Presigner for Request, used mainly in createDownloadLink operationvoidsetAutocloseBody(boolean autocloseBody)If this option is true and includeBody is false, then the S3Object.close() method will be called on exchange completion.voidsetAutoCreateBucket(boolean autoCreateBucket)Setting the autocreation of the S3 bucket bucketName.voidsetAwsKMSKeyId(String awsKMSKeyId)Define the id of KMS key to use in case KMS is enabledvoidsetBatchMessageNumber(int batchMessageNumber)The number of messages composing a batch in streaming upload modevoidsetBatchSize(int batchSize)The batch size (in bytes) in streaming upload modevoidsetBucketName(String bucketName)Name of the bucket.voidsetCustomerAlgorithm(String customerAlgorithm)Define the customer algorithm to use in case CustomerKey is enabledvoidsetCustomerKeyId(String customerKeyId)Define the id of Customer key to use in case CustomerKey is enabledvoidsetCustomerKeyMD5(String customerKeyMD5)Define the MD5 of Customer key to use in case CustomerKey is enabledvoidsetDeleteAfterRead(boolean deleteAfterRead)Delete objects from S3 after they have been retrieved.voidsetDeleteAfterWrite(boolean deleteAfterWrite)Delete file object after the S3 file has been uploadedvoidsetDelimiter(String delimiter)The delimiter which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.voidsetDestinationBucket(String destinationBucket)Define the destination bucket where an object must be moved when moveAfterRead is set to true.voidsetDestinationBucketPrefix(String destinationBucketPrefix)Define the destination bucket prefix to use when an object must be moved and moveAfterRead is set to true.voidsetDestinationBucketSuffix(String destinationBucketSuffix)Define the destination bucket suffix to use when an object must be moved and moveAfterRead is set to true.voidsetDoneFileName(String doneFileName)If provided, Camel will only consume files if a done file exists.voidsetFileName(String fileName)To get the object from the bucket with the given file namevoidsetIgnoreBody(boolean ignoreBody)voidsetIncludeBody(boolean includeBody)If it is true, the S3Object exchange will be consumed and put into the body and closed.voidsetIncludeFolders(boolean includeFolders)If it is true, the folders/directories will be consumed.voidsetKeyName(String keyName)Setting the key name for an element in the bucket through endpoint parametervoidsetMoveAfterRead(boolean moveAfterRead)Move objects from S3 bucket to a different bucket after they have been retrieved.voidsetMultiPartUpload(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`voidsetNamingStrategy(AWSS3NamingStrategyEnum namingStrategy)The naming strategy to use in streaming upload modevoidsetOperation(AWS2S3Operations operation)The operation to do in case the user don't want to do only an uploadvoidsetOverrideEndpoint(boolean overrideEndpoint)Set the need for overidding the endpoint.voidsetPartSize(long partSize)Setup the partSize which is used in multi part upload, the default size is 25M.voidsetPojoRequest(boolean pojoRequest)If we want to use a POJO request as body or notvoidsetPolicy(String policy)The policy for this queue to set in the `com.amazonaws.services.s3.AmazonS3#setBucketPolicy()` method.voidsetPrefix(String prefix)The prefix which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.voidsetProxyHost(String proxyHost)To define a proxy host when instantiating the SQS clientvoidsetProxyPort(Integer proxyPort)Specify a proxy port to be used inside the client definition.voidsetProxyProtocol(software.amazon.awssdk.core.Protocol proxyProtocol)To define a proxy protocol when instantiating the S3 clientvoidsetRegion(String region)The region in which S3 client needs to work.voidsetRestartingPolicy(AWSS3RestartingPolicyEnum restartingPolicy)The restarting policy to use in streaming upload modevoidsetSecretKey(String secretKey)Amazon AWS Secret KeyvoidsetStorageClass(String storageClass)The storage class to set in the `com.amazonaws.services.s3.model.PutObjectRequest` request.voidsetStreamingUploadMode(boolean streamingUploadMode)When stream mode is true the upload to bucket will be done in streamingvoidsetStreamingUploadTimeout(long streamingUploadTimeout)While streaming upload mode is true, this option set the timeout to complete uploadvoidsetTrustAllCertificates(boolean trustAllCertificates)If we want to trust all certificates in case of overriding the endpointvoidsetUriEndpointOverride(String uriEndpointOverride)Set the overriding uri endpoint.voidsetUseAwsKMS(boolean useAwsKMS)Define if KMS must be used or notvoidsetUseCustomerKey(boolean useCustomerKey)Define if Customer Key must be used or notvoidsetUseDefaultCredentialsProvider(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.
-
-
-
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_NAMEandAWS2S3Constants.KEYheaders, or only theAWS2S3Constants.KEYheader.
-
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
-
copy
public AWS2S3Configuration copy()
-
-