org.pentaho.di.core.logging
Class ChannelLogTable

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

public class ChannelLogTable
extends Object
implements Cloneable, LogTableInterface

This class describes a logging channel logging table

Author:
matt

Nested Class Summary
static class ChannelLogTable.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()
           
 boolean equals(Object obj)
           
 LogTableField findField(String id)
          Find a log table field in this log table definition.
 String getActualConnectionName()
           
 String getActualSchemaName()
           
 String getActualTableName()
           
 String getConnectionName()
           
 String getConnectionNameVariable()
           
 DatabaseMeta getDatabaseMeta()
           
static ChannelLogTable getDefault(VariableSpace space, HasDatabasesInterface databasesInterface)
           
 LogTableField getErrorsField()
           
 List<LogTableField> getFields()
           
 LogTableField getKeyField()
           
 LogTableField getLogDateField()
           
 LogTableField getLogField()
           
 RowMetaAndData getLogRecord(LogStatus status, Object subject, Object parent)
          This method calculates all the values that are required
 String getLogTableCode()
           
 String getLogTableType()
           
 LogTableField getNameField()
           
 String getQuotedSchemaTableCombination()
           
 List<RowMetaInterface> getRecommendedIndexes()
           
 String getSchemaName()
           
 String getSchemaNameVariable()
           
 LogTableField getStatusField()
           
 Object getSubject(String id)
          Get the subject of a field with the specified 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 isDefined()
           
 void loadFieldsXML(Node node)
           
 void loadFromRepository(RepositoryAttributeInterface attributeInterface)
           
 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 setConnectionName(String connectionName)
           
 void setFields(List<LogTableField> fields)
           
 void setSchemaName(String schemaName)
           
 void setTableName(String tableName)
           
 void setTimeoutInDays(String timeoutInDays)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
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, loadFromRepository, saveToRepository, 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)

getDefault

public static ChannelLogTable getDefault(VariableSpace space,
                                         HasDatabasesInterface databasesInterface)

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

saveToRepository

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

Parameters:
attributeInterface - The attribute interface to use to set attributes
Throws:
KettleException

loadFromRepository

public void loadFromRepository(RepositoryAttributeInterface attributeInterface)
                        throws KettleException
Throws:
KettleException

getDatabaseMeta

public DatabaseMeta getDatabaseMeta()
Returns:
the databaseMeta

getActualConnectionName

public String getActualConnectionName()
Returns:
the connectionName

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object