org.pentaho.di.trans.steps.terafast
Class FastloadControlBuilder

java.lang.Object
  extended by org.pentaho.di.trans.steps.terafast.FastloadControlBuilder

public class FastloadControlBuilder
extends Object

Author:
Thomas Hoedl(asc042)

Field Summary
static String DATAFILE_COLUMN_SEPERATOR
           
static String DEFAULT_DATE_FORMAT
           
static String DEFAULT_ERROR_TABLE1
           
static String DEFAULT_ERROR_TABLE2
           
static String DEFAULT_NULL_VALUE
           
static String RECORD_FORMAT_UNFORMATTED
           
static String RECORD_VARTEXT
           
 
Constructor Summary
FastloadControlBuilder()
           
 
Method Summary
 FastloadControlBuilder beginLoading(String table)
          Issue begin loading with default error tables.
 FastloadControlBuilder define(RowMetaInterface targetTableFields, String dataFile)
           
 FastloadControlBuilder endLoading()
           
 FastloadControlBuilder insert(RowMetaInterface targetTableFields, String tableName)
           
 FastloadControlBuilder line(String line)
          Append line, nothing if line is blank.
 FastloadControlBuilder logoff()
          Append log off.
 FastloadControlBuilder logon(String connectionString)
          Append log on.
 FastloadControlBuilder logon(String dbhost, String user, String password)
          Append log on.
 FastloadControlBuilder newline()
          Append new line.
 FastloadControlBuilder setErrorLimit(int errorLimit)
           
 FastloadControlBuilder setRecordFormat(String format)
           
 FastloadControlBuilder setSessions(int sessions)
           
 FastloadControlBuilder show()
          show field definition.
 String toString()
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATAFILE_COLUMN_SEPERATOR

public static final String DATAFILE_COLUMN_SEPERATOR
See Also:
Constant Field Values

RECORD_FORMAT_UNFORMATTED

public static final String RECORD_FORMAT_UNFORMATTED
See Also:
Constant Field Values

RECORD_VARTEXT

public static final String RECORD_VARTEXT
See Also:
Constant Field Values

DEFAULT_ERROR_TABLE1

public static final String DEFAULT_ERROR_TABLE1
See Also:
Constant Field Values

DEFAULT_ERROR_TABLE2

public static final String DEFAULT_ERROR_TABLE2
See Also:
Constant Field Values

DEFAULT_DATE_FORMAT

public static final String DEFAULT_DATE_FORMAT
See Also:
Constant Field Values

DEFAULT_NULL_VALUE

public static final String DEFAULT_NULL_VALUE
See Also:
Constant Field Values
Constructor Detail

FastloadControlBuilder

public FastloadControlBuilder()
Method Detail

newline

public FastloadControlBuilder newline()
Append new line.

Returns:
this.

logon

public FastloadControlBuilder logon(String connectionString)
                             throws IllegalArgumentException
Append log on. Connection string must be in form [DBHOST]/[USER],[PASSWORD], e.g. localtd/user,pass;

Parameters:
connectionString - the connection string.
Returns:
this.
Throws:
IllegalArgumentException - if connection string is blank.

logon

public FastloadControlBuilder logon(String dbhost,
                                    String user,
                                    String password)
                             throws IllegalArgumentException
Append log on.

Parameters:
dbhost - DB host, e.g localtd
user - the user.
password - the password.
Returns:
this
Throws:
IllegalArgumentException - if input is invalid.

setRecordFormat

public FastloadControlBuilder setRecordFormat(String format)
                                       throws IllegalArgumentException
Parameters:
format - the format.
Returns:
this.
Throws:
IllegalArgumentException - if format is invalid.

setSessions

public FastloadControlBuilder setSessions(int sessions)
                                   throws IllegalArgumentException
Parameters:
sessions - the sesssions.
Returns:
this.
Throws:
IllegalArgumentException - if sessions <= 0

setErrorLimit

public FastloadControlBuilder setErrorLimit(int errorLimit)
                                     throws IllegalArgumentException
Parameters:
errorLimit - the errorLimit.
Returns:
this.
Throws:
IllegalArgumentException - if errorLimit <= 0

define

public FastloadControlBuilder define(RowMetaInterface targetTableFields,
                                     String dataFile)
Parameters:
targetTableFields - ...
dataFile - ...
Returns:
this

insert

public FastloadControlBuilder insert(RowMetaInterface targetTableFields,
                                     String tableName)
Parameters:
targetTableFields - ...
tableName - ...
Returns:
...

show

public FastloadControlBuilder show()
show field definition.

Returns:
this

endLoading

public FastloadControlBuilder endLoading()
Returns:
this

beginLoading

public FastloadControlBuilder beginLoading(String table)
                                    throws IllegalArgumentException
Issue begin loading with default error tables.

Parameters:
table - the target table.
Returns:
this.
Throws:
IllegalArgumentException - if table is invalid.

line

public FastloadControlBuilder line(String line)
Append line, nothing if line is blank.

Parameters:
line - line to append.
Returns:
this.

logoff

public FastloadControlBuilder logoff()
Append log off.

Returns:
this.

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()