use of org.pentaho.di.core.logging.BaseLogTable in project pentaho-kettle by pentaho.
the class XmlExportHelper method swapTables.
/**
* @param jobMeta
* contains log tables to be refactored before export
*/
public static void swapTables(JobMeta jobMeta) {
JobLogTable jobLogTable = jobMeta.getJobLogTable();
if (jobLogTable != null) {
JobLogTable cloneJobLogTable = (JobLogTable) jobLogTable.clone();
cloneJobLogTable.setAllGlobalParametersToNull();
jobMeta.setJobLogTable(cloneJobLogTable);
}
JobEntryLogTable jobEntryLogTable = jobMeta.getJobEntryLogTable();
if (jobEntryLogTable != null) {
JobEntryLogTable cloneEntryLogTable = (JobEntryLogTable) jobEntryLogTable.clone();
cloneEntryLogTable.setAllGlobalParametersToNull();
jobMeta.setJobEntryLogTable(cloneEntryLogTable);
}
ChannelLogTable channelLogTable = jobMeta.getChannelLogTable();
if (channelLogTable != null) {
ChannelLogTable cloneChannelLogTable = (ChannelLogTable) channelLogTable.clone();
cloneChannelLogTable.setAllGlobalParametersToNull();
jobMeta.setChannelLogTable(cloneChannelLogTable);
}
List<LogTableInterface> extraLogTables = jobMeta.getExtraLogTables();
if (extraLogTables != null) {
List<LogTableInterface> cloneExtraLogTables = new ArrayList<>();
for (LogTableInterface logTable : extraLogTables) {
if (logTable instanceof BaseLogTable) {
if (logTable instanceof Cloneable) {
BaseLogTable cloneExtraLogTable = (BaseLogTable) logTable.clone();
cloneExtraLogTable.setAllGlobalParametersToNull();
cloneExtraLogTables.add((LogTableInterface) cloneExtraLogTable);
}
}
}
jobMeta.setExtraLogTables(cloneExtraLogTables);
}
}
Aggregations