org.pentaho.di.core.logging
Class JobLogTable

java.lang.Object
  extended by org.pentaho.di.core.logging.JobLogTable
All Implemented Interfaces:
Cloneable, LogTableInterface

public class JobLogTable
extends Object
implements Cloneable, LogTableInterface

This class describes a job logging table

Author:
matt

Nested Class Summary
static class JobLogTable.ID
           
 
Field Summary
static String PROP_LOG_TABLE_CONNECTION_NAME
           
static String PROP_LOG_TABLE_FIELD_ENABLED
           
static String PROP_LOG_TABLE_FIELD_ID
           
static String PROP_LOG_TABLE_FIELD_NAME
           
static String PROP_LOG_TABLE_FIELD_SUBJECT
           
static String PROP_LOG_TABLE_INTERVAL
           
static String PROP_LOG_TABLE_SCHEMA_NAME
           
static String PROP_LOG_TABLE_SIZE_LIMIT
           
static String PROP_LOG_TABLE_TABLE_NAME
           
static String PROP_LOG_TABLE_TIMEOUT_DAYS
           
static String XML_TAG
           
 
Method Summary
 Object clone()
           
 boolean containsKeyField()
           
 LogTableField findField(JobLogTable.ID id)
           
 LogTableField findField(String id)
          Find a log table field in this log table definition.
 String getActualSchemaName()
           
 String getActualTableName()
           
 String getConnectionName()
           
 String getConnectionNameVariable()
           
 DatabaseMeta getDatabaseMeta()
           
static JobLogTable getDefault(VariableSpace space, HasDatabasesInterface databasesInterface)
           
 LogTableField getErrorsField()
           
 List<LogTableField> getFields()
           
 LogTableField getKeyField()
           
 LogTableField getLogDateField()
           
 LogTableField getLogField()
           
 String getLogInterval()
          Get the logging interval in seconds.
 RowMetaAndData getLogRecord(LogStatus status, Object subject, Object parent)
          This method calculates all the values that are required
 String getLogSizeLimit()
           
 String getLogTableCode()
           
 String getLogTableType()
           
 LogTableField getNameField()
           
 String getQuotedSchemaTableCombination()
           
 List<RowMetaInterface> getRecommendedIndexes()
           
 String getSchemaName()
           
 String getSchemaNameVariable()
           
 LogTableField getStatusField()
           
 String getStepnameInput()
           
 String getStepnameOutput()
           
 String getStepnameRead()
           
 String getStepnameRejected()
           
 String getStepnameUpdated()
           
 String getStepnameWritten()
           
 Object getSubject(JobLogTable.ID id)
           
 Object getSubject(String id)
          Get the subject of a field with the specified ID
 String getSubjectString(JobLogTable.ID id)
           
 String getSubjectString(String id)
          Return the subject in the form of a string for the specified ID.
 String getTableName()
           
 String getTableNameVariable()
           
 String getTimeoutInDays()
           
 String getXML()
           
 boolean isBatchIdUsed()
           
 boolean isDefined()
           
 boolean isLogFieldUsed()
           
 void loadFieldsXML(Node node)
           
 void loadFromRepository(RepositoryAttributeInterface attributeInterface)
          Loads details of the log table from a repository.
 void loadXML(Node node, List<DatabaseMeta> databases)
           
 void saveToRepository(RepositoryAttributeInterface attributeInterface)
          Save this core information of the log table to the repository using the specified attribute interface.
 void setBatchIdUsed(boolean use)
           
 void setConnectionName(String connectionName)
           
 void setFields(List<LogTableField> fields)
           
 void setLogFieldUsed(boolean use)
           
 void setLogInterval(String logInterval)
          Sets the logging interval in seconds.
 void setLogSizeLimit(String logSizeLimit)
           
 void setSchemaName(String schemaName)
           
 void setTableName(String tableName)
           
 void setTimeoutInDays(String timeoutInDays)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pentaho.di.core.logging.LogTableInterface
