Class UploadControl
- java.lang.Object
-
- de.businesscode.bcdui.upload.data.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UploadControl.ReturnCode
Possible return codes for steps
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STEP_ID
-
Constructor Summary
Constructors Constructor Description UploadControl(java.lang.String uploadId)
For reading and updating entries in bcd_dataupload_control BLOB and uploadId are not updatedUploadControl(java.lang.String userId, java.lang.String sourceName, java.lang.String targetBs, java.io.InputStream fileContent)
Constructor inserting an initial entry in bcd_dataupload_control
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStepResult(java.lang.String stepId, UploadControl.ReturnCode rc)
insert a step result with no custom datavoid
addStepResult(java.lang.String stepId, UploadControl.ReturnCode rc, java.lang.String jsonData)
insert a step result with extra JSON datavoid
close()
Update all values (except BLOB and uploadId) into bcd_dataupload_controljava.lang.String
getColumnStartings()
java.lang.String
getDateFormat()
java.lang.Character
getDecimalSeparator()
java.lang.Character
getDelimiter()
java.lang.String
getEncoding()
java.io.InputStream
getFileBlobIs()
int
getImportColumnCount()
int
getImportRowCount()
static java.sql.Connection
getManagedUploadConnection(java.lang.String stepId)
Returns a managed connection to the database where bcd_dataupload_control is located TODO allow to provide a BS name to find the right dbSourcenamejava.lang.String
getMappingBindingItemAttribute(int idx, java.lang.String name)
int
getMappingBindingItemPos(java.lang.String id)
retrieve the position of mapped binding itemjava.lang.Character
getQuoteChar()
java.lang.String
getSheetName()
java.lang.String
getSheetRange()
java.lang.String
getSourceName()
java.lang.String
getTargetBs()
java.lang.String
getUploadId()
java.lang.String
getUserComment()
java.lang.String
getUserId()
java.lang.Boolean
hasHeaderRow()
void
setColumnStartings(java.lang.String columnStartings)
void
setDateFormat(java.lang.String dateFormat)
void
setDecimalSeparator(java.lang.Character decimalSeparator)
void
setDelimiter(java.lang.Character delimiter)
void
setEncoding(java.lang.String encoding)
void
setFileBlobIs(java.io.InputStream fileBlobIs)
void
setHasHeaderRow(java.lang.Boolean hasHeaderRow)
void
setImportColumnCount(int columnCount)
void
setImportRowCount(int rowCount)
void
setMappingBindingItemAttribute(int idx, java.lang.String name, java.lang.String value)
void
setQuoteChar(java.lang.Character quoteChar)
void
setSheetName(java.lang.String sheetName)
void
setSheetRange(java.lang.String sheetRange)
void
setSourceName(java.lang.String sourceName)
void
setTargetBs(java.lang.String targetBs)
void
setUploadId(java.lang.String uploadId)
void
setUser_comment(java.lang.String userComment)
void
setUserId(java.lang.String userId)
-
-
-
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 interfacejava.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
-
addStepResult
public void addStepResult(java.lang.String stepId, UploadControl.ReturnCode rc) throws UploadException
insert a step result with no custom data- Parameters:
stepId
-rc
-- 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)
-
-