Class S3ReportStorage

java.lang.Object
org.mapfish.print.config.S3ReportStorage
All Implemented Interfaces:
ConfigurationObject, ReportStorage

public class S3ReportStorage extends Object implements ReportStorage
Configuration for storing the reports in a S3 compatible storage.

By default, authentication is done using the DefaultAWSCredentialsProviderChain which uses Environment Variables, Java System Properties, Credential profiles file, ...

  • Constructor Details

    • S3ReportStorage

      public S3ReportStorage()
  • Method Details

    • save

      public URL save(String ref, String filename, String extension, String mimeType, File file)
      Description copied from interface: ReportStorage
      Save the report in the storage.
      Specified by:
      save in interface ReportStorage
      Parameters:
      ref - The reference number.
      filename - The filename.
      extension - The file extension.
      mimeType - The mime type.
      file - The file containing the report.
      Returns:
      The URL that can be used to fetch the result.
    • getKey

      protected String getKey(String ref, String filename, String extension)
      Compute the key to use.
      Parameters:
      ref - The reference number.
      filename - The filename.
      extension - The file extension.
    • validate

      public void validate(List<Throwable> validationErrors, Configuration configuration)
      Description copied from interface: ConfigurationObject
      validate that the configuration was correct.
      Specified by:
      validate in interface ConfigurationObject
      Parameters:
      validationErrors - a list to add any detected errors to.
      configuration - the containing configuration
    • getAccessKey

      public String getAccessKey()
    • setAccessKey

      public void setAccessKey(String accessKey)
      To set the access key.
      Parameters:
      accessKey - the value.
    • getSecretKey

      public String getSecretKey()
    • setSecretKey

      public void setSecretKey(String secretKey)
      To set the secret key.
      Parameters:
      secretKey - the value.
    • getRegion

      public String getRegion()
    • setRegion

      public void setRegion(String region)
      To set the region to use.
      Parameters:
      region - the value.
    • getEndpointUrl

      public String getEndpointUrl()
    • setEndpointUrl

      public void setEndpointUrl(String endpointUrl)
      To override the endpoint URL (for non-Amazon, S3 compatible servers).
      Parameters:
      endpointUrl - the value.
    • getBucket

      public String getBucket()
    • setBucket

      public void setBucket(String bucket)
      The S3 bucket to use.
      Parameters:
      bucket - the value.
    • getPrefix

      public String getPrefix()
    • setPrefix

      public void setPrefix(String prefix)
      The key prefix to use.
      Parameters:
      prefix - the value.
    • getRetentionDays

      public int getRetentionDays()
    • setRetentionDays

      public void setRetentionDays(int retentionDays)
      The number of day the reports must be kept.

      Passed this delay, they will be deleted and the links included in the corresponding emails will become invalid. Defaults to 7 days.

      Parameters:
      retentionDays - the value.