Open Source Software for
Extracting, Transforming and Loading
any kind of data

be.ikan.etl4all.util
Interface XmlIO


public interface XmlIO

Interface defining functionality for writing XML data to a physical device and reading XML data from a physical device


Field Summary
static int APPEND
          Constant specifying that new data have to be appended to existing sink data.
static java.lang.String[] modeString
          Array linking int constants to their meaning
static int OVERWRITE
          Constant specifiying that existing sink data have to be overwritten
static int REFRESH
          Constant specifying that existing data have to be refreshed.
 
Method Summary
 void delete(java.lang.String source)
          Delete data from a specified source
 void destroy()
          Release all allocated resources
 void exportData(java.io.BufferedReader reader, java.lang.String sink, int mode, java.lang.String metadata)
          Export data in a BufferedReader into a specified data sink
 void exportData(java.lang.String details, java.lang.String sink, int mode, java.lang.String metadata)
          Export XML data string into a specified data sink
 void importData(java.lang.String source, java.io.PrintWriter writer, java.lang.String metadata)
          Retrieve data as a XML PrintWriter object
 java.lang.String importData(java.lang.String source, java.lang.String metadata)
          Retrieve data as an XML string
 void init(org.w3c.dom.Element initParams)
          Initialize XmlIO
 

Field Detail

OVERWRITE

public static final int OVERWRITE
Constant specifiying that existing sink data have to be overwritten


APPEND

public static final int APPEND
Constant specifying that new data have to be appended to existing sink data. This means that:
  • When no keys are defined in the metadata, the new data are added to the existing data set.
  • When keys are defined in the metadata and the new and existing sets of keys are disjunct, the new data are added to the existing data set.
  • When keys are defined in the metadata and the new and existing sets of keys are overlapping, the operation is unvalid, and an excaption will be thrown.

  • REFRESH

    public static final int REFRESH
    Constant specifying that existing data have to be refreshed. This means that
  • When keys are defined in the metadata and the key of new data is already present in the existing data set, the existing entry will be overwritten.
  • When keys are defined in the metadata and the key of the new adata is not present in the existing data set, the new data are added to the existing data set.
  • When no keys are defined in the metadata, the operation is unvalid and an exception will be thrown.

  • modeString

    public static final java.lang.String[] modeString
    Array linking int constants to their meaning

    Method Detail

    init

    public void init(org.w3c.dom.Element initParams)
    Initialize XmlIO

    Parameters:
    initParams - Element Element grouping all initialization parameters

    importData

    public java.lang.String importData(java.lang.String source,
                                       java.lang.String metadata)
                                throws java.lang.Exception
    Retrieve data as an XML string

    Parameters:
    source - String name of the source of the information to be retrieved.
    metadata - String metadata corresponding to the data to be retrieved
    Returns:
    String content of the datasource "source"
    Throws:
    java.lang.Exception

    importData

    public void importData(java.lang.String source,
                           java.io.PrintWriter writer,
                           java.lang.String metadata)
                    throws java.lang.Exception
    Retrieve data as a XML PrintWriter object

    Parameters:
    source - String name of the source of the information to be retrieved.
    writer - PrintWriter writer that XML data has to be written to.
    metadata - String metadata for data to be extracted
    Throws:
    java.lang.Exception

    exportData

    public void exportData(java.lang.String details,
                           java.lang.String sink,
                           int mode,
                           java.lang.String metadata)
                    throws java.lang.Exception
    Export XML data string into a specified data sink

    Parameters:
    details - String XML data to be written
    sink - String name of the sink where the data has to be saved to
    mode - int OVERWRITE, APPEND or REFRESH
    metadata - String metadata corresponding to the data to be written
    Throws:
    java.lang.Exception

    exportData

    public void exportData(java.io.BufferedReader reader,
                           java.lang.String sink,
                           int mode,
                           java.lang.String metadata)
                    throws java.lang.Exception
    Export data in a BufferedReader into a specified data sink

    Parameters:
    reader - BufferedReader reader containing the XML data to be exported
    sink - String name of the sink where the XML data has to be saved to
    mode - int OVERWRITE, APPEND or REFRESH
    metadata - String metadata corresponding to the data to be written
    Throws:
    java.lang.Exception

    delete

    public void delete(java.lang.String source)
                throws java.lang.Exception
    Delete data from a specified source

    Parameters:
    source - String data source where data have to be deleted for
    Throws:
    java.lang.Exception

    destroy

    public void destroy()
    Release all allocated resources