Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.hipergate
Class DespatchAdviceLoader

    java.lang.Object
      com.knowgate.misc.CSVParser
          com.knowgate.hipergate.DespatchAdviceLoader

All Implemented Interfaces:
  ImportLoader

    public class DespatchAdviceLoader

extends CSVParser
implements ImportLoader

Field Summary

Fields inherited from interface com.knowgate.hipergate.datamodel.ImportLoader
`LOOUKP_TR_COLUMNS, LOOUKP_TR_COUNT, MODE_APPEND, MODE_APPENDUPDATE, MODE_UPDATE, WRITE_LOOKUPS`

Constructor Summary
`DespatchAdviceLoader()` Default constructor Input file is assumed to be in ISO-8859-1 character set encoding and default delimiter is TAB
`DespatchAdviceLoader(java.lang.String sCharSet, java.lang.String sColDelimiter)` Constructor

Method Summary
`void` | `close()` Close DespacthAdviceLoader Must be always called before DespacthAdviceLoader is destroyed
`int` | `columnCount()` Gt columns count
`java.lang.String[]` | `columnNames()` Get array of column names
`java.lang.Object` | `get(int iColumnIndex)` Get current value for a column given its index
`java.lang.Object` | `get(java.lang.String sColumnName)` Get current value for a column given its name
`int` | `getColumnIndex(java.lang.String sColumnName)` Get column index from its name
`void` | `importFile(java.sql.Connection oConn, java.lang.String sWorkArea, int iFlags, java.lang.String sFilePath, java.lang.String sColumnList)` Import despatch advices from a delimited file into the database
`void` | `prepare(java.sql.Connection oConn, ColumnList oCols)` Prepare DespacthAdviceLoader for repeated execution
`void` | `put(int iColumnIndex, java.lang.Object oValue)` Put current value for a column
`void` | `put(java.lang.String sColumnName, java.lang.Object oValue)` Put current value for a column
`void` | `setAllColumnsToNull()` Set all current values to null
`void` | `store(java.sql.Connection oConn, java.lang.String sWorkArea, int iFlags)` Store a single despatch advice line

Methods inherited from class com.knowgate.misc.CSVParser
`charSet, charSet, errorLine, find, findi, getColumnCount, getColumnPosition, getDelimiter, getField, getField, getLine, getLineAsMap, getLineCount, parseData, parseFile, parseFile, parseSheet, writeToFile, writeToStream`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DespatchAdviceLoader

    public DespatchAdviceLoader()

  Default constructor

  Input file is assumed to be in ISO-8859-1 character set encoding and default delimiter is TAB

### DespatchAdviceLoader

    public DespatchAdviceLoader(java.lang.String sCharSet,
                                java.lang.String sColDelimiter)

  Constructor

  Parameters:
    `String` - sCharSet Character set of input file
    `String` - Column delimiter

Method Detail

### importFile

    public void importFile(java.sql.Connection oConn,
                           java.lang.String sWorkArea,
                           int iFlags,
                           java.lang.String sFilePath,
                           java.lang.String sColumnList)
                    throws ImportExportException

  Import despatch advices from a delimited file into the database

  Parameters:
    `Connection` - Opened JDBC database connection
    `String` - sWorkArea GUID of WorkArea where despatch advices are to be loaded
    `int` - iFlags Additional flags for data loading { MODE_APPEND, MODE_UPDATE, MODE_APPENDUPDATE, WRITE_LOOKUPS }
    `String` - sFilePath Full path of file to be imported, including protocol.
    `String` - sColumnList Comma delimited list of columns present at the input file: "id_ref,nm_product,pr_total,..." Like "file:///tmp/myfile.txt" or "file://C:\\Temp\\MyFile.txt" or "ftp://myhost:21/dir/myfile.txt"
  Throws:
    `ImportExportException`
  Since:
    4.0

### columnCount

    public int columnCount()

  Gt columns count

  Specified by:
    `columnCount` in interface `ImportLoader`
  Returns:
    int

### columnNames

    public java.lang.String[] columnNames()
                                   throws java.lang.IllegalStateException

  Get array of column names

  Specified by:
    `columnNames` in interface `ImportLoader`
  Returns:
    String[]
  Throws:
    `java.lang.IllegalStateException`

### get

    public java.lang.Object get(int iColumnIndex)
                         throws java.lang.ArrayIndexOutOfBoundsException

  Get current value for a column given its index

  Specified by:
    `get` in interface `ImportLoader`
  Parameters:
    `iColumnIndex` - int [0..columnCount()-1]
  Returns:
    Object
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException`

### get

    public java.lang.Object get(java.lang.String sColumnName)
                         throws java.lang.ArrayIndexOutOfBoundsException

  Get current value for a column given its name

  Specified by:
    `get` in interface `ImportLoader`
  Parameters:
    `sColumnName` - Case insensitive String
  Returns:
    Object
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException` - if no column with such name was found

### getColumnIndex

    public int getColumnIndex(java.lang.String sColumnName)

  Get column index from its name

  Specified by:
    `getColumnIndex` in interface `ImportLoader`
  Parameters:
    `sColumnName` - String
  Returns:
    int [0..columnCount()-1] or -1 if column was not found

### put

    public void put(int iColumnIndex,
                    java.lang.Object oValue)
             throws java.lang.ArrayIndexOutOfBoundsException

  Put current value for a column

  Specified by:
    `put` in interface `ImportLoader`
  Parameters:
    `iColumnIndex` - int [0..columnCount()-1]
    `oValue` - Object
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException`

### put

    public void put(java.lang.String sColumnName,
                    java.lang.Object oValue)
             throws java.lang.ArrayIndexOutOfBoundsException

  Put current value for a column

  Specified by:
    `put` in interface `ImportLoader`
  Parameters:
    `sColumnName` - String Column name
    `oValue` - Object
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException`

### setAllColumnsToNull

    public void setAllColumnsToNull()

  Set all current values to null

  Specified by:
    `setAllColumnsToNull` in interface `ImportLoader`

### prepare

    public void prepare(java.sql.Connection oConn,
                        ColumnList oCols)
                 throws java.sql.SQLException

  Prepare DespacthAdviceLoader for repeated execution

  Specified by:
    `prepare` in interface `ImportLoader`
  Parameters:
    `oConn` - Connection
    `oCols` - ColumnList List of columns that will be inserted or updated at the database
  Throws:
    `java.sql.SQLException`

### close

    public void close()
               throws java.sql.SQLException

  Close DespacthAdviceLoader

  Must be always called before DespacthAdviceLoader is destroyed

  Specified by:
    `close` in interface `ImportLoader`
  Throws:
    `java.sql.SQLException`

### store

    public void store(java.sql.Connection oConn,
                      java.lang.String sWorkArea,
                      int iFlags)
               throws java.sql.SQLException,
                      java.lang.IllegalArgumentException,
                      java.lang.NullPointerException

  Store a single despatch advice line

  Specified by:
    `store` in interface `ImportLoader`
  Parameters:
    `oConn` - Connection
    `sWorkArea` - String
    `iFlags` - int
  Throws:
    `java.sql.SQLException`
    `java.lang.IllegalArgumentException`
    `java.lang.NullPointerException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD