Class DataExporterImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      DataExporterImpl​(org.slf4j.Logger log)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String decode​(java.lang.String inputData, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> decodingConfig)
      Decodes data that has been encoded into a string.
      protected java.lang.String getResourceHeader​(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> connectionConfiguration)
      Creates a small header to be applied to exported resource files.
      protected void writeData​(java.io.File outputFile, java.lang.String resourceHeader, java.lang.String decodedResponse)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface de.julielab.jssf.commons.spi.ExtensionPoint

        getName, hasName
      • Methods inherited from interface de.julielab.jssf.commons.spi.ParameterExposing

        exposeParameters
    • Constructor Detail

      • DataExporterImpl

        public DataExporterImpl​(org.slf4j.Logger log)
    • Method Detail

      • getResourceHeader

        protected java.lang.String getResourceHeader​(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> connectionConfiguration)
                                              throws VersionRetrievalException,
                                                     java.io.IOException
        Creates a small header to be applied to exported resource files. The header contains the database and Concept Manager application versions. Thus should help to avoid confusion about versioning of resources. The lines are prepended with the '#' character. Thus, reading applications should accept this character as a comment indicator.
        Parameters:
        connectionConfiguration - Connection configuration to retrieve the database version.
        Returns:
        A string representing the header.
        Throws:
        VersionRetrievalException - If the database version cannot be retrieved.
        java.io.IOException - If the application version cannot be read (it is stored in a auto-generated file).
      • decode

        protected java.lang.String decode​(java.lang.String inputData,
                                          org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> decodingConfig)
                                   throws java.io.IOException
        Decodes data that has been encoded into a string. The decodingConfig determines which decodings are applied in which order. The following decodings are available:
        base64
        Base64 is an algorithm to encode arbitrary byte sequences into strings.
        gzip
        If the data contains a byte array that has been compressed with GZIP and then encoded into a string using base64, this decoding decompresses the byte array. Requires the base64 encoding to be applied before.
        json2bytearray
        While less performant than using base64, a byte array may also be encoded as a JSON array carrying the byte values.
        Parameters:
        inputData -
        decodingConfig -
        Returns:
        Throws:
        java.io.IOException
      • writeData

        protected void writeData​(java.io.File outputFile,
                                 java.lang.String resourceHeader,
                                 java.lang.String decodedResponse)
                          throws java.io.IOException,
                                 DataExportException
        Throws:
        java.io.IOException
        DataExportException