Class S3AtomicInputStreamGetter

java.lang.Object
de.dlr.proseo.storagemgr.s3.S3AtomicInputStreamGetter
All Implemented Interfaces:
AtomicCommand<InputStream>

public class S3AtomicInputStreamGetter extends Object implements AtomicCommand<InputStream>
This class implements the AtomicCommand interface to get an input stream of an S3 file. It uses the S3Client from the AWS SDK to retrieve the input stream from the specified bucket and file key. The class also provides information about the execution of the atomic command.
Author:
Denys Chaykovskiy
  • Constructor Details

    • S3AtomicInputStreamGetter

      public S3AtomicInputStreamGetter(software.amazon.awssdk.services.s3.S3Client s3Client, String bucket, String relativePath)
      Constructor
      Parameters:
      s3Client - S3 client
      bucket - Bucket
      relativePath - Relative path of the source file
  • Method Details

    • execute

      public InputStream execute() throws IOException
      Executes the input stream getter command and returns the input stream of the S3 file.
      Specified by:
      execute in interface AtomicCommand<InputStream>
      Returns:
      InputStream of the S3 file
      Throws:
      IOException - if an I/O error occurs during the execution
    • getInfo

      public String getInfo()
      Gets information about the atomic command.
      Specified by:
      getInfo in interface AtomicCommand<InputStream>
      Returns:
      information about the atomic command
    • getCompletedInfo

      public String getCompletedInfo()
      Gets information about the completed atomic command.
      Specified by:
      getCompletedInfo in interface AtomicCommand<InputStream>
      Returns:
      information about the completed atomic command
    • getFailedInfo

      public String getFailedInfo()
      Gets information about the failed atomic command.
      Specified by:
      getFailedInfo in interface AtomicCommand<InputStream>
      Returns:
      information about the failed atomic command