Java tutorial
// ============================================================================ // // Copyright (c) 2005-2012, Talend Inc. // // This source code has been automatically generated by_Talend Open Studio for Data Integration // / JobDesigner (CodeGenerator version 5.2.2.r99271) // You can find more information about Talend products at www.talend.com. // You may distribute this code under the terms of the GNU LGPL license // http://www.gnu.org/licenses/lgpl.html). // // ============================================================================ package sqs_dwh.encode_ldap_sqs_0_1; import routines.Checksum; import routines.DataOperation; import routines.Cells; import routines.TalendDataGenerator; import routines.Numeric; import routines.SpectosDate; import routines.Mathematical; import routines.Relational; import routines.TalendDate; import routines.SpectosString; import routines.Postalcode; import routines.TalendString; import routines.StringHandling; import routines.system.*; import routines.system.api.*; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.math.BigDecimal; import java.io.ByteArrayOutputStream; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.ObjectOutputStream; import java.io.ObjectInputStream; import java.io.IOException; import java.util.Comparator; @SuppressWarnings("unused") /** * Job: encode_ldap_sqs Purpose: <br> * Description: <br> * @author test@talend.com * @version 5.2.2.r99271 * @status */ public class encode_ldap_sqs implements TalendJob { public final Object obj = new Object(); // for transmiting parameters purpose private Object valueObject = null; public Object getValueObject() { return this.valueObject; } public void setValueObject(Object valueObject) { this.valueObject = valueObject; } private final static String defaultCharset = java.nio.charset.Charset.defaultCharset().name(); private final static String utf8Charset = "UTF-8"; // create and load default properties private java.util.Properties defaultProps = new java.util.Properties(); // create application properties with default public class ContextProperties extends java.util.Properties { private static final long serialVersionUID = 1L; public ContextProperties(java.util.Properties properties) { super(properties); } public ContextProperties() { super(); } public void synchronizeContext() { if (files_basepath != null) { this.setProperty("files_basepath", files_basepath.toString()); } if (files_basepath_ml != null) { this.setProperty("files_basepath_ml", files_basepath_ml.toString()); } if (basepath != null) { this.setProperty("basepath", basepath.toString()); } if (tempdir != null) { this.setProperty("tempdir", tempdir.toString()); } if (temppath != null) { this.setProperty("temppath", temppath.toString()); } if (spectos_lab_AdditionalParams != null) { this.setProperty("spectos_lab_AdditionalParams", spectos_lab_AdditionalParams.toString()); } if (spectos_lab_Database != null) { this.setProperty("spectos_lab_Database", spectos_lab_Database.toString()); } if (spectos_lab_Login != null) { this.setProperty("spectos_lab_Login", spectos_lab_Login.toString()); } if (spectos_lab_Password != null) { this.setProperty("spectos_lab_Password", spectos_lab_Password.toString()); } if (spectos_lab_Port != null) { this.setProperty("spectos_lab_Port", spectos_lab_Port.toString()); } if (spectos_lab_Server != null) { this.setProperty("spectos_lab_Server", spectos_lab_Server.toString()); } if (spectos_lime_Login != null) { this.setProperty("spectos_lime_Login", spectos_lime_Login.toString()); } if (spectos_lime_Port != null) { this.setProperty("spectos_lime_Port", spectos_lime_Port.toString()); } if (spectos_lime_Server != null) { this.setProperty("spectos_lime_Server", spectos_lime_Server.toString()); } if (spectos_lime_Database != null) { this.setProperty("spectos_lime_Database", spectos_lime_Database.toString()); } if (spectos_lime_AdditionalParams != null) { this.setProperty("spectos_lime_AdditionalParams", spectos_lime_AdditionalParams.toString()); } if (spectos_lime_Password != null) { this.setProperty("spectos_lime_Password", spectos_lime_Password.toString()); } if (spectos_sqs_AdditionalParams != null) { this.setProperty("spectos_sqs_AdditionalParams", spectos_sqs_AdditionalParams.toString()); } if (spectos_sqs_Server != null) { this.setProperty("spectos_sqs_Server", spectos_sqs_Server.toString()); } if (spectos_sqs_Login != null) { this.setProperty("spectos_sqs_Login", spectos_sqs_Login.toString()); } if (spectos_sqs_Password != null) { this.setProperty("spectos_sqs_Password", spectos_sqs_Password.toString()); } if (spectos_sqs_Database != null) { this.setProperty("spectos_sqs_Database", spectos_sqs_Database.toString()); } if (spectos_sqs_Port != null) { this.setProperty("spectos_sqs_Port", spectos_sqs_Port.toString()); } if (inspector_lime_Port != null) { this.setProperty("inspector_lime_Port", inspector_lime_Port.toString()); } if (inspector_lime_Login != null) { this.setProperty("inspector_lime_Login", inspector_lime_Login.toString()); } if (inspector_lime_AdditionalParams != null) { this.setProperty("inspector_lime_AdditionalParams", inspector_lime_AdditionalParams.toString()); } if (inspector_lime_Server != null) { this.setProperty("inspector_lime_Server", inspector_lime_Server.toString()); } if (inspector_lime_Password != null) { this.setProperty("inspector_lime_Password", inspector_lime_Password.toString()); } if (inspector_lime_Database != null) { this.setProperty("inspector_lime_Database", inspector_lime_Database.toString()); } if (dwh_survey_Login != null) { this.setProperty("dwh_survey_Login", dwh_survey_Login.toString()); } if (dwh_survey_Port != null) { this.setProperty("dwh_survey_Port", dwh_survey_Port.toString()); } if (dwh_survey_Database != null) { this.setProperty("dwh_survey_Database", dwh_survey_Database.toString()); } if (dwh_survey_Password != null) { this.setProperty("dwh_survey_Password", dwh_survey_Password.toString()); } if (dwh_survey_AdditionalParams != null) { this.setProperty("dwh_survey_AdditionalParams", dwh_survey_AdditionalParams.toString()); } if (dwh_survey_Server != null) { this.setProperty("dwh_survey_Server", dwh_survey_Server.toString()); } if (spectos_sqs_dwh_freddy_Login != null) { this.setProperty("spectos_sqs_dwh_freddy_Login", spectos_sqs_dwh_freddy_Login.toString()); } if (spectos_sqs_dwh_freddy_Port != null) { this.setProperty("spectos_sqs_dwh_freddy_Port", spectos_sqs_dwh_freddy_Port.toString()); } if (spectos_sqs_dwh_freddy_Password != null) { this.setProperty("spectos_sqs_dwh_freddy_Password", spectos_sqs_dwh_freddy_Password.toString()); } if (spectos_sqs_dwh_freddy_AdditionalParams != null) { this.setProperty("spectos_sqs_dwh_freddy_AdditionalParams", spectos_sqs_dwh_freddy_AdditionalParams.toString()); } if (spectos_sqs_dwh_freddy_Server != null) { this.setProperty("spectos_sqs_dwh_freddy_Server", spectos_sqs_dwh_freddy_Server.toString()); } if (spectos_sqs_dwh_freddy_Database != null) { this.setProperty("spectos_sqs_dwh_freddy_Database", spectos_sqs_dwh_freddy_Database.toString()); } if (spectos_sqs_dwh_lidl_Port != null) { this.setProperty("spectos_sqs_dwh_lidl_Port", spectos_sqs_dwh_lidl_Port.toString()); } if (spectos_sqs_dwh_lidl_Password != null) { this.setProperty("spectos_sqs_dwh_lidl_Password", spectos_sqs_dwh_lidl_Password.toString()); } if (spectos_sqs_dwh_lidl_AdditionalParams != null) { this.setProperty("spectos_sqs_dwh_lidl_AdditionalParams", spectos_sqs_dwh_lidl_AdditionalParams.toString()); } if (spectos_sqs_dwh_lidl_Login != null) { this.setProperty("spectos_sqs_dwh_lidl_Login", spectos_sqs_dwh_lidl_Login.toString()); } if (spectos_sqs_dwh_lidl_Database != null) { this.setProperty("spectos_sqs_dwh_lidl_Database", spectos_sqs_dwh_lidl_Database.toString()); } if (spectos_sqs_dwh_lidl_Server != null) { this.setProperty("spectos_sqs_dwh_lidl_Server", spectos_sqs_dwh_lidl_Server.toString()); } if (spectos_sqs_dwh_nvsp_Database != null) { this.setProperty("spectos_sqs_dwh_nvsp_Database", spectos_sqs_dwh_nvsp_Database.toString()); } if (spectos_sqs_dwh_nvsp_Server != null) { this.setProperty("spectos_sqs_dwh_nvsp_Server", spectos_sqs_dwh_nvsp_Server.toString()); } if (spectos_sqs_dwh_nvsp_AdditionalParams != null) { this.setProperty("spectos_sqs_dwh_nvsp_AdditionalParams", spectos_sqs_dwh_nvsp_AdditionalParams.toString()); } if (spectos_sqs_dwh_nvsp_Port != null) { this.setProperty("spectos_sqs_dwh_nvsp_Port", spectos_sqs_dwh_nvsp_Port.toString()); } if (spectos_sqs_dwh_nvsp_Password != null) { this.setProperty("spectos_sqs_dwh_nvsp_Password", spectos_sqs_dwh_nvsp_Password.toString()); } if (spectos_sqs_dwh_nvsp_Login != null) { this.setProperty("spectos_sqs_dwh_nvsp_Login", spectos_sqs_dwh_nvsp_Login.toString()); } if (ldap_spectos_BindPassword != null) { this.setProperty("ldap_spectos_BindPassword", ldap_spectos_BindPassword.toString()); } if (ldap_spectos_Host != null) { this.setProperty("ldap_spectos_Host", ldap_spectos_Host.toString()); } if (ldap_spectos_Port != null) { this.setProperty("ldap_spectos_Port", ldap_spectos_Port.toString()); } if (ldap_spectos_BindPrincipal != null) { this.setProperty("ldap_spectos_BindPrincipal", ldap_spectos_BindPrincipal.toString()); } if (spectos_ldap_role_epm_user_Host != null) { this.setProperty("spectos_ldap_role_epm_user_Host", spectos_ldap_role_epm_user_Host.toString()); } if (spectos_ldap_role_epm_user_BindPassword != null) { this.setProperty("spectos_ldap_role_epm_user_BindPassword", spectos_ldap_role_epm_user_BindPassword.toString()); } if (spectos_ldap_role_epm_user_Port != null) { this.setProperty("spectos_ldap_role_epm_user_Port", spectos_ldap_role_epm_user_Port.toString()); } if (spectos_ldap_role_epm_user_BindPrincipal != null) { this.setProperty("spectos_ldap_role_epm_user_BindPrincipal", spectos_ldap_role_epm_user_BindPrincipal.toString()); } if (spectos_ldap_role_customer_BindPassword != null) { this.setProperty("spectos_ldap_role_customer_BindPassword", spectos_ldap_role_customer_BindPassword.toString()); } if (spectos_ldap_role_customer_Host != null) { this.setProperty("spectos_ldap_role_customer_Host", spectos_ldap_role_customer_Host.toString()); } if (spectos_ldap_role_customer_BindPrincipal != null) { this.setProperty("spectos_ldap_role_customer_BindPrincipal", spectos_ldap_role_customer_BindPrincipal.toString()); } if (spectos_ldap_role_customer_Port != null) { this.setProperty("spectos_ldap_role_customer_Port", spectos_ldap_role_customer_Port.toString()); } if (spectos_ldap_nvspclaim_test_role_epm_user_Host != null) { this.setProperty("spectos_ldap_nvspclaim_test_role_epm_user_Host", spectos_ldap_nvspclaim_test_role_epm_user_Host.toString()); } if (spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal != null) { this.setProperty("spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal", spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal.toString()); } if (spectos_ldap_nvspclaim_test_role_epm_user_BindPassword != null) { this.setProperty("spectos_ldap_nvspclaim_test_role_epm_user_BindPassword", spectos_ldap_nvspclaim_test_role_epm_user_BindPassword.toString()); } if (spectos_ldap_nvspclaim_test_role_epm_user_Port != null) { this.setProperty("spectos_ldap_nvspclaim_test_role_epm_user_Port", spectos_ldap_nvspclaim_test_role_epm_user_Port.toString()); } if (spectos_ldap_sqs_nvsp_BindPrincipal != null) { this.setProperty("spectos_ldap_sqs_nvsp_BindPrincipal", spectos_ldap_sqs_nvsp_BindPrincipal.toString()); } if (spectos_ldap_sqs_nvsp_Host != null) { this.setProperty("spectos_ldap_sqs_nvsp_Host", spectos_ldap_sqs_nvsp_Host.toString()); } if (spectos_ldap_sqs_nvsp_Port != null) { this.setProperty("spectos_ldap_sqs_nvsp_Port", spectos_ldap_sqs_nvsp_Port.toString()); } if (spectos_ldap_sqs_nvsp_BindPassword != null) { this.setProperty("spectos_ldap_sqs_nvsp_BindPassword", spectos_ldap_sqs_nvsp_BindPassword.toString()); } } public String files_basepath; public String getFiles_basepath() { return this.files_basepath; } public String files_basepath_ml; public String getFiles_basepath_ml() { return this.files_basepath_ml; } public String basepath; public String getBasepath() { return this.basepath; } public String tempdir; public String getTempdir() { return this.tempdir; } public String temppath; public String getTemppath() { return this.temppath; } public String spectos_lab_AdditionalParams; public String getSpectos_lab_AdditionalParams() { return this.spectos_lab_AdditionalParams; } public String spectos_lab_Database; public String getSpectos_lab_Database() { return this.spectos_lab_Database; } public String spectos_lab_Login; public String getSpectos_lab_Login() { return this.spectos_lab_Login; } public java.lang.String spectos_lab_Password; public java.lang.String getSpectos_lab_Password() { return this.spectos_lab_Password; } public Integer spectos_lab_Port; public Integer getSpectos_lab_Port() { return this.spectos_lab_Port; } public String spectos_lab_Server; public String getSpectos_lab_Server() { return this.spectos_lab_Server; } public String spectos_lime_Login; public String getSpectos_lime_Login() { return this.spectos_lime_Login; } public String spectos_lime_Port; public String getSpectos_lime_Port() { return this.spectos_lime_Port; } public String spectos_lime_Server; public String getSpectos_lime_Server() { return this.spectos_lime_Server; } public String spectos_lime_Database; public String getSpectos_lime_Database() { return this.spectos_lime_Database; } public String spectos_lime_AdditionalParams; public String getSpectos_lime_AdditionalParams() { return this.spectos_lime_AdditionalParams; } public java.lang.String spectos_lime_Password; public java.lang.String getSpectos_lime_Password() { return this.spectos_lime_Password; } public String spectos_sqs_AdditionalParams; public String getSpectos_sqs_AdditionalParams() { return this.spectos_sqs_AdditionalParams; } public String spectos_sqs_Server; public String getSpectos_sqs_Server() { return this.spectos_sqs_Server; } public String spectos_sqs_Login; public String getSpectos_sqs_Login() { return this.spectos_sqs_Login; } public java.lang.String spectos_sqs_Password; public java.lang.String getSpectos_sqs_Password() { return this.spectos_sqs_Password; } public String spectos_sqs_Database; public String getSpectos_sqs_Database() { return this.spectos_sqs_Database; } public String spectos_sqs_Port; public String getSpectos_sqs_Port() { return this.spectos_sqs_Port; } public String inspector_lime_Port; public String getInspector_lime_Port() { return this.inspector_lime_Port; } public String inspector_lime_Login; public String getInspector_lime_Login() { return this.inspector_lime_Login; } public String inspector_lime_AdditionalParams; public String getInspector_lime_AdditionalParams() { return this.inspector_lime_AdditionalParams; } public String inspector_lime_Server; public String getInspector_lime_Server() { return this.inspector_lime_Server; } public java.lang.String inspector_lime_Password; public java.lang.String getInspector_lime_Password() { return this.inspector_lime_Password; } public String inspector_lime_Database; public String getInspector_lime_Database() { return this.inspector_lime_Database; } public String dwh_survey_Login; public String getDwh_survey_Login() { return this.dwh_survey_Login; } public String dwh_survey_Port; public String getDwh_survey_Port() { return this.dwh_survey_Port; } public String dwh_survey_Database; public String getDwh_survey_Database() { return this.dwh_survey_Database; } public java.lang.String dwh_survey_Password; public java.lang.String getDwh_survey_Password() { return this.dwh_survey_Password; } public String dwh_survey_AdditionalParams; public String getDwh_survey_AdditionalParams() { return this.dwh_survey_AdditionalParams; } public String dwh_survey_Server; public String getDwh_survey_Server() { return this.dwh_survey_Server; } public String spectos_sqs_dwh_freddy_Login; public String getSpectos_sqs_dwh_freddy_Login() { return this.spectos_sqs_dwh_freddy_Login; } public String spectos_sqs_dwh_freddy_Port; public String getSpectos_sqs_dwh_freddy_Port() { return this.spectos_sqs_dwh_freddy_Port; } public java.lang.String spectos_sqs_dwh_freddy_Password; public java.lang.String getSpectos_sqs_dwh_freddy_Password() { return this.spectos_sqs_dwh_freddy_Password; } public String spectos_sqs_dwh_freddy_AdditionalParams; public String getSpectos_sqs_dwh_freddy_AdditionalParams() { return this.spectos_sqs_dwh_freddy_AdditionalParams; } public String spectos_sqs_dwh_freddy_Server; public String getSpectos_sqs_dwh_freddy_Server() { return this.spectos_sqs_dwh_freddy_Server; } public String spectos_sqs_dwh_freddy_Database; public String getSpectos_sqs_dwh_freddy_Database() { return this.spectos_sqs_dwh_freddy_Database; } public String spectos_sqs_dwh_lidl_Port; public String getSpectos_sqs_dwh_lidl_Port() { return this.spectos_sqs_dwh_lidl_Port; } public java.lang.String spectos_sqs_dwh_lidl_Password; public java.lang.String getSpectos_sqs_dwh_lidl_Password() { return this.spectos_sqs_dwh_lidl_Password; } public String spectos_sqs_dwh_lidl_AdditionalParams; public String getSpectos_sqs_dwh_lidl_AdditionalParams() { return this.spectos_sqs_dwh_lidl_AdditionalParams; } public String spectos_sqs_dwh_lidl_Login; public String getSpectos_sqs_dwh_lidl_Login() { return this.spectos_sqs_dwh_lidl_Login; } public String spectos_sqs_dwh_lidl_Database; public String getSpectos_sqs_dwh_lidl_Database() { return this.spectos_sqs_dwh_lidl_Database; } public String spectos_sqs_dwh_lidl_Server; public String getSpectos_sqs_dwh_lidl_Server() { return this.spectos_sqs_dwh_lidl_Server; } public String spectos_sqs_dwh_nvsp_Database; public String getSpectos_sqs_dwh_nvsp_Database() { return this.spectos_sqs_dwh_nvsp_Database; } public String spectos_sqs_dwh_nvsp_Server; public String getSpectos_sqs_dwh_nvsp_Server() { return this.spectos_sqs_dwh_nvsp_Server; } public String spectos_sqs_dwh_nvsp_AdditionalParams; public String getSpectos_sqs_dwh_nvsp_AdditionalParams() { return this.spectos_sqs_dwh_nvsp_AdditionalParams; } public String spectos_sqs_dwh_nvsp_Port; public String getSpectos_sqs_dwh_nvsp_Port() { return this.spectos_sqs_dwh_nvsp_Port; } public java.lang.String spectos_sqs_dwh_nvsp_Password; public java.lang.String getSpectos_sqs_dwh_nvsp_Password() { return this.spectos_sqs_dwh_nvsp_Password; } public String spectos_sqs_dwh_nvsp_Login; public String getSpectos_sqs_dwh_nvsp_Login() { return this.spectos_sqs_dwh_nvsp_Login; } public java.lang.String ldap_spectos_BindPassword; public java.lang.String getLdap_spectos_BindPassword() { return this.ldap_spectos_BindPassword; } public String ldap_spectos_Host; public String getLdap_spectos_Host() { return this.ldap_spectos_Host; } public Integer ldap_spectos_Port; public Integer getLdap_spectos_Port() { return this.ldap_spectos_Port; } public String ldap_spectos_BindPrincipal; public String getLdap_spectos_BindPrincipal() { return this.ldap_spectos_BindPrincipal; } public String spectos_ldap_role_epm_user_Host; public String getSpectos_ldap_role_epm_user_Host() { return this.spectos_ldap_role_epm_user_Host; } public java.lang.String spectos_ldap_role_epm_user_BindPassword; public java.lang.String getSpectos_ldap_role_epm_user_BindPassword() { return this.spectos_ldap_role_epm_user_BindPassword; } public Integer spectos_ldap_role_epm_user_Port; public Integer getSpectos_ldap_role_epm_user_Port() { return this.spectos_ldap_role_epm_user_Port; } public String spectos_ldap_role_epm_user_BindPrincipal; public String getSpectos_ldap_role_epm_user_BindPrincipal() { return this.spectos_ldap_role_epm_user_BindPrincipal; } public java.lang.String spectos_ldap_role_customer_BindPassword; public java.lang.String getSpectos_ldap_role_customer_BindPassword() { return this.spectos_ldap_role_customer_BindPassword; } public String spectos_ldap_role_customer_Host; public String getSpectos_ldap_role_customer_Host() { return this.spectos_ldap_role_customer_Host; } public String spectos_ldap_role_customer_BindPrincipal; public String getSpectos_ldap_role_customer_BindPrincipal() { return this.spectos_ldap_role_customer_BindPrincipal; } public Integer spectos_ldap_role_customer_Port; public Integer getSpectos_ldap_role_customer_Port() { return this.spectos_ldap_role_customer_Port; } public String spectos_ldap_nvspclaim_test_role_epm_user_Host; public String getSpectos_ldap_nvspclaim_test_role_epm_user_Host() { return this.spectos_ldap_nvspclaim_test_role_epm_user_Host; } public String spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal; public String getSpectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal() { return this.spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal; } public java.lang.String spectos_ldap_nvspclaim_test_role_epm_user_BindPassword; public java.lang.String getSpectos_ldap_nvspclaim_test_role_epm_user_BindPassword() { return this.spectos_ldap_nvspclaim_test_role_epm_user_BindPassword; } public Integer spectos_ldap_nvspclaim_test_role_epm_user_Port; public Integer getSpectos_ldap_nvspclaim_test_role_epm_user_Port() { return this.spectos_ldap_nvspclaim_test_role_epm_user_Port; } public String spectos_ldap_sqs_nvsp_BindPrincipal; public String getSpectos_ldap_sqs_nvsp_BindPrincipal() { return this.spectos_ldap_sqs_nvsp_BindPrincipal; } public String spectos_ldap_sqs_nvsp_Host; public String getSpectos_ldap_sqs_nvsp_Host() { return this.spectos_ldap_sqs_nvsp_Host; } public Integer spectos_ldap_sqs_nvsp_Port; public Integer getSpectos_ldap_sqs_nvsp_Port() { return this.spectos_ldap_sqs_nvsp_Port; } public java.lang.String spectos_ldap_sqs_nvsp_BindPassword; public java.lang.String getSpectos_ldap_sqs_nvsp_BindPassword() { return this.spectos_ldap_sqs_nvsp_BindPassword; } } private ContextProperties context = new ContextProperties(); public ContextProperties getContext() { return this.context; } private final String jobVersion = "0.1"; private final String jobName = "encode_ldap_sqs"; private final String projectName = "SQS_DWH"; public Integer errorCode = null; private String currentComponent = ""; private final java.util.Map<String, Long> start_Hash = new java.util.HashMap<String, Long>(); private final java.util.Map<String, Long> end_Hash = new java.util.HashMap<String, Long>(); private final java.util.Map<String, Boolean> ok_Hash = new java.util.HashMap<String, Boolean>(); private final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>(); public final java.util.List<String[]> globalBuffer = new java.util.ArrayList<String[]>(); private RunStat runStat = new RunStat(); public boolean isExportedAsOSGI = false; // OSGi DataSource private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES"; public void setDataSources(java.util.Map<String, javax.sql.DataSource> dataSources) { java.util.Map<String, routines.system.TalendDataSource> talendDataSources = new java.util.HashMap<String, routines.system.TalendDataSource>(); for (java.util.Map.Entry<String, javax.sql.DataSource> dataSourceEntry : dataSources.entrySet()) { talendDataSources.put(dataSourceEntry.getKey(), new routines.system.TalendDataSource(dataSourceEntry.getValue())); } globalMap.put(KEY_DB_DATASOURCES, talendDataSources); } private final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); private final java.io.PrintStream errorMessagePS = new java.io.PrintStream( new java.io.BufferedOutputStream(baos)); public String getExceptionStackTrace() { if ("failure".equals(this.getStatus())) { errorMessagePS.flush(); return baos.toString(); } return null; } private java.lang.Exception exception = null; public java.lang.Exception getException() { if ("failure".equals(this.getStatus())) { return this.exception; } return null; } private class TalendException extends java.lang.Exception { private static final long serialVersionUID = 1L; private java.util.Map<String, Object> globalMap = null; private java.lang.Exception e = null; private String currentComponent = null; private TalendException(java.lang.Exception e, String errorComponent, final java.util.Map<String, Object> globalMap) { this.currentComponent = errorComponent; this.globalMap = globalMap; this.e = e; } public java.lang.Exception getException() { return this.e; } public String getCurrentComponent() { return this.currentComponent; } @Override public void printStackTrace() { if (!(e instanceof TalendException || e instanceof TDieException)) { globalMap.put(currentComponent + "_ERROR_MESSAGE", e.getMessage()); System.err.println("Exception in component " + currentComponent); } if (!(e instanceof TDieException)) { if (e instanceof TalendException) { e.printStackTrace(); } else { e.printStackTrace(); e.printStackTrace(errorMessagePS); encode_ldap_sqs.this.exception = e; } } if (!(e instanceof TalendException)) { try { for (java.lang.reflect.Method m : this.getClass().getEnclosingClass().getMethods()) { if (m.getName().compareTo(currentComponent + "_error") == 0) { m.invoke(encode_ldap_sqs.this, new Object[] { e, currentComponent, globalMap }); break; } } if (!(e instanceof TDieException)) { } } catch (java.lang.SecurityException e) { this.e.printStackTrace(); } catch (java.lang.IllegalArgumentException e) { this.e.printStackTrace(); } catch (java.lang.IllegalAccessException e) { this.e.printStackTrace(); } catch (java.lang.reflect.InvocationTargetException e) { this.e.printStackTrace(); } } else { status = "failure"; } } } public void tFileInputLDIF_2_error(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException { end_Hash.put("tFileInputLDIF_2", System.currentTimeMillis()); status = "failure"; tFileInputLDIF_2_onSubJobError(exception, errorComponent, globalMap); } public void tMap_1_error(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException { end_Hash.put("tMap_1", System.currentTimeMillis()); status = "failure"; tFileInputLDIF_2_onSubJobError(exception, errorComponent, globalMap); } public void tFilterRow_1_error(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException { end_Hash.put("tFilterRow_1", System.currentTimeMillis()); status = "failure"; tFileInputLDIF_2_onSubJobError(exception, errorComponent, globalMap); } public void tFileOutputLDIF_1_error(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException { end_Hash.put("tFileOutputLDIF_1", System.currentTimeMillis()); status = "failure"; tFileInputLDIF_2_onSubJobError(exception, errorComponent, globalMap); } public void tFileInputLDIF_2_onSubJobError(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException { resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread.currentThread().getId() + "", "FATAL", "", exception.getMessage(), ResumeUtil.getExceptionStackTrace(exception), ""); } private ESBProviderCallback callback = null; public void setProviderCallback(ESBProviderCallback callback) { } public ESBEndpointInfo getEndpoint() { return null; } public static class row1Struct implements routines.system.IPersistableRow<row1Struct> { final static byte[] commonByteArrayLock_SQS_DWH_encode_ldap_sqs = new byte[0]; static byte[] commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[0]; public String dn; public String getDn() { return this.dn; } public String objectClass; public String getObjectClass() { return this.objectClass; } public String uid; public String getUid() { return this.uid; } public String spectos_loginName; public String getSpectos_loginName() { return this.spectos_loginName; } public String cn; public String getCn() { return this.cn; } public String sn; public String getSn() { return this.sn; } public String spectos_email; public String getSpectos_email() { return this.spectos_email; } public String preferredLanguage; public String getPreferredLanguage() { return this.preferredLanguage; } public String userPassword; public String getUserPassword() { return this.userPassword; } public String zupId; public String getZupId() { return this.zupId; } public String userEnabled; public String getUserEnabled() { return this.userEnabled; } public String debitorId; public String getDebitorId() { return this.debitorId; } private String readString(ObjectInputStream dis) throws IOException { String strReturn = null; int length = 0; length = dis.readInt(); if (length == -1) { strReturn = null; } else { if (length > commonByteArray_SQS_DWH_encode_ldap_sqs.length) { if (length < 1024 && commonByteArray_SQS_DWH_encode_ldap_sqs.length == 0) { commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[1024]; } else { commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[2 * length]; } } dis.readFully(commonByteArray_SQS_DWH_encode_ldap_sqs, 0, length); strReturn = new String(commonByteArray_SQS_DWH_encode_ldap_sqs, 0, length, utf8Charset); } return strReturn; } private void writeString(String str, ObjectOutputStream dos) throws IOException { if (str == null) { dos.writeInt(-1); } else { byte[] byteArray = str.getBytes(utf8Charset); dos.writeInt(byteArray.length); dos.write(byteArray); } } public void readData(ObjectInputStream dis) { synchronized (commonByteArrayLock_SQS_DWH_encode_ldap_sqs) { try { int length = 0; this.dn = readString(dis); this.objectClass = readString(dis); this.uid = readString(dis); this.spectos_loginName = readString(dis); this.cn = readString(dis); this.sn = readString(dis); this.spectos_email = readString(dis); this.preferredLanguage = readString(dis); this.userPassword = readString(dis); this.zupId = readString(dis); this.userEnabled = readString(dis); this.debitorId = readString(dis); } catch (IOException e) { throw new RuntimeException(e); } } } public void writeData(ObjectOutputStream dos) { try { // String writeString(this.dn, dos); // String writeString(this.objectClass, dos); // String writeString(this.uid, dos); // String writeString(this.spectos_loginName, dos); // String writeString(this.cn, dos); // String writeString(this.sn, dos); // String writeString(this.spectos_email, dos); // String writeString(this.preferredLanguage, dos); // String writeString(this.userPassword, dos); // String writeString(this.zupId, dos); // String writeString(this.userEnabled, dos); // String writeString(this.debitorId, dos); } catch (IOException e) { throw new RuntimeException(e); } } public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); sb.append("dn=" + dn); sb.append(",objectClass=" + objectClass); sb.append(",uid=" + uid); sb.append(",spectos_loginName=" + spectos_loginName); sb.append(",cn=" + cn); sb.append(",sn=" + sn); sb.append(",spectos_email=" + spectos_email); sb.append(",preferredLanguage=" + preferredLanguage); sb.append(",userPassword=" + userPassword); sb.append(",zupId=" + zupId); sb.append(",userEnabled=" + userEnabled); sb.append(",debitorId=" + debitorId); sb.append("]"); return sb.toString(); } /** * Compare keys */ public int compareTo(row1Struct other) { int returnValue = -1; return returnValue; } private int checkNullsAndCompare(Object object1, Object object2) { int returnValue = 0; if (object1 instanceof Comparable && object2 instanceof Comparable) { returnValue = ((Comparable) object1).compareTo(object2); } else if (object1 != null && object2 != null) { returnValue = compareStrings(object1.toString(), object2.toString()); } else if (object1 == null && object2 != null) { returnValue = 1; } else if (object1 != null && object2 == null) { returnValue = -1; } else { returnValue = 0; } return returnValue; } private int compareStrings(String string1, String string2) { return string1.compareTo(string2); } } public static class out_decode_pwStruct implements routines.system.IPersistableRow<out_decode_pwStruct> { final static byte[] commonByteArrayLock_SQS_DWH_encode_ldap_sqs = new byte[0]; static byte[] commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[0]; public String dn; public String getDn() { return this.dn; } public String objectClass; public String getObjectClass() { return this.objectClass; } public String uid; public String getUid() { return this.uid; } public String spectos_loginName; public String getSpectos_loginName() { return this.spectos_loginName; } public String cn; public String getCn() { return this.cn; } public String sn; public String getSn() { return this.sn; } public String spectos_email; public String getSpectos_email() { return this.spectos_email; } public String preferredLanguage; public String getPreferredLanguage() { return this.preferredLanguage; } public String userPassword; public String getUserPassword() { return this.userPassword; } public String zupId; public String getZupId() { return this.zupId; } public String userEnabled; public String getUserEnabled() { return this.userEnabled; } public String debitorId; public String getDebitorId() { return this.debitorId; } private String readString(ObjectInputStream dis) throws IOException { String strReturn = null; int length = 0; length = dis.readInt(); if (length == -1) { strReturn = null; } else { if (length > commonByteArray_SQS_DWH_encode_ldap_sqs.length) { if (length < 1024 && commonByteArray_SQS_DWH_encode_ldap_sqs.length == 0) { commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[1024]; } else { commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[2 * length]; } } dis.readFully(commonByteArray_SQS_DWH_encode_ldap_sqs, 0, length); strReturn = new String(commonByteArray_SQS_DWH_encode_ldap_sqs, 0, length, utf8Charset); } return strReturn; } private void writeString(String str, ObjectOutputStream dos) throws IOException { if (str == null) { dos.writeInt(-1); } else { byte[] byteArray = str.getBytes(utf8Charset); dos.writeInt(byteArray.length); dos.write(byteArray); } } public void readData(ObjectInputStream dis) { synchronized (commonByteArrayLock_SQS_DWH_encode_ldap_sqs) { try { int length = 0; this.dn = readString(dis); this.objectClass = readString(dis); this.uid = readString(dis); this.spectos_loginName = readString(dis); this.cn = readString(dis); this.sn = readString(dis); this.spectos_email = readString(dis); this.preferredLanguage = readString(dis); this.userPassword = readString(dis); this.zupId = readString(dis); this.userEnabled = readString(dis); this.debitorId = readString(dis); } catch (IOException e) { throw new RuntimeException(e); } } } public void writeData(ObjectOutputStream dos) { try { // String writeString(this.dn, dos); // String writeString(this.objectClass, dos); // String writeString(this.uid, dos); // String writeString(this.spectos_loginName, dos); // String writeString(this.cn, dos); // String writeString(this.sn, dos); // String writeString(this.spectos_email, dos); // String writeString(this.preferredLanguage, dos); // String writeString(this.userPassword, dos); // String writeString(this.zupId, dos); // String writeString(this.userEnabled, dos); // String writeString(this.debitorId, dos); } catch (IOException e) { throw new RuntimeException(e); } } public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); sb.append("dn=" + dn); sb.append(",objectClass=" + objectClass); sb.append(",uid=" + uid); sb.append(",spectos_loginName=" + spectos_loginName); sb.append(",cn=" + cn); sb.append(",sn=" + sn); sb.append(",spectos_email=" + spectos_email); sb.append(",preferredLanguage=" + preferredLanguage); sb.append(",userPassword=" + userPassword); sb.append(",zupId=" + zupId); sb.append(",userEnabled=" + userEnabled); sb.append(",debitorId=" + debitorId); sb.append("]"); return sb.toString(); } /** * Compare keys */ public int compareTo(out_decode_pwStruct other) { int returnValue = -1; return returnValue; } private int checkNullsAndCompare(Object object1, Object object2) { int returnValue = 0; if (object1 instanceof Comparable && object2 instanceof Comparable) { returnValue = ((Comparable) object1).compareTo(object2); } else if (object1 != null && object2 != null) { returnValue = compareStrings(object1.toString(), object2.toString()); } else if (object1 == null && object2 != null) { returnValue = 1; } else if (object1 != null && object2 == null) { returnValue = -1; } else { returnValue = 0; } return returnValue; } private int compareStrings(String string1, String string2) { return string1.compareTo(string2); } } public static class decode_pwStruct implements routines.system.IPersistableRow<decode_pwStruct> { final static byte[] commonByteArrayLock_SQS_DWH_encode_ldap_sqs = new byte[0]; static byte[] commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[0]; public String dn; public String getDn() { return this.dn; } public String objectClass; public String getObjectClass() { return this.objectClass; } public String cn; public String getCn() { return this.cn; } public String sn; public String getSn() { return this.sn; } public String email; public String getEmail() { return this.email; } public String givenName; public String getGivenName() { return this.givenName; } public String preferredLanguage; public String getPreferredLanguage() { return this.preferredLanguage; } public String userPassword; public String getUserPassword() { return this.userPassword; } public String zupId; public String getZupId() { return this.zupId; } public String userEnabled; public String getUserEnabled() { return this.userEnabled; } public String debitorId; public String getDebitorId() { return this.debitorId; } private String readString(ObjectInputStream dis) throws IOException { String strReturn = null; int length = 0; length = dis.readInt(); if (length == -1) { strReturn = null; } else { if (length > commonByteArray_SQS_DWH_encode_ldap_sqs.length) { if (length < 1024 && commonByteArray_SQS_DWH_encode_ldap_sqs.length == 0) { commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[1024]; } else { commonByteArray_SQS_DWH_encode_ldap_sqs = new byte[2 * length]; } } dis.readFully(commonByteArray_SQS_DWH_encode_ldap_sqs, 0, length); strReturn = new String(commonByteArray_SQS_DWH_encode_ldap_sqs, 0, length, utf8Charset); } return strReturn; } private void writeString(String str, ObjectOutputStream dos) throws IOException { if (str == null) { dos.writeInt(-1); } else { byte[] byteArray = str.getBytes(utf8Charset); dos.writeInt(byteArray.length); dos.write(byteArray); } } public void readData(ObjectInputStream dis) { synchronized (commonByteArrayLock_SQS_DWH_encode_ldap_sqs) { try { int length = 0; this.dn = readString(dis); this.objectClass = readString(dis); this.cn = readString(dis); this.sn = readString(dis); this.email = readString(dis); this.givenName = readString(dis); this.preferredLanguage = readString(dis); this.userPassword = readString(dis); this.zupId = readString(dis); this.userEnabled = readString(dis); this.debitorId = readString(dis); } catch (IOException e) { throw new RuntimeException(e); } } } public void writeData(ObjectOutputStream dos) { try { // String writeString(this.dn, dos); // String writeString(this.objectClass, dos); // String writeString(this.cn, dos); // String writeString(this.sn, dos); // String writeString(this.email, dos); // String writeString(this.givenName, dos); // String writeString(this.preferredLanguage, dos); // String writeString(this.userPassword, dos); // String writeString(this.zupId, dos); // String writeString(this.userEnabled, dos); // String writeString(this.debitorId, dos); } catch (IOException e) { throw new RuntimeException(e); } } public String toString() { StringBuilder sb = new StringBuilder(); sb.append(super.toString()); sb.append("["); sb.append("dn=" + dn); sb.append(",objectClass=" + objectClass); sb.append(",cn=" + cn); sb.append(",sn=" + sn); sb.append(",email=" + email); sb.append(",givenName=" + givenName); sb.append(",preferredLanguage=" + preferredLanguage); sb.append(",userPassword=" + userPassword); sb.append(",zupId=" + zupId); sb.append(",userEnabled=" + userEnabled); sb.append(",debitorId=" + debitorId); sb.append("]"); return sb.toString(); } /** * Compare keys */ public int compareTo(decode_pwStruct other) { int returnValue = -1; return returnValue; } private int checkNullsAndCompare(Object object1, Object object2) { int returnValue = 0; if (object1 instanceof Comparable && object2 instanceof Comparable) { returnValue = ((Comparable) object1).compareTo(object2); } else if (object1 != null && object2 != null) { returnValue = compareStrings(object1.toString(), object2.toString()); } else if (object1 == null && object2 != null) { returnValue = 1; } else if (object1 != null && object2 == null) { returnValue = -1; } else { returnValue = 0; } return returnValue; } private int compareStrings(String string1, String string2) { return string1.compareTo(string2); } } public void tFileInputLDIF_2Process(final java.util.Map<String, Object> globalMap) throws TalendException { globalMap.put("tFileInputLDIF_2_SUBPROCESS_STATE", 0); final boolean execStat = this.execStat; String iterateId = ""; int iterateLoop = 0; String currentComponent = ""; try { String currentMethodName = new java.lang.Exception().getStackTrace()[0].getMethodName(); boolean resumeIt = currentMethodName.equals(resumeEntryMethodName); if (resumeEntryMethodName == null || resumeIt || globalResumeTicket) {// start // the // resume globalResumeTicket = true; decode_pwStruct decode_pw = new decode_pwStruct(); out_decode_pwStruct out_decode_pw = new out_decode_pwStruct(); row1Struct row1 = new row1Struct(); /** * [tFileOutputLDIF_1 begin ] start */ ok_Hash.put("tFileOutputLDIF_1", false); start_Hash.put("tFileOutputLDIF_1", System.currentTimeMillis()); currentComponent = "tFileOutputLDIF_1"; if (execStat) { java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_row1 = (java.util.concurrent.ConcurrentHashMap) globalMap .get("concurrentHashMap"); concurrentHashMap_row1.putIfAbsent("row1" + iterateLoop, new java.util.concurrent.atomic.AtomicInteger(0)); java.util.concurrent.atomic.AtomicInteger stats_row1 = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_row1 .get("row1" + iterateLoop); runStat.updateStatOnConnection("row1" + iterateId, stats_row1.incrementAndGet() <= 1 ? 0 : 1, 0); } int tos_count_tFileOutputLDIF_1 = 0; java.io.File file_tFileOutputLDIF_1 = new java.io.File( "D:/projects/spectos/sqs/trunk/etl/SQS_DWH/data/scout2/file4_new.ldif"); // create directory only if not exists java.io.File parentFile_tFileOutputLDIF_1 = file_tFileOutputLDIF_1.getParentFile(); if (parentFile_tFileOutputLDIF_1 != null && !parentFile_tFileOutputLDIF_1.exists()) { parentFile_tFileOutputLDIF_1.mkdirs(); } class Util_tFileOutputLDIF_1 { public void breakString(StringBuilder pw, String value, int max) { int leftToGo = value.length(); int written = 0; int maxChars = max; while (leftToGo > 0) { int toWrite = Math.min(maxChars, leftToGo); String s = value.substring(written, written + toWrite); if (written != 0) { pw.append(" " + s); } else { pw.append(s); maxChars -= 1; } written += toWrite; leftToGo -= toWrite; pw.append('\n'); } } public String getBase64StringOrNot(boolean encodingBase64, String srcData, String encoding) { String returnValue = ""; try { if (encodingBase64 && !netscape.ldap.util.LDIF.isPrintable(srcData.getBytes(encoding))) { returnValue = org.apache.commons.codec.binary.Base64 .encodeBase64String(srcData.getBytes(encoding)); } else { returnValue = srcData; } } catch (java.lang.Exception e) { e.printStackTrace(); } return returnValue; } } Util_tFileOutputLDIF_1 util_tFileOutputLDIF_1 = new Util_tFileOutputLDIF_1(); int nb_line_tFileOutputLDIF_1 = 0; final String dn_tFileOutputLDIF_1 = "dn: "; final String changetype_tFileOutputLDIF_1 = "changetype: "; final int wrap_tFileOutputLDIF_1 = 78; java.io.PrintWriter pw_tFileOutputLDIF_1 = new java.io.PrintWriter(file_tFileOutputLDIF_1, "ISO-8859-15"); if (file_tFileOutputLDIF_1.length() == 0) { pw_tFileOutputLDIF_1.write("version: 1\n"); } /** * [tFileOutputLDIF_1 begin ] stop */ /** * [tFilterRow_1 begin ] start */ ok_Hash.put("tFilterRow_1", false); start_Hash.put("tFilterRow_1", System.currentTimeMillis()); currentComponent = "tFilterRow_1"; if (execStat) { java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_out_decode_pw = (java.util.concurrent.ConcurrentHashMap) globalMap .get("concurrentHashMap"); concurrentHashMap_out_decode_pw.putIfAbsent("out_decode_pw" + iterateLoop, new java.util.concurrent.atomic.AtomicInteger(0)); java.util.concurrent.atomic.AtomicInteger stats_out_decode_pw = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_out_decode_pw .get("out_decode_pw" + iterateLoop); runStat.updateStatOnConnection("out_decode_pw" + iterateId, stats_out_decode_pw.incrementAndGet() <= 1 ? 0 : 1, 0); } int tos_count_tFilterRow_1 = 0; int nb_line_tFilterRow_1 = 0; int nb_line_ok_tFilterRow_1 = 0; int nb_line_reject_tFilterRow_1 = 0; class Operator_tFilterRow_1 { private String sErrorMsg = ""; private boolean bMatchFlag = true; private String sUnionFlag = "&&"; public Operator_tFilterRow_1(String unionFlag) { sUnionFlag = unionFlag; bMatchFlag = "||".equals(unionFlag) ? false : true; } public String getErrorMsg() { if (sErrorMsg != null && sErrorMsg.length() > 1) return sErrorMsg.substring(1); else return null; } public boolean getMatchFlag() { return bMatchFlag; } public void matches(boolean partMatched, String reason) { // no need to care about the next judgement if ("||".equals(sUnionFlag) && bMatchFlag) { return; } if (!partMatched) { sErrorMsg += "|" + reason; } if ("||".equals(sUnionFlag)) bMatchFlag = bMatchFlag || partMatched; else bMatchFlag = bMatchFlag && partMatched; } } /** * [tFilterRow_1 begin ] stop */ /** * [tMap_1 begin ] start */ ok_Hash.put("tMap_1", false); start_Hash.put("tMap_1", System.currentTimeMillis()); currentComponent = "tMap_1"; if (execStat) { java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_decode_pw = (java.util.concurrent.ConcurrentHashMap) globalMap .get("concurrentHashMap"); concurrentHashMap_decode_pw.putIfAbsent("decode_pw" + iterateLoop, new java.util.concurrent.atomic.AtomicInteger(0)); java.util.concurrent.atomic.AtomicInteger stats_decode_pw = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_decode_pw .get("decode_pw" + iterateLoop); runStat.updateStatOnConnection("decode_pw" + iterateId, stats_decode_pw.incrementAndGet() <= 1 ? 0 : 1, 0); } int tos_count_tMap_1 = 0; // ############################### // # Lookup's keys initialization // ############################### // ############################### // # Vars initialization class Var__tMap_1__Struct { String var1; String var2; } Var__tMap_1__Struct Var__tMap_1 = new Var__tMap_1__Struct(); // ############################### // ############################### // # Outputs initialization out_decode_pwStruct out_decode_pw_tmp = new out_decode_pwStruct(); // ############################### /** * [tMap_1 begin ] stop */ /** * [tFileInputLDIF_2 begin ] start */ ok_Hash.put("tFileInputLDIF_2", false); start_Hash.put("tFileInputLDIF_2", System.currentTimeMillis()); currentComponent = "tFileInputLDIF_2"; int tos_count_tFileInputLDIF_2 = 0; // ///////////////////////////////// netscape.ldap.util.LDIF ldif_tFileInputLDIF_2 = new netscape.ldap.util.LDIF( "D:/projects/spectos/sqs/trunk/etl/SQS_DWH/data/scout2/file3.ldif"); String[] filters_tFileInputLDIF_2 = new String[] { "dn", "objectClass", "cn", "sn", "email", "givenName", "preferredLanguage", "userPassword", "zupId", "userEnabled", "debitorId", }; String[] filters_binary_tFileInputLDIF_2 = new String[] { "dn;binary", "objectClass;binary", "cn;binary", "sn;binary", "email;binary", "givenName;binary", "preferredLanguage;binary", "userPassword;binary", "zupId;binary", "userEnabled;binary", "debitorId;binary", }; String[] results_tFileInputLDIF_2 = null; List<List<byte[]>> resultsBinary_tFileInputLDIF_2 = null; int nb_line_tFileInputLDIF_2 = 0; // ///////////////////////////////// for (netscape.ldap.util.LDIFRecord record_tFileInputLDIF_2 = ldif_tFileInputLDIF_2 .nextRecord(); record_tFileInputLDIF_2 != null; record_tFileInputLDIF_2 = ldif_tFileInputLDIF_2 .nextRecord()) { results_tFileInputLDIF_2 = new String[11]; resultsBinary_tFileInputLDIF_2 = new java.util.ArrayList<List<byte[]>>(); netscape.ldap.util.LDIFContent content_tFileInputLDIF_2 = record_tFileInputLDIF_2.getContent(); netscape.ldap.LDAPAttribute[] attributes_tFileInputLDIF_2 = null; switch (content_tFileInputLDIF_2.getType()) { case netscape.ldap.util.LDIFContent.ATTRIBUTE_CONTENT: netscape.ldap.util.LDIFAttributeContent attrContent_tFileInputLDIF_2 = (netscape.ldap.util.LDIFAttributeContent) content_tFileInputLDIF_2; attributes_tFileInputLDIF_2 = attrContent_tFileInputLDIF_2.getAttributes(); for (int i_tFileInputLDIF_2 = 0; i_tFileInputLDIF_2 < filters_tFileInputLDIF_2.length; i_tFileInputLDIF_2++) { resultsBinary_tFileInputLDIF_2.add(new java.util.ArrayList<byte[]>()); for (int j_tFileInputLDIF_2 = 0; j_tFileInputLDIF_2 < attributes_tFileInputLDIF_2.length; j_tFileInputLDIF_2++) { netscape.ldap.LDAPAttribute attribute_tFileInputLDIF_2 = attributes_tFileInputLDIF_2[j_tFileInputLDIF_2]; if ("dn".equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = record_tFileInputLDIF_2.getDN(); } else { if (filters_tFileInputLDIF_2[i_tFileInputLDIF_2] .equalsIgnoreCase(attribute_tFileInputLDIF_2.getName()) || filters_binary_tFileInputLDIF_2[i_tFileInputLDIF_2] .equalsIgnoreCase(attribute_tFileInputLDIF_2.getName())) { byte[][] values_tFileInputLDIF_2 = attribute_tFileInputLDIF_2 .getByteValueArray(); for (byte[] byteValue_tFileInputLDIF_2 : values_tFileInputLDIF_2) { String value_tFileInputLDIF_2 = netscape.ldap.util.LDIF .toPrintableString(byteValue_tFileInputLDIF_2); resultsBinary_tFileInputLDIF_2.get(i_tFileInputLDIF_2) .add(value_tFileInputLDIF_2.getBytes("ISO-8859-15")); results_tFileInputLDIF_2[i_tFileInputLDIF_2] = results_tFileInputLDIF_2[i_tFileInputLDIF_2] == null ? value_tFileInputLDIF_2 : results_tFileInputLDIF_2[i_tFileInputLDIF_2] + "," + value_tFileInputLDIF_2; } } } } } break; case netscape.ldap.util.LDIFContent.ADD_CONTENT: netscape.ldap.util.LDIFAddContent addContent_tFileInputLDIF_2 = (netscape.ldap.util.LDIFAddContent) content_tFileInputLDIF_2; attributes_tFileInputLDIF_2 = addContent_tFileInputLDIF_2.getAttributes(); for (int i_tFileInputLDIF_2 = 0; i_tFileInputLDIF_2 < filters_tFileInputLDIF_2.length; i_tFileInputLDIF_2++) { resultsBinary_tFileInputLDIF_2.add(new java.util.ArrayList<byte[]>()); for (int j_tFileInputLDIF_2 = 0; j_tFileInputLDIF_2 < attributes_tFileInputLDIF_2.length; j_tFileInputLDIF_2++) { netscape.ldap.LDAPAttribute attribute_tFileInputLDIF_2 = attributes_tFileInputLDIF_2[j_tFileInputLDIF_2]; if ("dn".equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = record_tFileInputLDIF_2.getDN(); } else if ("changetype" .equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = "add"; } else { if (filters_tFileInputLDIF_2[i_tFileInputLDIF_2] .equalsIgnoreCase(attribute_tFileInputLDIF_2.getName()) || filters_binary_tFileInputLDIF_2[i_tFileInputLDIF_2] .equalsIgnoreCase(attribute_tFileInputLDIF_2.getName())) { byte[][] values_tFileInputLDIF_2 = attribute_tFileInputLDIF_2 .getByteValueArray(); for (byte[] byteValue_tFileInputLDIF_2 : values_tFileInputLDIF_2) { String value_tFileInputLDIF_2 = netscape.ldap.util.LDIF .toPrintableString(byteValue_tFileInputLDIF_2); resultsBinary_tFileInputLDIF_2.get(i_tFileInputLDIF_2) .add(value_tFileInputLDIF_2.getBytes("ISO-8859-15")); results_tFileInputLDIF_2[i_tFileInputLDIF_2] = results_tFileInputLDIF_2[i_tFileInputLDIF_2] == null ? value_tFileInputLDIF_2 : results_tFileInputLDIF_2[i_tFileInputLDIF_2] + "," + value_tFileInputLDIF_2; } } } } } break; case netscape.ldap.util.LDIFContent.MODIFICATION_CONTENT: netscape.ldap.util.LDIFModifyContent modifyContent_tFileInputLDIF_2 = (netscape.ldap.util.LDIFModifyContent) content_tFileInputLDIF_2; netscape.ldap.LDAPModification[] modifications_tFileInputLDIF_2 = modifyContent_tFileInputLDIF_2 .getModifications(); for (int i_tFileInputLDIF_2 = 0; i_tFileInputLDIF_2 < filters_tFileInputLDIF_2.length; i_tFileInputLDIF_2++) { resultsBinary_tFileInputLDIF_2.add(new java.util.ArrayList<byte[]>()); for (netscape.ldap.LDAPModification modification_tFileInputLDIF_2 : modifications_tFileInputLDIF_2) { netscape.ldap.LDAPAttribute attribute_tFileInputLDIF_2 = modification_tFileInputLDIF_2 .getAttribute(); if ("dn".equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = record_tFileInputLDIF_2.getDN(); } else if ("changetype" .equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = "modify"; } else { if (filters_tFileInputLDIF_2[i_tFileInputLDIF_2] .equalsIgnoreCase(attribute_tFileInputLDIF_2.getName()) || filters_binary_tFileInputLDIF_2[i_tFileInputLDIF_2] .equalsIgnoreCase(attribute_tFileInputLDIF_2.getName())) { byte[][] values_tFileInputLDIF_2 = attribute_tFileInputLDIF_2 .getByteValueArray(); boolean firstLoop_tFileInputLDIF_2 = true; for (byte[] byteValue_tFileInputLDIF_2 : values_tFileInputLDIF_2) { String value_tFileInputLDIF_2 = netscape.ldap.util.LDIF .toPrintableString(byteValue_tFileInputLDIF_2); resultsBinary_tFileInputLDIF_2.get(i_tFileInputLDIF_2) .add(value_tFileInputLDIF_2.getBytes("ISO-8859-15")); if (firstLoop_tFileInputLDIF_2) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = results_tFileInputLDIF_2[i_tFileInputLDIF_2] == null ? value_tFileInputLDIF_2 : results_tFileInputLDIF_2[i_tFileInputLDIF_2] + ":" + value_tFileInputLDIF_2; } else { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = results_tFileInputLDIF_2[i_tFileInputLDIF_2] + "," + value_tFileInputLDIF_2; } firstLoop_tFileInputLDIF_2 = false; } } } } } break; case netscape.ldap.util.LDIFContent.DELETE_CONTENT: // netscape.ldap.util.LDIFDeleteContent // deleteContent_tFileInputLDIF_2 = // (netscape.ldap.util.LDIFDeleteContent) // content_tFileInputLDIF_2; for (int i_tFileInputLDIF_2 = 0; i_tFileInputLDIF_2 < filters_tFileInputLDIF_2.length; i_tFileInputLDIF_2++) { if ("dn".equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = record_tFileInputLDIF_2.getDN(); } else if ("changetype" .equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = "delete"; } } break; case netscape.ldap.util.LDIFContent.MODDN_CONTENT: netscape.ldap.util.LDIFModDNContent moddnContent_tFileInputLDIF_2 = (netscape.ldap.util.LDIFModDNContent) content_tFileInputLDIF_2; for (int i_tFileInputLDIF_2 = 0; i_tFileInputLDIF_2 < filters_tFileInputLDIF_2.length; i_tFileInputLDIF_2++) { if ("dn".equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = record_tFileInputLDIF_2.getDN(); } else if ("changetype" .equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = "modrdn"; } else if ("newrdn".equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = moddnContent_tFileInputLDIF_2 .getRDN(); } else if ("deleteoldrdn" .equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = Boolean .toString(moddnContent_tFileInputLDIF_2.getDeleteOldRDN()); } else if ("newsuperior" .equalsIgnoreCase(filters_tFileInputLDIF_2[i_tFileInputLDIF_2])) { results_tFileInputLDIF_2[i_tFileInputLDIF_2] = moddnContent_tFileInputLDIF_2 .getNewParent(); } } break; default: } nb_line_tFileInputLDIF_2++; // for output decode_pw = null; boolean whetherReject_tFileInputLDIF_2 = false; decode_pw = new decode_pwStruct(); try { if (0 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[0] != null) { decode_pw.dn = results_tFileInputLDIF_2[0]; } else { decode_pw.dn = null; } if (1 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[1] != null) { decode_pw.objectClass = results_tFileInputLDIF_2[1]; } else { decode_pw.objectClass = null; } if (2 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[2] != null) { decode_pw.cn = results_tFileInputLDIF_2[2]; } else { decode_pw.cn = null; } if (3 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[3] != null) { decode_pw.sn = results_tFileInputLDIF_2[3]; } else { decode_pw.sn = null; } if (4 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[4] != null) { decode_pw.email = results_tFileInputLDIF_2[4]; } else { decode_pw.email = null; } if (5 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[5] != null) { decode_pw.givenName = results_tFileInputLDIF_2[5]; } else { decode_pw.givenName = null; } if (6 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[6] != null) { decode_pw.preferredLanguage = results_tFileInputLDIF_2[6]; } else { decode_pw.preferredLanguage = null; } if (7 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[7] != null) { decode_pw.userPassword = results_tFileInputLDIF_2[7]; } else { decode_pw.userPassword = null; } if (8 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[8] != null) { decode_pw.zupId = results_tFileInputLDIF_2[8]; } else { decode_pw.zupId = null; } if (9 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[9] != null) { decode_pw.userEnabled = results_tFileInputLDIF_2[9]; } else { decode_pw.userEnabled = null; } if (10 < results_tFileInputLDIF_2.length && results_tFileInputLDIF_2[10] != null) { decode_pw.debitorId = results_tFileInputLDIF_2[10]; } else { decode_pw.debitorId = null; } } catch (java.lang.Exception e) { whetherReject_tFileInputLDIF_2 = true; System.err.println(e.getMessage()); decode_pw = null; } // ///////////////////////////////// /** * [tFileInputLDIF_2 begin ] stop */ /** * [tFileInputLDIF_2 main ] start */ currentComponent = "tFileInputLDIF_2"; tos_count_tFileInputLDIF_2++; /** * [tFileInputLDIF_2 main ] stop */ // Start of branch "decode_pw" if (decode_pw != null) { /** * [tMap_1 main ] start */ currentComponent = "tMap_1"; // decode_pw // decode_pw if (execStat) { runStat.updateStatOnConnection("decode_pw" + iterateId, 1, 1); } boolean hasCasePrimitiveKeyWithNull_tMap_1 = false; // ############################### // # Input tables (lookups) boolean rejectedInnerJoin_tMap_1 = false; boolean mainRowRejected_tMap_1 = false; // ############################### { // start of Var scope // ############################### // # Vars tables Var__tMap_1__Struct Var = Var__tMap_1; Var.var1 = java.util.UUID.randomUUID().toString(); Var.var2 = decode_pw.dn.substring(decode_pw.dn.indexOf(","));// ############################### // ############################### // # Output tables out_decode_pw = null; // # Output table : 'out_decode_pw' out_decode_pw_tmp.dn = "uid=" + Var.var1 + Var.var2; out_decode_pw_tmp.objectClass = decode_pw.objectClass; out_decode_pw_tmp.uid = Var.var1; out_decode_pw_tmp.spectos_loginName = decode_pw.cn; out_decode_pw_tmp.cn = decode_pw.cn; out_decode_pw_tmp.sn = decode_pw.sn; out_decode_pw_tmp.spectos_email = decode_pw.email; out_decode_pw_tmp.preferredLanguage = decode_pw.preferredLanguage; out_decode_pw_tmp.userPassword = new String(org.apache.commons.codec.binary.Base64 .encodeBase64(decode_pw.userPassword.getBytes())); out_decode_pw_tmp.zupId = decode_pw.zupId; out_decode_pw_tmp.userEnabled = decode_pw.userEnabled; out_decode_pw_tmp.debitorId = decode_pw.debitorId; out_decode_pw = out_decode_pw_tmp; // ############################### } // end of Var scope rejectedInnerJoin_tMap_1 = false; tos_count_tMap_1++; /** * [tMap_1 main ] stop */ // Start of branch "out_decode_pw" if (out_decode_pw != null) { /** * [tFilterRow_1 main ] start */ currentComponent = "tFilterRow_1"; // out_decode_pw // out_decode_pw if (execStat) { runStat.updateStatOnConnection("out_decode_pw" + iterateId, 1, 1); } row1 = null; Operator_tFilterRow_1 ope_tFilterRow_1 = new Operator_tFilterRow_1("&&"); ope_tFilterRow_1.matches((out_decode_pw.cn.startsWith("049") == true ), "advanced condition failed"); if (ope_tFilterRow_1.getMatchFlag()) { if (row1 == null) { row1 = new row1Struct(); } row1.dn = out_decode_pw.dn; row1.objectClass = out_decode_pw.objectClass; row1.uid = out_decode_pw.uid; row1.spectos_loginName = out_decode_pw.spectos_loginName; row1.cn = out_decode_pw.cn; row1.sn = out_decode_pw.sn; row1.spectos_email = out_decode_pw.spectos_email; row1.preferredLanguage = out_decode_pw.preferredLanguage; row1.userPassword = out_decode_pw.userPassword; row1.zupId = out_decode_pw.zupId; row1.userEnabled = out_decode_pw.userEnabled; row1.debitorId = out_decode_pw.debitorId; nb_line_ok_tFilterRow_1++; } else { nb_line_reject_tFilterRow_1++; } nb_line_tFilterRow_1++; tos_count_tFilterRow_1++; /** * [tFilterRow_1 main ] stop */ // Start of branch "row1" if (row1 != null) { /** * [tFileOutputLDIF_1 main ] start */ currentComponent = "tFileOutputLDIF_1"; // row1 // row1 if (execStat) { runStat.updateStatOnConnection("row1" + iterateId, 1, 1); } // //////////////////////// boolean encodingBase64 = false; StringBuilder sb_tFileOutputLDIF_1 = new StringBuilder(); boolean needSeparator_tFileOutputLDIF_1 = false; boolean canOutput_tFileOutputLDIF_1 = false; boolean isPrintable_tFileOutputLDIF_1 = false; encodingBase64 = false; String value_dn_tFileOutputLDIF_1 = ""; if (row1.dn != null && !("").equals(row1.dn)) { value_dn_tFileOutputLDIF_1 = row1.dn; util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, dn_tFileOutputLDIF_1 + value_dn_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); } encodingBase64 = false; String value_objectClass_tFileOutputLDIF_1 = ""; if (row1.objectClass != null && !("").equals(row1.objectClass)) { value_objectClass_tFileOutputLDIF_1 = row1.objectClass; String[] values_objectClass_tFileOutputLDIF_1 = value_objectClass_tFileOutputLDIF_1 .split(","); for (String item_tFileOutputLDIF_1 : values_objectClass_tFileOutputLDIF_1) { // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF .isPrintable(item_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, // it must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } else { encodingBase64 = false; } // Add ":" to comply with base64 ldif // syntax item_tFileOutputLDIF_1 = util_tFileOutputLDIF_1.getBase64StringOrNot( encodingBase64, item_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "objectClass: " + item_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); } canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_uid_tFileOutputLDIF_1 = ""; if (row1.uid != null && !("").equals(row1.uid)) { value_uid_tFileOutputLDIF_1 = row1.uid; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF .isPrintable(value_uid_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_uid_tFileOutputLDIF_1 = util_tFileOutputLDIF_1.getBase64StringOrNot( encodingBase64, value_uid_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "uid: " + value_uid_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_spectos_loginName_tFileOutputLDIF_1 = ""; if (row1.spectos_loginName != null && !("").equals(row1.spectos_loginName)) { value_spectos_loginName_tFileOutputLDIF_1 = row1.spectos_loginName; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF.isPrintable( value_spectos_loginName_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_spectos_loginName_tFileOutputLDIF_1 = util_tFileOutputLDIF_1 .getBase64StringOrNot(encodingBase64, value_spectos_loginName_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "spectos_loginName: " + value_spectos_loginName_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_cn_tFileOutputLDIF_1 = ""; if (row1.cn != null && !("").equals(row1.cn)) { value_cn_tFileOutputLDIF_1 = row1.cn; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF .isPrintable(value_cn_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_cn_tFileOutputLDIF_1 = util_tFileOutputLDIF_1.getBase64StringOrNot( encodingBase64, value_cn_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "cn: " + value_cn_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_sn_tFileOutputLDIF_1 = ""; if (row1.sn != null && !("").equals(row1.sn)) { value_sn_tFileOutputLDIF_1 = row1.sn; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF .isPrintable(value_sn_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_sn_tFileOutputLDIF_1 = util_tFileOutputLDIF_1.getBase64StringOrNot( encodingBase64, value_sn_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "sn: " + value_sn_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_spectos_email_tFileOutputLDIF_1 = ""; if (row1.spectos_email != null && !("").equals(row1.spectos_email)) { value_spectos_email_tFileOutputLDIF_1 = row1.spectos_email; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF.isPrintable( value_spectos_email_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_spectos_email_tFileOutputLDIF_1 = util_tFileOutputLDIF_1 .getBase64StringOrNot(encodingBase64, value_spectos_email_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "spectos_email: " + value_spectos_email_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_preferredLanguage_tFileOutputLDIF_1 = ""; if (row1.preferredLanguage != null && !("").equals(row1.preferredLanguage)) { value_preferredLanguage_tFileOutputLDIF_1 = row1.preferredLanguage; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF.isPrintable( value_preferredLanguage_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_preferredLanguage_tFileOutputLDIF_1 = util_tFileOutputLDIF_1 .getBase64StringOrNot(encodingBase64, value_preferredLanguage_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "preferredLanguage: " + value_preferredLanguage_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_userPassword_tFileOutputLDIF_1 = ""; if (row1.userPassword != null && !("").equals(row1.userPassword)) { value_userPassword_tFileOutputLDIF_1 = row1.userPassword; // Convert binary or Base64 value to Base64 // encoded string encodingBase64 = true; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF.isPrintable( value_userPassword_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // Add ":" to comply with base64 ldif syntax value_userPassword_tFileOutputLDIF_1 = util_tFileOutputLDIF_1 .getBase64StringOrNot(encodingBase64, value_userPassword_tFileOutputLDIF_1, "ISO-8859-15"); if (!isPrintable_tFileOutputLDIF_1) { util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "userPassword:: " + value_userPassword_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); } else { util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "userPassword: " + value_userPassword_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); } canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_zupId_tFileOutputLDIF_1 = ""; if (row1.zupId != null && !("").equals(row1.zupId)) { value_zupId_tFileOutputLDIF_1 = row1.zupId; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF .isPrintable(value_zupId_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_zupId_tFileOutputLDIF_1 = util_tFileOutputLDIF_1.getBase64StringOrNot( encodingBase64, value_zupId_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "zupId: " + value_zupId_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_userEnabled_tFileOutputLDIF_1 = ""; if (row1.userEnabled != null && !("").equals(row1.userEnabled)) { value_userEnabled_tFileOutputLDIF_1 = row1.userEnabled; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF.isPrintable( value_userEnabled_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_userEnabled_tFileOutputLDIF_1 = util_tFileOutputLDIF_1 .getBase64StringOrNot(encodingBase64, value_userEnabled_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "userEnabled: " + value_userEnabled_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } encodingBase64 = false; String value_debitorId_tFileOutputLDIF_1 = ""; if (row1.debitorId != null && !("").equals(row1.debitorId)) { value_debitorId_tFileOutputLDIF_1 = row1.debitorId; // follow LDIF rules or not isPrintable_tFileOutputLDIF_1 = netscape.ldap.util.LDIF .isPrintable(value_debitorId_tFileOutputLDIF_1.getBytes("ISO-8859-15")); // If content doesn't follow LDIF rules, it // must be base64 encoded if (!isPrintable_tFileOutputLDIF_1) { encodingBase64 = true; } // Add ":" to comply with base64 ldif syntax value_debitorId_tFileOutputLDIF_1 = util_tFileOutputLDIF_1.getBase64StringOrNot( encodingBase64, value_debitorId_tFileOutputLDIF_1, "ISO-8859-15"); util_tFileOutputLDIF_1.breakString(sb_tFileOutputLDIF_1, "debitorId: " + value_debitorId_tFileOutputLDIF_1, wrap_tFileOutputLDIF_1); canOutput_tFileOutputLDIF_1 = true; } sb_tFileOutputLDIF_1.append('\n'); if (canOutput_tFileOutputLDIF_1) { pw_tFileOutputLDIF_1.write(sb_tFileOutputLDIF_1.toString()); nb_line_tFileOutputLDIF_1++; } // //////////////////////// tos_count_tFileOutputLDIF_1++; /** * [tFileOutputLDIF_1 main ] stop */ } // End of branch "row1" } // End of branch "out_decode_pw" } // End of branch "decode_pw" /** * [tFileInputLDIF_2 end ] start */ currentComponent = "tFileInputLDIF_2"; } globalMap.put("tFileInputLDIF_2_NB_LINE", nb_line_tFileInputLDIF_2); ok_Hash.put("tFileInputLDIF_2", true); end_Hash.put("tFileInputLDIF_2", System.currentTimeMillis()); /** * [tFileInputLDIF_2 end ] stop */ /** * [tMap_1 end ] start */ currentComponent = "tMap_1"; // ############################### // # Lookup hashes releasing // ############################### if (execStat) { runStat.updateStatOnConnection("decode_pw" + iterateId, 2, 0); } ok_Hash.put("tMap_1", true); end_Hash.put("tMap_1", System.currentTimeMillis()); /** * [tMap_1 end ] stop */ /** * [tFilterRow_1 end ] start */ currentComponent = "tFilterRow_1"; globalMap.put("tFilterRow_1_NB_LINE", nb_line_tFilterRow_1); globalMap.put("tFilterRow_1_NB_LINE_OK", nb_line_ok_tFilterRow_1); globalMap.put("tFilterRow_1_NB_LINE_REJECT", nb_line_reject_tFilterRow_1); if (execStat) { runStat.updateStatOnConnection("out_decode_pw" + iterateId, 2, 0); } ok_Hash.put("tFilterRow_1", true); end_Hash.put("tFilterRow_1", System.currentTimeMillis()); /** * [tFilterRow_1 end ] stop */ /** * [tFileOutputLDIF_1 end ] start */ currentComponent = "tFileOutputLDIF_1"; pw_tFileOutputLDIF_1.flush(); pw_tFileOutputLDIF_1.close(); globalMap.put("tFileOutputLDIF_1_NB_LINE", nb_line_tFileOutputLDIF_1); if (execStat) { runStat.updateStatOnConnection("row1" + iterateId, 2, 0); } ok_Hash.put("tFileOutputLDIF_1", true); end_Hash.put("tFileOutputLDIF_1", System.currentTimeMillis()); /** * [tFileOutputLDIF_1 end ] stop */ } // end the resume } catch (java.lang.Exception e) { throw new TalendException(e, currentComponent, globalMap); } catch (java.lang.Error error) { runStat.stopThreadStat(); throw new java.lang.Error(error); } globalMap.put("tFileInputLDIF_2_SUBPROCESS_STATE", 1); } public String resuming_logs_dir_path = null; public String resuming_checkpoint_path = null; public String parent_part_launcher = null; private String resumeEntryMethodName = null; private boolean globalResumeTicket = false; public boolean watch = false; // portStats is null, it means don't execute the statistics public Integer portStats = null; public int portTraces = 4334; public String clientHost; public String defaultClientHost = "localhost"; public String contextStr = "dev"; public boolean isDefaultContext = true; public String pid = "0"; public String rootPid = null; public String fatherPid = null; public String fatherNode = null; public long startTime = 0; public boolean isChildJob = false; private boolean execStat = true; private ThreadLocal<java.util.Map<String, String>> threadLocal = new ThreadLocal<java.util.Map<String, String>>() { protected java.util.Map<String, String> initialValue() { java.util.Map<String, String> threadRunResultMap = new java.util.HashMap<String, String>(); threadRunResultMap.put("errorCode", null); threadRunResultMap.put("status", ""); return threadRunResultMap; }; }; private java.util.Properties context_param = new java.util.Properties(); public java.util.Map<String, Object> parentContextMap = new java.util.HashMap<String, Object>(); public String status = ""; public static void main(String[] args) { final encode_ldap_sqs encode_ldap_sqsClass = new encode_ldap_sqs(); int exitCode = encode_ldap_sqsClass.runJobInTOS(args); System.exit(exitCode); } public String[][] runJob(String[] args) { int exitCode = runJobInTOS(args); String[][] bufferValue = new String[][] { { Integer.toString(exitCode) } }; return bufferValue; } public int runJobInTOS(String[] args) { String lastStr = ""; for (String arg : args) { if (arg.equalsIgnoreCase("--context_param")) { lastStr = arg; } else if (lastStr.equals("")) { evalParam(arg); } else { evalParam(lastStr + " " + arg); lastStr = ""; } } if (clientHost == null) { clientHost = defaultClientHost; } if (pid == null || "0".equals(pid)) { pid = TalendString.getAsciiRandomString(6); } if (rootPid == null) { rootPid = pid; } if (fatherPid == null) { fatherPid = pid; } else { isChildJob = true; } if (portStats != null) { // portStats = -1; //for testing if (portStats < 0 || portStats > 65535) { // issue:10869, the portStats is invalid, so this client socket // can't open System.err.println("The statistics socket port " + portStats + " is invalid."); execStat = false; } } else { execStat = false; } try { // call job/subjob with an existing context, like: // --context=production. if without this parameter, there will use // the default context instead. java.io.InputStream inContext = encode_ldap_sqs.class.getClassLoader() .getResourceAsStream("sqs_dwh/encode_ldap_sqs_0_1/contexts/" + contextStr + ".properties"); if (isDefaultContext && inContext == null) { } else { if (inContext != null) { // defaultProps is in order to keep the original context // value defaultProps.load(inContext); inContext.close(); context = new ContextProperties(defaultProps); } else { // print info and job continue to run, for case: // context_param is not empty. System.err.println("Could not find the context " + contextStr); } } if (!context_param.isEmpty()) { context.putAll(context_param); } context.files_basepath = (String) context.getProperty("files_basepath"); context.files_basepath_ml = (String) context.getProperty("files_basepath_ml"); context.basepath = (String) context.getProperty("basepath"); context.tempdir = (String) context.getProperty("tempdir"); context.temppath = (String) context.getProperty("temppath"); context.spectos_lab_AdditionalParams = (String) context.getProperty("spectos_lab_AdditionalParams"); context.spectos_lab_Database = (String) context.getProperty("spectos_lab_Database"); context.spectos_lab_Login = (String) context.getProperty("spectos_lab_Login"); context.spectos_lab_Password = (java.lang.String) context.getProperty("spectos_lab_Password"); try { context.spectos_lab_Port = routines.system.ParserUtils .parseTo_Integer(context.getProperty("spectos_lab_Port")); } catch (NumberFormatException e) { context.spectos_lab_Port = null; } context.spectos_lab_Server = (String) context.getProperty("spectos_lab_Server"); context.spectos_lime_Login = (String) context.getProperty("spectos_lime_Login"); context.spectos_lime_Port = (String) context.getProperty("spectos_lime_Port"); context.spectos_lime_Server = (String) context.getProperty("spectos_lime_Server"); context.spectos_lime_Database = (String) context.getProperty("spectos_lime_Database"); context.spectos_lime_AdditionalParams = (String) context.getProperty("spectos_lime_AdditionalParams"); context.spectos_lime_Password = (java.lang.String) context.getProperty("spectos_lime_Password"); context.spectos_sqs_AdditionalParams = (String) context.getProperty("spectos_sqs_AdditionalParams"); context.spectos_sqs_Server = (String) context.getProperty("spectos_sqs_Server"); context.spectos_sqs_Login = (String) context.getProperty("spectos_sqs_Login"); context.spectos_sqs_Password = (java.lang.String) context.getProperty("spectos_sqs_Password"); context.spectos_sqs_Database = (String) context.getProperty("spectos_sqs_Database"); context.spectos_sqs_Port = (String) context.getProperty("spectos_sqs_Port"); context.inspector_lime_Port = (String) context.getProperty("inspector_lime_Port"); context.inspector_lime_Login = (String) context.getProperty("inspector_lime_Login"); context.inspector_lime_AdditionalParams = (String) context .getProperty("inspector_lime_AdditionalParams"); context.inspector_lime_Server = (String) context.getProperty("inspector_lime_Server"); context.inspector_lime_Password = (java.lang.String) context.getProperty("inspector_lime_Password"); context.inspector_lime_Database = (String) context.getProperty("inspector_lime_Database"); context.dwh_survey_Login = (String) context.getProperty("dwh_survey_Login"); context.dwh_survey_Port = (String) context.getProperty("dwh_survey_Port"); context.dwh_survey_Database = (String) context.getProperty("dwh_survey_Database"); context.dwh_survey_Password = (java.lang.String) context.getProperty("dwh_survey_Password"); context.dwh_survey_AdditionalParams = (String) context.getProperty("dwh_survey_AdditionalParams"); context.dwh_survey_Server = (String) context.getProperty("dwh_survey_Server"); context.spectos_sqs_dwh_freddy_Login = (String) context.getProperty("spectos_sqs_dwh_freddy_Login"); context.spectos_sqs_dwh_freddy_Port = (String) context.getProperty("spectos_sqs_dwh_freddy_Port"); context.spectos_sqs_dwh_freddy_Password = (java.lang.String) context .getProperty("spectos_sqs_dwh_freddy_Password"); context.spectos_sqs_dwh_freddy_AdditionalParams = (String) context .getProperty("spectos_sqs_dwh_freddy_AdditionalParams"); context.spectos_sqs_dwh_freddy_Server = (String) context.getProperty("spectos_sqs_dwh_freddy_Server"); context.spectos_sqs_dwh_freddy_Database = (String) context .getProperty("spectos_sqs_dwh_freddy_Database"); context.spectos_sqs_dwh_lidl_Port = (String) context.getProperty("spectos_sqs_dwh_lidl_Port"); context.spectos_sqs_dwh_lidl_Password = (java.lang.String) context .getProperty("spectos_sqs_dwh_lidl_Password"); context.spectos_sqs_dwh_lidl_AdditionalParams = (String) context .getProperty("spectos_sqs_dwh_lidl_AdditionalParams"); context.spectos_sqs_dwh_lidl_Login = (String) context.getProperty("spectos_sqs_dwh_lidl_Login"); context.spectos_sqs_dwh_lidl_Database = (String) context.getProperty("spectos_sqs_dwh_lidl_Database"); context.spectos_sqs_dwh_lidl_Server = (String) context.getProperty("spectos_sqs_dwh_lidl_Server"); context.spectos_sqs_dwh_nvsp_Database = (String) context.getProperty("spectos_sqs_dwh_nvsp_Database"); context.spectos_sqs_dwh_nvsp_Server = (String) context.getProperty("spectos_sqs_dwh_nvsp_Server"); context.spectos_sqs_dwh_nvsp_AdditionalParams = (String) context .getProperty("spectos_sqs_dwh_nvsp_AdditionalParams"); context.spectos_sqs_dwh_nvsp_Port = (String) context.getProperty("spectos_sqs_dwh_nvsp_Port"); context.spectos_sqs_dwh_nvsp_Password = (java.lang.String) context .getProperty("spectos_sqs_dwh_nvsp_Password"); context.spectos_sqs_dwh_nvsp_Login = (String) context.getProperty("spectos_sqs_dwh_nvsp_Login"); context.ldap_spectos_BindPassword = (java.lang.String) context.getProperty("ldap_spectos_BindPassword"); context.ldap_spectos_Host = (String) context.getProperty("ldap_spectos_Host"); try { context.ldap_spectos_Port = routines.system.ParserUtils .parseTo_Integer(context.getProperty("ldap_spectos_Port")); } catch (NumberFormatException e) { context.ldap_spectos_Port = null; } context.ldap_spectos_BindPrincipal = (String) context.getProperty("ldap_spectos_BindPrincipal"); context.spectos_ldap_role_epm_user_Host = (String) context .getProperty("spectos_ldap_role_epm_user_Host"); context.spectos_ldap_role_epm_user_BindPassword = (java.lang.String) context .getProperty("spectos_ldap_role_epm_user_BindPassword"); try { context.spectos_ldap_role_epm_user_Port = routines.system.ParserUtils .parseTo_Integer(context.getProperty("spectos_ldap_role_epm_user_Port")); } catch (NumberFormatException e) { context.spectos_ldap_role_epm_user_Port = null; } context.spectos_ldap_role_epm_user_BindPrincipal = (String) context .getProperty("spectos_ldap_role_epm_user_BindPrincipal"); context.spectos_ldap_role_customer_BindPassword = (java.lang.String) context .getProperty("spectos_ldap_role_customer_BindPassword"); context.spectos_ldap_role_customer_Host = (String) context .getProperty("spectos_ldap_role_customer_Host"); context.spectos_ldap_role_customer_BindPrincipal = (String) context .getProperty("spectos_ldap_role_customer_BindPrincipal"); try { context.spectos_ldap_role_customer_Port = routines.system.ParserUtils .parseTo_Integer(context.getProperty("spectos_ldap_role_customer_Port")); } catch (NumberFormatException e) { context.spectos_ldap_role_customer_Port = null; } context.spectos_ldap_nvspclaim_test_role_epm_user_Host = (String) context .getProperty("spectos_ldap_nvspclaim_test_role_epm_user_Host"); context.spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal = (String) context .getProperty("spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal"); context.spectos_ldap_nvspclaim_test_role_epm_user_BindPassword = (java.lang.String) context .getProperty("spectos_ldap_nvspclaim_test_role_epm_user_BindPassword"); try { context.spectos_ldap_nvspclaim_test_role_epm_user_Port = routines.system.ParserUtils .parseTo_Integer(context.getProperty("spectos_ldap_nvspclaim_test_role_epm_user_Port")); } catch (NumberFormatException e) { context.spectos_ldap_nvspclaim_test_role_epm_user_Port = null; } context.spectos_ldap_sqs_nvsp_BindPrincipal = (String) context .getProperty("spectos_ldap_sqs_nvsp_BindPrincipal"); context.spectos_ldap_sqs_nvsp_Host = (String) context.getProperty("spectos_ldap_sqs_nvsp_Host"); try { context.spectos_ldap_sqs_nvsp_Port = routines.system.ParserUtils .parseTo_Integer(context.getProperty("spectos_ldap_sqs_nvsp_Port")); } catch (NumberFormatException e) { context.spectos_ldap_sqs_nvsp_Port = null; } context.spectos_ldap_sqs_nvsp_BindPassword = (java.lang.String) context .getProperty("spectos_ldap_sqs_nvsp_BindPassword"); } catch (java.io.IOException ie) { System.err.println("Could not load context " + contextStr); ie.printStackTrace(); } // get context value from parent directly if (parentContextMap != null && !parentContextMap.isEmpty()) { if (parentContextMap.containsKey("files_basepath")) { context.files_basepath = (String) parentContextMap.get("files_basepath"); } if (parentContextMap.containsKey("files_basepath_ml")) { context.files_basepath_ml = (String) parentContextMap.get("files_basepath_ml"); } if (parentContextMap.containsKey("basepath")) { context.basepath = (String) parentContextMap.get("basepath"); } if (parentContextMap.containsKey("tempdir")) { context.tempdir = (String) parentContextMap.get("tempdir"); } if (parentContextMap.containsKey("temppath")) { context.temppath = (String) parentContextMap.get("temppath"); } if (parentContextMap.containsKey("spectos_lab_AdditionalParams")) { context.spectos_lab_AdditionalParams = (String) parentContextMap .get("spectos_lab_AdditionalParams"); } if (parentContextMap.containsKey("spectos_lab_Database")) { context.spectos_lab_Database = (String) parentContextMap.get("spectos_lab_Database"); } if (parentContextMap.containsKey("spectos_lab_Login")) { context.spectos_lab_Login = (String) parentContextMap.get("spectos_lab_Login"); } if (parentContextMap.containsKey("spectos_lab_Password")) { context.spectos_lab_Password = (java.lang.String) parentContextMap.get("spectos_lab_Password"); } if (parentContextMap.containsKey("spectos_lab_Port")) { context.spectos_lab_Port = (Integer) parentContextMap.get("spectos_lab_Port"); } if (parentContextMap.containsKey("spectos_lab_Server")) { context.spectos_lab_Server = (String) parentContextMap.get("spectos_lab_Server"); } if (parentContextMap.containsKey("spectos_lime_Login")) { context.spectos_lime_Login = (String) parentContextMap.get("spectos_lime_Login"); } if (parentContextMap.containsKey("spectos_lime_Port")) { context.spectos_lime_Port = (String) parentContextMap.get("spectos_lime_Port"); } if (parentContextMap.containsKey("spectos_lime_Server")) { context.spectos_lime_Server = (String) parentContextMap.get("spectos_lime_Server"); } if (parentContextMap.containsKey("spectos_lime_Database")) { context.spectos_lime_Database = (String) parentContextMap.get("spectos_lime_Database"); } if (parentContextMap.containsKey("spectos_lime_AdditionalParams")) { context.spectos_lime_AdditionalParams = (String) parentContextMap .get("spectos_lime_AdditionalParams"); } if (parentContextMap.containsKey("spectos_lime_Password")) { context.spectos_lime_Password = (java.lang.String) parentContextMap.get("spectos_lime_Password"); } if (parentContextMap.containsKey("spectos_sqs_AdditionalParams")) { context.spectos_sqs_AdditionalParams = (String) parentContextMap .get("spectos_sqs_AdditionalParams"); } if (parentContextMap.containsKey("spectos_sqs_Server")) { context.spectos_sqs_Server = (String) parentContextMap.get("spectos_sqs_Server"); } if (parentContextMap.containsKey("spectos_sqs_Login")) { context.spectos_sqs_Login = (String) parentContextMap.get("spectos_sqs_Login"); } if (parentContextMap.containsKey("spectos_sqs_Password")) { context.spectos_sqs_Password = (java.lang.String) parentContextMap.get("spectos_sqs_Password"); } if (parentContextMap.containsKey("spectos_sqs_Database")) { context.spectos_sqs_Database = (String) parentContextMap.get("spectos_sqs_Database"); } if (parentContextMap.containsKey("spectos_sqs_Port")) { context.spectos_sqs_Port = (String) parentContextMap.get("spectos_sqs_Port"); } if (parentContextMap.containsKey("inspector_lime_Port")) { context.inspector_lime_Port = (String) parentContextMap.get("inspector_lime_Port"); } if (parentContextMap.containsKey("inspector_lime_Login")) { context.inspector_lime_Login = (String) parentContextMap.get("inspector_lime_Login"); } if (parentContextMap.containsKey("inspector_lime_AdditionalParams")) { context.inspector_lime_AdditionalParams = (String) parentContextMap .get("inspector_lime_AdditionalParams"); } if (parentContextMap.containsKey("inspector_lime_Server")) { context.inspector_lime_Server = (String) parentContextMap.get("inspector_lime_Server"); } if (parentContextMap.containsKey("inspector_lime_Password")) { context.inspector_lime_Password = (java.lang.String) parentContextMap .get("inspector_lime_Password"); } if (parentContextMap.containsKey("inspector_lime_Database")) { context.inspector_lime_Database = (String) parentContextMap.get("inspector_lime_Database"); } if (parentContextMap.containsKey("dwh_survey_Login")) { context.dwh_survey_Login = (String) parentContextMap.get("dwh_survey_Login"); } if (parentContextMap.containsKey("dwh_survey_Port")) { context.dwh_survey_Port = (String) parentContextMap.get("dwh_survey_Port"); } if (parentContextMap.containsKey("dwh_survey_Database")) { context.dwh_survey_Database = (String) parentContextMap.get("dwh_survey_Database"); } if (parentContextMap.containsKey("dwh_survey_Password")) { context.dwh_survey_Password = (java.lang.String) parentContextMap.get("dwh_survey_Password"); } if (parentContextMap.containsKey("dwh_survey_AdditionalParams")) { context.dwh_survey_AdditionalParams = (String) parentContextMap.get("dwh_survey_AdditionalParams"); } if (parentContextMap.containsKey("dwh_survey_Server")) { context.dwh_survey_Server = (String) parentContextMap.get("dwh_survey_Server"); } if (parentContextMap.containsKey("spectos_sqs_dwh_freddy_Login")) { context.spectos_sqs_dwh_freddy_Login = (String) parentContextMap .get("spectos_sqs_dwh_freddy_Login"); } if (parentContextMap.containsKey("spectos_sqs_dwh_freddy_Port")) { context.spectos_sqs_dwh_freddy_Port = (String) parentContextMap.get("spectos_sqs_dwh_freddy_Port"); } if (parentContextMap.containsKey("spectos_sqs_dwh_freddy_Password")) { context.spectos_sqs_dwh_freddy_Password = (java.lang.String) parentContextMap .get("spectos_sqs_dwh_freddy_Password"); } if (parentContextMap.containsKey("spectos_sqs_dwh_freddy_AdditionalParams")) { context.spectos_sqs_dwh_freddy_AdditionalParams = (String) parentContextMap .get("spectos_sqs_dwh_freddy_AdditionalParams"); } if (parentContextMap.containsKey("spectos_sqs_dwh_freddy_Server")) { context.spectos_sqs_dwh_freddy_Server = (String) parentContextMap .get("spectos_sqs_dwh_freddy_Server"); } if (parentContextMap.containsKey("spectos_sqs_dwh_freddy_Database")) { context.spectos_sqs_dwh_freddy_Database = (String) parentContextMap .get("spectos_sqs_dwh_freddy_Database"); } if (parentContextMap.containsKey("spectos_sqs_dwh_lidl_Port")) { context.spectos_sqs_dwh_lidl_Port = (String) parentContextMap.get("spectos_sqs_dwh_lidl_Port"); } if (parentContextMap.containsKey("spectos_sqs_dwh_lidl_Password")) { context.spectos_sqs_dwh_lidl_Password = (java.lang.String) parentContextMap .get("spectos_sqs_dwh_lidl_Password"); } if (parentContextMap.containsKey("spectos_sqs_dwh_lidl_AdditionalParams")) { context.spectos_sqs_dwh_lidl_AdditionalParams = (String) parentContextMap .get("spectos_sqs_dwh_lidl_AdditionalParams"); } if (parentContextMap.containsKey("spectos_sqs_dwh_lidl_Login")) { context.spectos_sqs_dwh_lidl_Login = (String) parentContextMap.get("spectos_sqs_dwh_lidl_Login"); } if (parentContextMap.containsKey("spectos_sqs_dwh_lidl_Database")) { context.spectos_sqs_dwh_lidl_Database = (String) parentContextMap .get("spectos_sqs_dwh_lidl_Database"); } if (parentContextMap.containsKey("spectos_sqs_dwh_lidl_Server")) { context.spectos_sqs_dwh_lidl_Server = (String) parentContextMap.get("spectos_sqs_dwh_lidl_Server"); } if (parentContextMap.containsKey("spectos_sqs_dwh_nvsp_Database")) { context.spectos_sqs_dwh_nvsp_Database = (String) parentContextMap .get("spectos_sqs_dwh_nvsp_Database"); } if (parentContextMap.containsKey("spectos_sqs_dwh_nvsp_Server")) { context.spectos_sqs_dwh_nvsp_Server = (String) parentContextMap.get("spectos_sqs_dwh_nvsp_Server"); } if (parentContextMap.containsKey("spectos_sqs_dwh_nvsp_AdditionalParams")) { context.spectos_sqs_dwh_nvsp_AdditionalParams = (String) parentContextMap .get("spectos_sqs_dwh_nvsp_AdditionalParams"); } if (parentContextMap.containsKey("spectos_sqs_dwh_nvsp_Port")) { context.spectos_sqs_dwh_nvsp_Port = (String) parentContextMap.get("spectos_sqs_dwh_nvsp_Port"); } if (parentContextMap.containsKey("spectos_sqs_dwh_nvsp_Password")) { context.spectos_sqs_dwh_nvsp_Password = (java.lang.String) parentContextMap .get("spectos_sqs_dwh_nvsp_Password"); } if (parentContextMap.containsKey("spectos_sqs_dwh_nvsp_Login")) { context.spectos_sqs_dwh_nvsp_Login = (String) parentContextMap.get("spectos_sqs_dwh_nvsp_Login"); } if (parentContextMap.containsKey("ldap_spectos_BindPassword")) { context.ldap_spectos_BindPassword = (java.lang.String) parentContextMap .get("ldap_spectos_BindPassword"); } if (parentContextMap.containsKey("ldap_spectos_Host")) { context.ldap_spectos_Host = (String) parentContextMap.get("ldap_spectos_Host"); } if (parentContextMap.containsKey("ldap_spectos_Port")) { context.ldap_spectos_Port = (Integer) parentContextMap.get("ldap_spectos_Port"); } if (parentContextMap.containsKey("ldap_spectos_BindPrincipal")) { context.ldap_spectos_BindPrincipal = (String) parentContextMap.get("ldap_spectos_BindPrincipal"); } if (parentContextMap.containsKey("spectos_ldap_role_epm_user_Host")) { context.spectos_ldap_role_epm_user_Host = (String) parentContextMap .get("spectos_ldap_role_epm_user_Host"); } if (parentContextMap.containsKey("spectos_ldap_role_epm_user_BindPassword")) { context.spectos_ldap_role_epm_user_BindPassword = (java.lang.String) parentContextMap .get("spectos_ldap_role_epm_user_BindPassword"); } if (parentContextMap.containsKey("spectos_ldap_role_epm_user_Port")) { context.spectos_ldap_role_epm_user_Port = (Integer) parentContextMap .get("spectos_ldap_role_epm_user_Port"); } if (parentContextMap.containsKey("spectos_ldap_role_epm_user_BindPrincipal")) { context.spectos_ldap_role_epm_user_BindPrincipal = (String) parentContextMap .get("spectos_ldap_role_epm_user_BindPrincipal"); } if (parentContextMap.containsKey("spectos_ldap_role_customer_BindPassword")) { context.spectos_ldap_role_customer_BindPassword = (java.lang.String) parentContextMap .get("spectos_ldap_role_customer_BindPassword"); } if (parentContextMap.containsKey("spectos_ldap_role_customer_Host")) { context.spectos_ldap_role_customer_Host = (String) parentContextMap .get("spectos_ldap_role_customer_Host"); } if (parentContextMap.containsKey("spectos_ldap_role_customer_BindPrincipal")) { context.spectos_ldap_role_customer_BindPrincipal = (String) parentContextMap .get("spectos_ldap_role_customer_BindPrincipal"); } if (parentContextMap.containsKey("spectos_ldap_role_customer_Port")) { context.spectos_ldap_role_customer_Port = (Integer) parentContextMap .get("spectos_ldap_role_customer_Port"); } if (parentContextMap.containsKey("spectos_ldap_nvspclaim_test_role_epm_user_Host")) { context.spectos_ldap_nvspclaim_test_role_epm_user_Host = (String) parentContextMap .get("spectos_ldap_nvspclaim_test_role_epm_user_Host"); } if (parentContextMap.containsKey("spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal")) { context.spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal = (String) parentContextMap .get("spectos_ldap_nvspclaim_test_role_epm_user_BindPrincipal"); } if (parentContextMap.containsKey("spectos_ldap_nvspclaim_test_role_epm_user_BindPassword")) { context.spectos_ldap_nvspclaim_test_role_epm_user_BindPassword = (java.lang.String) parentContextMap .get("spectos_ldap_nvspclaim_test_role_epm_user_BindPassword"); } if (parentContextMap.containsKey("spectos_ldap_nvspclaim_test_role_epm_user_Port")) { context.spectos_ldap_nvspclaim_test_role_epm_user_Port = (Integer) parentContextMap .get("spectos_ldap_nvspclaim_test_role_epm_user_Port"); } if (parentContextMap.containsKey("spectos_ldap_sqs_nvsp_BindPrincipal")) { context.spectos_ldap_sqs_nvsp_BindPrincipal = (String) parentContextMap .get("spectos_ldap_sqs_nvsp_BindPrincipal"); } if (parentContextMap.containsKey("spectos_ldap_sqs_nvsp_Host")) { context.spectos_ldap_sqs_nvsp_Host = (String) parentContextMap.get("spectos_ldap_sqs_nvsp_Host"); } if (parentContextMap.containsKey("spectos_ldap_sqs_nvsp_Port")) { context.spectos_ldap_sqs_nvsp_Port = (Integer) parentContextMap.get("spectos_ldap_sqs_nvsp_Port"); } if (parentContextMap.containsKey("spectos_ldap_sqs_nvsp_BindPassword")) { context.spectos_ldap_sqs_nvsp_BindPassword = (java.lang.String) parentContextMap .get("spectos_ldap_sqs_nvsp_BindPassword"); } } // Resume: init the resumeUtil resumeEntryMethodName = ResumeUtil.getResumeEntryMethodName(resuming_checkpoint_path); resumeUtil = new ResumeUtil(resuming_logs_dir_path, isChildJob, rootPid); resumeUtil.initCommonInfo(pid, rootPid, fatherPid, projectName, jobName, contextStr, jobVersion); // Resume: jobStart resumeUtil.addLog("JOB_STARTED", "JOB:" + jobName, parent_part_launcher, Thread.currentThread().getId() + "", "", "", "", "", resumeUtil.convertToJsonText(context)); if (execStat) { try { runStat.openSocket(!isChildJob); runStat.setAllPID(rootPid, fatherPid, pid, jobName); runStat.startThreadStat(clientHost, portStats); runStat.updateStatOnJob(RunStat.JOBSTART, fatherNode); } catch (java.io.IOException ioException) { ioException.printStackTrace(); } } java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap = new java.util.concurrent.ConcurrentHashMap<Object, Object>(); globalMap.put("concurrentHashMap", concurrentHashMap); long startUsedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); long endUsedMemory = 0; long end = 0; startTime = System.currentTimeMillis(); this.globalResumeTicket = true;// to run tPreJob this.globalResumeTicket = false;// to run others jobs try { errorCode = null; tFileInputLDIF_2Process(globalMap); if (!"failure".equals(status)) { status = "end"; } } catch (TalendException e_tFileInputLDIF_2) { e_tFileInputLDIF_2.printStackTrace(); globalMap.put("tFileInputLDIF_2_SUBPROCESS_STATE", -1); } this.globalResumeTicket = true;// to run tPostJob end = System.currentTimeMillis(); if (watch) { System.out.println((end - startTime) + " milliseconds"); } endUsedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); if (false) { System.out.println( (endUsedMemory - startUsedMemory) + " bytes memory increase when running : encode_ldap_sqs"); } if (execStat) { runStat.updateStatOnJob(RunStat.JOBEND, fatherNode); runStat.stopThreadStat(); } int returnCode = 0; if (errorCode == null) { returnCode = status != null && status.equals("failure") ? 1 : 0; } else { returnCode = errorCode.intValue(); } resumeUtil.addLog("JOB_ENDED", "JOB:" + jobName, parent_part_launcher, Thread.currentThread().getId() + "", "", "" + returnCode, "", "", ""); return returnCode; } public void destroy() { } private java.util.Map<String, Object> getJmsConnections() { java.util.Map<String, Object> jmsConnections = new java.util.HashMap<String, Object>(); return jmsConnections; } private void evalParam(String arg) { if (arg.startsWith("--resuming_logs_dir_path")) { resuming_logs_dir_path = arg.substring(25); } else if (arg.startsWith("--resuming_checkpoint_path")) { resuming_checkpoint_path = arg.substring(27); } else if (arg.startsWith("--parent_part_launcher")) { parent_part_launcher = arg.substring(23); } else if (arg.startsWith("--watch")) { watch = true; } else if (arg.startsWith("--stat_port=")) { String portStatsStr = arg.substring(12); if (portStatsStr != null && !portStatsStr.equals("null")) { portStats = Integer.parseInt(portStatsStr); } } else if (arg.startsWith("--trace_port=")) { portTraces = Integer.parseInt(arg.substring(13)); } else if (arg.startsWith("--client_host=")) { clientHost = arg.substring(14); } else if (arg.startsWith("--context=")) { contextStr = arg.substring(10); isDefaultContext = false; } else if (arg.startsWith("--father_pid=")) { fatherPid = arg.substring(13); } else if (arg.startsWith("--root_pid=")) { rootPid = arg.substring(11); } else if (arg.startsWith("--father_node=")) { fatherNode = arg.substring(14); } else if (arg.startsWith("--pid=")) { pid = arg.substring(6); } else if (arg.startsWith("--context_param")) { String keyValue = arg.substring(16); int index = -1; if (keyValue != null && (index = keyValue.indexOf('=')) > -1) { if (fatherPid == null) { context_param.put(keyValue.substring(0, index), replaceEscapeChars(keyValue.substring(index + 1))); } else { // the subjob won't escape the especial chars context_param.put(keyValue.substring(0, index), keyValue.substring(index + 1)); } } } } private final String[][] escapeChars = { { "\\n", "\n" }, { "\\'", "\'" }, { "\\r", "\r" }, { "\\f", "\f" }, { "\\b", "\b" }, { "\\t", "\t" }, { "\\\\", "\\" } }; private String replaceEscapeChars(String keyValue) { if (keyValue == null || ("").equals(keyValue.trim())) { return keyValue; } for (String[] strArray : escapeChars) { keyValue = keyValue.replace(strArray[0], strArray[1]); } return keyValue; } public Integer getErrorCode() { return errorCode; } public String getStatus() { return status; } ResumeUtil resumeUtil = null; } /************************************************************************************************ * 122705 characters generated by Talend Open Studio for Data Integration on the * 01 July 2013 14:32:09 ICT ************************************************************************************************/