public class S3ReportStorage extends java.lang.Object implements ReportStorage
By default, authentication is done using the DefaultAWSCredentialsProviderChain which uses
Environment Variables, Java System Properties, Credential profiles file, ...
| Constructor and Description |
|---|
S3ReportStorage() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAccessKey() |
java.lang.String |
getBucket() |
java.lang.String |
getEndpointUrl() |
protected java.lang.String |
getKey(java.lang.String ref,
java.lang.String filename,
java.lang.String extension)
Compute the key to use.
|
java.lang.String |
getPrefix() |
java.lang.String |
getRegion() |
int |
getRetentionDays() |
java.lang.String |
getSecretKey() |
java.net.URL |
save(java.lang.String ref,
java.lang.String filename,
java.lang.String extension,
java.lang.String mimeType,
java.io.File file)
Save the report in the storage.
|
void |
setAccessKey(java.lang.String accessKey)
To set the access key.
|
void |
setBucket(java.lang.String bucket)
The S3 bucket to use.
|
void |
setEndpointUrl(java.lang.String endpointUrl)
To override the endpoint URL (for non-Amazon, S3 compatible servers).
|
void |
setPrefix(java.lang.String prefix)
The key prefix to use.
|
void |
setRegion(java.lang.String region)
To set the region to use.
|
void |
setRetentionDays(int retentionDays)
The number of day the reports must be kept.
|
void |
setSecretKey(java.lang.String secretKey)
To set the secret key.
|
void |
validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
validate that the configuration was correct.
|
public java.net.URL save(java.lang.String ref,
java.lang.String filename,
java.lang.String extension,
java.lang.String mimeType,
java.io.File file)
ReportStoragesave in interface ReportStorageref - The reference number.filename - The filename.extension - The file extension.mimeType - The mime type.file - The file containing the report.protected java.lang.String getKey(java.lang.String ref,
java.lang.String filename,
java.lang.String extension)
ref - The reference number.filename - The filename.extension - The file extension.public void validate(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
ConfigurationObjectvalidate in interface ConfigurationObjectvalidationErrors - a list to add any detected errors to.configuration - the containing configurationpublic java.lang.String getAccessKey()
public void setAccessKey(java.lang.String accessKey)
accessKey - the value.public java.lang.String getSecretKey()
public void setSecretKey(java.lang.String secretKey)
secretKey - the value.public java.lang.String getRegion()
public void setRegion(java.lang.String region)
region - the value.public java.lang.String getEndpointUrl()
public void setEndpointUrl(java.lang.String endpointUrl)
endpointUrl - the value.public java.lang.String getBucket()
public void setBucket(java.lang.String bucket)
bucket - the value.public java.lang.String getPrefix()
public void setPrefix(java.lang.String prefix)
prefix - the value.public int getRetentionDays()
public void setRetentionDays(int retentionDays)
Passed this delay, they will be deleted and the links included in the corresponding emails will become invalid. Defaults to 7 days.
retentionDays - the value.