/** * Find a log table field in this log table definition. Use the id of the field to do the lookup. * * @param id * the id of the field to search for * @return the log table field or null if nothing was found. */ public LogTableField findField( String id ) { for ( LogTableField field : fields ) { if ( field.getId().equals( id ) ) { return field; } } return null; }
protected String getFieldsXML() { StringBuilder retval = new StringBuilder(); for ( LogTableField field : fields ) { retval.append( " " ).append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "id", field.getId() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enabled", field.isEnabled() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "name", field.getFieldName() ) ); if ( field.isSubjectAllowed() ) { retval.append( " " ).append( XMLHandler.addTagValue( "subject", field.getSubject() == null ? null : field.getSubject().toString() ) ); } retval.append( " " ).append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR ); } return retval.toString(); }
Object value = null; if ( subject != null ) { switch ( ID.valueOf( field.getId() ) ) {
Object value = null; if ( subject != null ) { switch ( ID.valueOf( field.getId() ) ) {
switch ( ID.valueOf( field.getId() ) ) {
/** * Save this core information of the log table to the repository using the specified attribute interface. * * @param attributeInterface * The attribute interface to use to set attributes * @throws KettleException */ public void saveToRepository( RepositoryAttributeInterface attributeInterface ) throws KettleException { attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_CONNECTION_NAME, getConnectionName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_SCHEMA_NAME, getSchemaName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_TABLE_NAME, getTableName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_TIMEOUT_DAYS, getTimeoutInDays() ); // Store the fields too... // for ( int i = 0; i < getFields().size(); i++ ) { LogTableField field = getFields().get( i ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_ID + i, field.getId() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_NAME + i, field.getFieldName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_ENABLED + i, field.isEnabled() ); if ( field.isSubjectAllowed() ) { attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_SUBJECT + i, field.getSubject() == null ? null : field .getSubject().toString() ); } } }
if ( trans != null ) { switch ( ID.valueOf( field.getId() ) ) { case ID_BATCH: value = new Long( trans.getBatchId() );
if ( job != null ) { switch ( ID.valueOf( field.getId() ) ) { case ID_JOB: value = new Long( job.getBatchId() );
Object value = null; if ( subject != null ) { switch ( ID.valueOf( field.getId() ) ) {
Object value = null; if ( subject != null ) { switch ( ID.valueOf( field.getId() ) ) { case ID_BATCH: value = new Long( loggingMetric.getBatchId() );