getActualSchemaName, getActualTableName, getConnectionName, getDatabaseMeta, getErrorsField, getFields, getKeyField, getLogDateField, getLogField, getNameField, getQuotedSchemaTableCombination, getSchemaName, getStatusField, getTableName, getTimeoutInDays, isDefined, setConnectionName
 

Field Detail

XML_TAG

public static final String XML_TAG
See Also:
Constant Field Values

PROP_LOG_TABLE_CONNECTION_NAME

public static String PROP_LOG_TABLE_CONNECTION_NAME

PROP_LOG_TABLE_SCHEMA_NAME

public static String PROP_LOG_TABLE_SCHEMA_NAME

PROP_LOG_TABLE_TABLE_NAME

public static String PROP_LOG_TABLE_TABLE_NAME

PROP_LOG_TABLE_FIELD_ID

public static String PROP_LOG_TABLE_FIELD_ID

PROP_LOG_TABLE_FIELD_NAME

public static String PROP_LOG_TABLE_FIELD_NAME

PROP_LOG_TABLE_FIELD_ENABLED

public static String PROP_LOG_TABLE_FIELD_ENABLED

PROP_LOG_TABLE_FIELD_SUBJECT

public static String PROP_LOG_TABLE_FIELD_SUBJECT

PROP_LOG_TABLE_INTERVAL

public static String PROP_LOG_TABLE_INTERVAL

PROP_LOG_TABLE_SIZE_LIMIT

public static String PROP_LOG_TABLE_SIZE_LIMIT

PROP_LOG_TABLE_TIMEOUT_DAYS

public static String PROP_LOG_TABLE_TIMEOUT_DAYS
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

getXML

public String getXML()

loadXML

public void loadXML(Node node,
                    List<DatabaseMeta> databases)

saveToRepository

public void saveToRepository(RepositoryAttributeInterface attributeInterface)
                      throws KettleException
Save this core information of the log table to the repository using the specified attribute interface.

Specified by:
saveToRepository in interface LogTableInterface
Parameters:
attributeInterface - The attribute interface to use to set attributes
Throws:
KettleException

loadFromRepository

public void loadFromRepository(RepositoryAttributeInterface attributeInterface)
                        throws KettleException
Description copied from interface: LogTableInterface
Loads details of the log table from a repository.

Specified by:
loadFromRepository in interface LogTableInterface
Parameters:
attributeInterface - The attribute interface used to load the attributes
Throws:
KettleException

getDefault

public static JobLogTable getDefault(VariableSpace space,
                                     HasDatabasesInterface databasesInterface)

findField

public LogTableField findField(JobLogTable.ID id)

getSubject

public Object getSubject(JobLogTable.ID id)

getSubjectString

public String getSubjectString(JobLogTable.ID id)

setBatchIdUsed

public void setBatchIdUsed(boolean use)

isBatchIdUsed

public boolean isBatchIdUsed()

setLogFieldUsed

public void setLogFieldUsed(boolean use)

isLogFieldUsed

public boolean isLogFieldUsed()

getStepnameRead

public String getStepnameRead()

getStepnameWritten

public String getStepnameWritten()

getStepnameInput

public String getStepnameInput()

getStepnameOutput

public String getStepnameOutput()

getStepnameUpdated

public String getStepnameUpdated()

getStepnameRejected

public String getStepnameRejected()

setLogInterval

public void setLogInterval(String logInterval)
Sets the logging interval in seconds. Disabled if the logging interval is <=0.

Parameters:
logInterval - The log interval value. A value higher than 0 means that the log table is updated every 'logInterval' seconds.

getLogInterval

public String getLogInterval()
Get the logging interval in seconds. Disabled if the logging interval is <=0. A value higher than 0 means that the log table is updated every 'logInterval' seconds.

Parameters:
logInterval - The log interval,

getLogSizeLimit

