Class S3Provider

  • All Implemented Interfaces:
    Provider

    public class S3Provider
    extends java.lang.Object
    implements Provider
    S3Provider for ibm-cos and aws-s3
    • Constructor Summary

      Constructors 
      Constructor Description
      S3Provider​(java.lang.String source)
      The provider loads the Client based on the Source.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the StorageProvider wrapped resources.
      void createSource()
      creates the base output location for the type.
      boolean exists()
      checks to see if the bucket exists.
      com.ibm.cloud.objectstorage.services.s3.AmazonS3 getClient()  
      com.ibm.cloud.objectstorage.services.s3.model.ListObjectsV2Result getListObject​(java.lang.String prefix, java.lang.String continuationToken)
      get the list of objects based on the continuation token.
      long getNumberOfLoaded()  
      long getNumberOfParseFailures()  
      java.util.List<Resource> getResources()
      gets the read resources.
      long getSize​(java.lang.String workItem)
      gets the size of the given work item.
      void listBuckets()
      lists the buckets when logging out bucket details
      void pushEndOfJobOperationOutcomes​(java.io.ByteArrayOutputStream baos, java.lang.String folder, java.lang.String fileName)
      Pushes End of Job OperationOutcomes and closes the Outcomes StorageProvider
      void pushOperationOutcomes()
      Pushes the Operation Outcomes
      void readResources​(long numOfLinesToSkip, java.lang.String workItem)
      reads from a given workitem (or file) in a source and skips a certain noumber of lines
      void registerTransient​(long executionId, ExportTransientUserData transientUserData, java.lang.String cosBucketPathPrefix, java.lang.String fhirResourceType)  
      void registerTransient​(ImportTransientUserData transientUserData)  
      void writeResources​(java.lang.String mediaType, java.util.List<ReadResultDTO> dtos)
      wraps the complexity of writing FHIR Resources out to a target
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • S3Provider

        public S3Provider​(java.lang.String source)
                   throws FHIRException
        The provider loads the Client based on the Source. The Source (storageProvider) must be s3 compatible.
        Parameters:
        source -
        Throws:
        FHIRException
    • Method Detail

      • exists

        public boolean exists()
        checks to see if the bucket exists.
        Returns:
      • listBuckets

        public void listBuckets()
        lists the buckets when logging out bucket details
      • getListObject

        public com.ibm.cloud.objectstorage.services.s3.model.ListObjectsV2Result getListObject​(java.lang.String prefix,
                                                                                               java.lang.String continuationToken)
                                                                                        throws FHIRException
        get the list of objects based on the continuation token.
        Parameters:
        prefix - the search key
        continuationToken - null or string indicating a continuation token.
        Returns:
        Throws:
        FHIRException
      • readResources

        public void readResources​(long numOfLinesToSkip,
                                  java.lang.String workItem)
                           throws FHIRException
        Description copied from interface: Provider
        reads from a given workitem (or file) in a source and skips a certain noumber of lines
        Specified by:
        readResources in interface Provider
        Throws:
        FHIRException
      • getClient

        public com.ibm.cloud.objectstorage.services.s3.AmazonS3 getClient()
      • close

        public void close()
                   throws java.lang.Exception
        Description copied from interface: Provider
        Closes the StorageProvider wrapped resources.
        Specified by:
        close in interface Provider
        Throws:
        java.lang.Exception
      • writeResources

        public void writeResources​(java.lang.String mediaType,
                                   java.util.List<ReadResultDTO> dtos)
                            throws java.lang.Exception
        Description copied from interface: Provider
        wraps the complexity of writing FHIR Resources out to a target
        Specified by:
        writeResources in interface Provider
        Throws:
        java.lang.Exception
      • registerTransient

        public void registerTransient​(long executionId,
                                      ExportTransientUserData transientUserData,
                                      java.lang.String cosBucketPathPrefix,
                                      java.lang.String fhirResourceType)
                               throws java.lang.Exception
        Specified by:
        registerTransient in interface Provider
        Throws:
        java.lang.Exception
      • pushEndOfJobOperationOutcomes

        public void pushEndOfJobOperationOutcomes​(java.io.ByteArrayOutputStream baos,
                                                  java.lang.String folder,
                                                  java.lang.String fileName)
                                           throws FHIRException
        Description copied from interface: Provider
        Pushes End of Job OperationOutcomes and closes the Outcomes StorageProvider
        Specified by:
        pushEndOfJobOperationOutcomes in interface Provider
        Parameters:
        baos - the byte array output stream that is passed in
        folder - the folder where the file is to be stored
        fileName - the output filename to be used
        Throws:
        FHIRException