protected void setGlobalVariablesOfLogTablesNull( List<LogTableInterface> logTables ) { for ( LogTableInterface logTable : logTables ) { if ( logTable instanceof BaseLogTable ) { ( (BaseLogTable) logTable ).setAllGlobalParametersToNull(); } } }
private void initCommonTableFields( BaseLogTable logTable, String value ) { logTable.setTableName( value ); logTable.setConnectionName( value ); logTable.setSchemaName( value ); logTable.setTimeoutInDays( value ); }
@Override public Object clone() { try { JobEntryLogTable table = (JobEntryLogTable) super.clone(); table.fields = new ArrayList<LogTableField>(); for ( LogTableField field : this.fields ) { table.fields.add( (LogTableField) field.clone() ); } return table; } catch ( CloneNotSupportedException e ) { return null; } }
@Override public boolean equals( Object obj ) { if ( obj == null || !( obj instanceof BaseLogTable ) ) { return false; } BaseLogTable blt = (BaseLogTable) obj; // Get actual names for comparison String cName = this.getActualConnectionName(); String sName = this.getActualSchemaName(); String tName = this.getActualTableName(); return ( ( cName == null ? blt.getActualConnectionName() == null : cName .equals( blt.getActualConnectionName() ) ) && ( sName == null ? blt.getActualSchemaName() == null : sName.equals( blt.getActualSchemaName() ) ) && ( tName == null ? blt.getActualTableName() == null : tName.equals( blt.getActualTableName() ) ) ); }
/** * 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() ); } } }
private void commonTableFieldsValueChecker( BaseLogTable logTable, String expectedForAllFields ) { assertEquals( logTable.getTableName(), expectedForAllFields ); assertEquals( logTable.getConnectionName(), expectedForAllFields ); assertEquals( logTable.getSchemaName(), expectedForAllFields ); assertEquals( logTable.getTimeoutInDays(), expectedForAllFields ); } }
attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_CONNECTION_NAME ); if ( connectionNameFromRepository != null ) { connectionName = connectionNameFromRepository; attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_SCHEMA_NAME ); if ( schemaNameFromRepository != null ) { schemaName = schemaNameFromRepository; attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_TABLE_NAME ); if ( tableNameFromRepository != null ) { tableName = tableNameFromRepository; timeoutInDays = attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_TIMEOUT_DAYS ); for ( int i = 0; i < getFields().size(); i++ ) { String id = attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_FIELD_ID + i ); LogTableField field = findField( id ); if ( field != null ) { field.setFieldName( attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_FIELD_NAME + i ) ); field.setEnabled( attributeInterface.getAttributeBoolean( getLogTableCode() + PROP_LOG_TABLE_FIELD_ENABLED + i ) ); if ( field.isSubjectAllowed() ) { field.setSubject( attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_FIELD_SUBJECT + i ) );
public LogTableField findField( ID id ) { return super.findField( id.id ); }
private void deleteLogging( Optional<TransConfiguration> transConfiguration ) { if ( !transConfiguration.isPresent() ) { return; } TransMeta meta = transConfiguration.get().getTransMeta(); if ( meta == null ) { return; } BaseLogTable table = meta.getStepLogTable(); table.setConnectionName( null ); meta.setStepLogTable( (StepLogTable) table ); table = meta.getMetricsLogTable(); table.setConnectionName( null ); meta.setMetricsLogTable( (MetricsLogTable) table ); table = meta.getPerformanceLogTable(); table.setConnectionName( null ); meta.setPerformanceLogTable( (PerformanceLogTable) table ); table = meta.getTransLogTable(); table.setConnectionName( null ); meta.setTransLogTable( (TransLogTable) table ); table = meta.getChannelLogTable(); table.setConnectionName( null ); meta.setChannelLogTable( (ChannelLogTable) table ); }
/** * @return the databaseMeta */ public DatabaseMeta getDatabaseMeta() { String name = getActualConnectionName(); if ( name == null ) { return null; } if ( databasesInterface == null ) { return null; } return databasesInterface.findDatabase( name ); }
public LogTableField findField( ID id ) { return super.findField( id.id ); }
public void setAllTableParamsDefault( BaseLogTable table ) { table.setSchemaName( STRING_DEFAULT ); table.setConnectionName( STRING_DEFAULT ); table.setTimeoutInDays( STRING_DEFAULT ); table.setTableName( STRING_DEFAULT ); table.setFields( new ArrayList<LogTableField>() ); }
@Override public void setAllGlobalParametersToNull() { boolean clearGlobalVariables = Boolean.valueOf( System.getProperties().getProperty( Const.KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT, "false" ) ); if ( clearGlobalVariables ) { super.setAllGlobalParametersToNull(); logInterval = isGlobalParameter( logInterval ) ? null : logInterval; } } }
@Override public Object clone() { try { MetricsLogTable table = (MetricsLogTable) super.clone(); table.fields = new ArrayList<LogTableField>(); for ( LogTableField field : this.fields ) { table.fields.add( (LogTableField) field.clone() ); } return table; } catch ( CloneNotSupportedException e ) { return null; } }
/** * Get the subject of a field with the specified ID * * @param id * @return the subject or null if no field could be find with the specified id */ public Object getSubject( String id ) { LogTableField field = findField( id ); if ( field == null ) { return null; } return field.getSubject(); }
@Override public void setAllGlobalParametersToNull() { boolean clearGlobalVariables = Boolean.valueOf( System.getProperties().getProperty( Const.KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT, "false" ) ); if ( clearGlobalVariables ) { super.setAllGlobalParametersToNull(); logInterval = isGlobalParameter( logInterval ) ? null : logInterval; logSizeLimit = isGlobalParameter( logSizeLimit ) ? null : logSizeLimit; } } }
@Override public Object clone() { try { StepLogTable table = (StepLogTable) super.clone(); table.fields = new ArrayList<LogTableField>(); for ( LogTableField field : this.fields ) { table.fields.add( (LogTableField) field.clone() ); } return table; } catch ( CloneNotSupportedException e ) { return null; } }
/** * Return the subject in the form of a string for the specified ID. * * @param id * the id of the field to look for. * @return the string of the subject (name of step) or null if nothing was found. */ public String getSubjectString( String id ) { LogTableField field = findField( id ); if ( field == null ) { return null; } if ( field.getSubject() == null ) { return null; } return field.getSubject().toString(); }
@Override public void setAllGlobalParametersToNull() { boolean clearGlobalVariables = Boolean.valueOf( System.getProperties().getProperty( Const.KETTLE_GLOBAL_LOG_VARIABLES_CLEAR_ON_EXPORT, "false" ) ); if ( clearGlobalVariables ) { super.setAllGlobalParametersToNull(); logInterval = isGlobalParameter( logInterval ) ? null : logInterval; logSizeLimit = isGlobalParameter( logSizeLimit ) ? null : logSizeLimit; } } }
@Override public Object clone() { try { PerformanceLogTable table = (PerformanceLogTable) super.clone(); table.fields = new ArrayList<LogTableField>(); for ( LogTableField field : this.fields ) { table.fields.add( (LogTableField) field.clone() ); } return table; } catch ( CloneNotSupportedException e ) { return null; } }