public String getLogSizeLimit()
Returns:
the logSizeLimit

setLogSizeLimit

public void setLogSizeLimit(String logSizeLimit)
Parameters:
logSizeLimit - the logSizeLimit to set

getLogRecord

public RowMetaAndData getLogRecord(LogStatus status,
                                   Object subject,
                                   Object parent)
This method calculates all the values that are required

Specified by:
getLogRecord in interface LogTableInterface
Parameters:
id - the id to use or -1 if no id is needed
status - the log status to use
Returns:
The log record to write

getLogTableCode

public String getLogTableCode()

getLogTableType

public String getLogTableType()
Specified by:
getLogTableType in interface LogTableInterface

getConnectionNameVariable

public String getConnectionNameVariable()
Specified by:
getConnectionNameVariable in interface LogTableInterface

getSchemaNameVariable

public String getSchemaNameVariable()
Specified by:
getSchemaNameVariable in interface LogTableInterface

getTableNameVariable

public String getTableNameVariable()
Specified by:
getTableNameVariable in interface LogTableInterface

getRecommendedIndexes

public List<RowMetaInterface> getRecommendedIndexes()
Specified by:
getRecommendedIndexes in interface LogTableInterface
Returns:
A list of rows that contain the recommended indexed fields for this logging table.

toString

public String toString()
Overrides:
toString in class Object

getDatabaseMeta

public DatabaseMeta getDatabaseMeta()
Returns:
the databaseMeta

getActualSchemaName

public String getActualSchemaName()
Returns:
the schemaName

setSchemaName

public void setSchemaName(String schemaName)
Parameters:
schemaName - the schemaName to set

getSchemaName

public String getSchemaName()

getActualTableName

public String getActualTableName()
Returns:
the tableName

getTableName

public String getTableName()

setTableName

public void setTableName(String tableName)
Parameters:
tableName - the tableName to set

getQuotedSchemaTableCombination

public String getQuotedSchemaTableCombination()

getFields

public List<LogTableField> getFields()
Returns:
the fields

setFields

public void setFields(List<LogTableField> fields)
Parameters:
fields - the fields to set

findField

public LogTableField findField(String id)
Find a log table field in this log table definition. Use the id of the field to do the lookup.

Parameters:
id - the id of the field to search for
Returns:
the log table field or null if nothing was found.

getSubject

public Object getSubject(String id)
Get the subject of a field with the specified ID

Parameters:
id -
Returns:
the subject or null if no field could be find with the specified id

getSubjectString

public String getSubjectString(String id)
Return the subject in the form of a string for the specified ID.

Parameters:
id - the id of the field to look for.
Returns:
the string of the subject (name of step) or null if nothing was found.

containsKeyField

public boolean containsKeyField()

getLogDateField

public LogTableField getLogDateField()
Returns:
the field that represents the log date field or null if none was defined.

getKeyField

public LogTableField getKeyField()
Returns:
the field that represents the key to this logging table (batch id etc)

getLogField

public LogTableField getLogField()
Returns:
the field that represents the logging text (or null if none is found)

getStatusField

public LogTableField getStatusField()
Returns:
the field that represents the status (or null if none is found)

getErrorsField

public LogTableField getErrorsField()
Returns:
the field that represents the number of errors (or null if none is found)

getNameField

public LogTableField getNameField()
Returns:
the field that represents the name of the object that is being used (or null if none is found)

loadFieldsXML

public void loadFieldsXML(Node node)

isDefined

public boolean isDefined()

getTimeoutInDays

public String getTimeoutInDays()
Returns:
the timeoutInDays

setTimeoutInDays

public void setTimeoutInDays(String timeoutInDays)
Parameters:
timeoutInDays - the timeoutInDays to set

getConnectionName

public String getConnectionName()
Returns:
the connectionName

setConnectionName

public void setConnectionName(String connectionName)
Parameters:
connectionName - the connectionName to set