Class UploadControl

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class UploadControl
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Used for accessing bcd_dataupload_control table
    • Field Detail

      • STEP_ID

        public static java.lang.String STEP_ID
    • Constructor Detail

      • UploadControl

        public UploadControl​(java.lang.String userId,
                             java.lang.String sourceName,
                             java.lang.String targetBs,
                             java.io.InputStream fileContent)
                      throws UploadException
        Constructor inserting an initial entry in bcd_dataupload_control
        Parameters:
        userId -
        sourceName -
        fileContent -
        Throws:
        java.lang.Exception
        UploadException
      • UploadControl

        public UploadControl​(java.lang.String uploadId)
                      throws UploadException
        For reading and updating entries in bcd_dataupload_control BLOB and uploadId are not updated
        Parameters:
        uploadId -
        Throws:
        java.lang.Exception
        UploadException
    • Method Detail

      • close

        public void close()
                   throws UploadException
        Update all values (except BLOB and uploadId) into bcd_dataupload_control
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        UploadException
      • getMappingBindingItemAttribute

        public java.lang.String getMappingBindingItemAttribute​(int idx,
                                                               java.lang.String name)
      • setMappingBindingItemAttribute

        public void setMappingBindingItemAttribute​(int idx,
                                                   java.lang.String name,
                                                   java.lang.String value)
      • getMappingBindingItemPos

        public int getMappingBindingItemPos​(java.lang.String id)
        retrieve the position of mapped binding item
        Parameters:
        id -
        Returns:
        position (not index); 1-based of the mapping binding item
      • getManagedUploadConnection

        public static java.sql.Connection getManagedUploadConnection​(java.lang.String stepId)
                                                              throws UploadException
        Returns a managed connection to the database where bcd_dataupload_control is located TODO allow to provide a BS name to find the right dbSourcename
        Returns:
        Throws:
        java.lang.Exception
        UploadException
      • addStepResult

        public void addStepResult​(java.lang.String stepId,
                                  UploadControl.ReturnCode rc,
                                  java.lang.String jsonData)
                           throws UploadException
        insert a step result with extra JSON data
        Parameters:
        stepId -
        rc -
        jsonData - - a string in JSON notation
        Throws:
        UploadException
      • getUploadId

        public java.lang.String getUploadId()
      • setUploadId

        public void setUploadId​(java.lang.String uploadId)
      • getSourceName

        public java.lang.String getSourceName()
      • setSourceName

        public void setSourceName​(java.lang.String sourceName)
      • getUserId

        public java.lang.String getUserId()
      • setUserId

        public void setUserId​(java.lang.String userId)
      • getUserComment

        public java.lang.String getUserComment()
      • setUser_comment

        public void setUser_comment​(java.lang.String userComment)
      • getFileBlobIs

        public java.io.InputStream getFileBlobIs()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setFileBlobIs

        public void setFileBlobIs​(java.io.InputStream fileBlobIs)
      • getDelimiter

        public java.lang.Character getDelimiter()
      • setDelimiter

        public void setDelimiter​(java.lang.Character delimiter)
      • getEncoding

        public java.lang.String getEncoding()
      • setEncoding

        public void setEncoding​(java.lang.String encoding)
      • getQuoteChar

        public java.lang.Character getQuoteChar()
      • setQuoteChar

        public void setQuoteChar​(java.lang.Character quoteChar)
      • getDecimalSeparator

        public java.lang.Character getDecimalSeparator()
      • setDecimalSeparator

        public void setDecimalSeparator​(java.lang.Character decimalSeparator)
      • hasHeaderRow

        public java.lang.Boolean hasHeaderRow()
      • setHasHeaderRow

        public void setHasHeaderRow​(java.lang.Boolean hasHeaderRow)
      • getDateFormat

        public java.lang.String getDateFormat()
      • setDateFormat

        public void setDateFormat​(java.lang.String dateFormat)
      • getColumnStartings

        public java.lang.String getColumnStartings()
      • setColumnStartings

        public void setColumnStartings​(java.lang.String columnStartings)
      • getImportColumnCount

        public int getImportColumnCount()
      • setImportColumnCount

        public void setImportColumnCount​(int columnCount)
      • getImportRowCount

        public int getImportRowCount()
      • setImportRowCount

        public void setImportRowCount​(int rowCount)
      • getTargetBs

        public java.lang.String getTargetBs()
      • setTargetBs

        public void setTargetBs​(java.lang.String targetBs)
      • getSheetName

        public java.lang.String getSheetName()
      • setSheetName

        public void setSheetName​(java.lang.String sheetName)
      • getSheetRange

        public java.lang.String getSheetRange()
      • setSheetRange

        public void setSheetRange​(java.lang.String sheetRange)