public JobExecutorParameters( Repository rep, ObjectId id_step ) throws KettleException { int nrVariables = rep.countNrStepAttributes( id_step, "parameter_variable" ); variable = new String[nrVariables]; field = new String[nrVariables]; input = new String[nrVariables]; for ( int i = 0; i < nrVariables; i++ ) { variable[i] = rep.getStepAttributeString( id_step, i, "parameter_variable" ); field[i] = rep.getStepAttributeString( id_step, i, "parameter_field" ); input[i] = rep.getStepAttributeString( id_step, i, "parameter_input" ); } inheritingAllVariables = rep.getStepAttributeBoolean( id_step, "parameter_inherit_all_vars" ); }
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException { for ( int i = 0; i < variable.length; i++ ) { rep.saveStepAttribute( id_transformation, id_step, i, "mapping_parameter_variable", variable[i] ); rep.saveStepAttribute( id_transformation, id_step, i, "mapping_parameter_input", input[i] ); } rep.saveStepAttribute( id_transformation, id_step, "mapping_parameter_inherit_all_vars", inheritingAllVariables ); }
public MappingIODefinition( Repository rep, ObjectId id_step, String prefix, int nr ) throws KettleException { this(); inputStepname = rep.getStepAttributeString( id_step, nr, prefix + "input_step" ); outputStepname = rep.getStepAttributeString( id_step, nr, prefix + "output_step" ); mainDataPath = rep.getStepAttributeBoolean( id_step, nr, prefix + "main_path" ); renamingOnOutput = rep.getStepAttributeBoolean( id_step, nr, prefix + "rename_on_output" ); description = rep.getStepAttributeString( id_step, nr, prefix + "description" ); int nrRenames = (int) rep.getStepAttributeInteger( id_step, nr, prefix + "nr_renames" ); for ( int i = 0; i < nrRenames; i++ ) { String parent = rep.getStepAttributeString( id_step, nr, prefix + "rename_parent_" + i ); String child = rep.getStepAttributeString( id_step, nr, prefix + "rename_child_" + i ); valueRenames.add( new MappingValueRename( parent, child ) ); } }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { port = rep.getStepAttributeString( id_step, "port" ); bufferSize = rep.getStepAttributeString( id_step, "buffer_size" ); flushInterval = rep.getStepAttributeString( id_step, "flush_interval" ); compressed = rep.getStepAttributeBoolean( id_step, "compressed" ); }
public FormulaMetaFunction( Repository rep, ObjectId id_step, int nr ) throws KettleException { fieldName = rep.getStepAttributeString( id_step, nr, "field_name" ); formula = rep.getStepAttributeString( id_step, nr, "formula_string" ); valueType = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, nr, "value_type" ) ); valueLength = (int) rep.getStepAttributeInteger( id_step, nr, "value_length" ); valuePrecision = (int) rep.getStepAttributeInteger( id_step, nr, "value_precision" ); replaceField = rep.getStepAttributeString( id_step, nr, "replace_field" ); }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { int nrsteps = rep.countNrStepAttributes( id_step, "step_name" ); allocate( nrsteps ); for ( int i = 0; i < nrsteps; i++ ) { stepName[i] = rep.getStepAttributeString( id_step, i, "step_name" ); stepCopyNr[i] = rep.getStepAttributeString( id_step, i, "step_CopyNr" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { int nrfiles = rep.countNrStepAttributes( id_step, "file_name" ); dynamicFoldernameField = rep.getStepAttributeString( id_step, "foldername_field" ); includeRowNumber = rep.getStepAttributeBoolean( id_step, "rownum" ); isFoldernameDynamic = rep.getStepAttributeBoolean( id_step, "foldername_dynamic" ); rowNumberField = rep.getStepAttributeString( id_step, "rownum_field" ); rowLimit = rep.getStepAttributeInteger( id_step, "limit" ); allocate( nrfiles ); for ( int i = 0; i < nrfiles; i++ ) { folderName[i] = rep.getStepAttributeString( id_step, i, "file_name" ); folderRequired[i] = rep.getStepAttributeString( id_step, i, "file_required" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); rowLimit = (int) rep.getStepAttributeInteger( id_step, "rowlimit" ); sql = rep.getStepAttributeString( id_step, "sql" ); outerJoin = rep.getStepAttributeBoolean( id_step, "outer_join" ); replacevars = rep.getStepAttributeBoolean( id_step, "replace_vars" ); sqlfieldname = rep.getStepAttributeString( id_step, "sql_fieldname" ); queryonlyonchange = rep.getStepAttributeBoolean( id_step, "query_only_on_change" ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "DynamicSQLRowMeta.Exception.UnexpectedErrorReadingStepInfo" ), e ); } }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { int nrfields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrfields ); for ( int i = 0; i < nrfields; i++ ) { fieldname[i] = rep.getStepAttributeString( id_step, i, "field_name" ); type[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) ); length[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_length" ); precision[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "InjectorMeta.Exception.ErrorReadingStepInfoFromRepository" ), e ); } }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { messagefieldname = rep.getStepAttributeString( id_step, "messagefieldname" ); serverName = rep.getJobEntryAttributeString( id_step, "servername" ); port = rep.getJobEntryAttributeString( id_step, "port" ); facility = rep.getJobEntryAttributeString( id_step, "facility" ); priority = rep.getJobEntryAttributeString( id_step, "priority" ); datePattern = rep.getJobEntryAttributeString( id_step, "datePattern" ); addTimestamp = rep.getJobEntryAttributeBoolean( id_step, "addTimestamp" ); addHostName = rep.getJobEntryAttributeBoolean( id_step, "addHostName" ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "SyslogMessageMeta.Exception.UnexpectedErrorReadingStepInfo" ), e ); } }
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers ) throws KettleException { try { filename = rep.getJobEntryAttributeString( id_jobentry, "filename" ); createParentFolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createParentFolder" ); appendFile = rep.getJobEntryAttributeBoolean( id_jobentry, "appendFile" ); content = rep.getJobEntryAttributeString( id_jobentry, "content" ); encoding = rep.getJobEntryAttributeString( id_jobentry, "encoding" ); } catch ( KettleException dbe ) { throw new KettleException( "Unable to load job entry of type 'create file' from the repository for id_jobentry=" + id_jobentry, dbe ); } }
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { directory = rep.getStepAttributeString( id_step, "directory" ); prefix = rep.getStepAttributeString( id_step, "prefix" ); cacheSize = (int) rep.getStepAttributeInteger( id_step, "cache_size" ); mainStepname = rep.getStepAttributeString( id_step, "main" ); condition = rep.loadConditionFromStepAttribute( id_step, "id_condition" ); if ( condition == null ) { condition = new Condition(); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "JoinRowsMeta.Exception.UnexpectedErrorInReadStepInfoFromRepository" ), e ); } }
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { failIfNoFile = rep.getStepAttributeBoolean( id_step, "failIfNoFile" ); int nrCalcs = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrCalcs ); for ( int i = 0; i < nrCalcs; i++ ) { calculation[i] = new CalculatorMetaFunction( rep, id_step, i ); } }
@Before public void setUp() throws Exception { repo = mock( Repository.class ); doReturn( XXEUtils.MALICIOUS_XML ).when( repo ).getJobEntryAttributeString( any( ObjectId.class ), anyString() ); doReturn( XXEUtils.MALICIOUS_XML ).when( repo ).getStepAttributeString( any( ObjectId.class ), anyString() ); }
protected void saveSourceRep( Repository rep, ObjectId id_job, ObjectId id_jobentry, int i, String value ) throws KettleException { String namedCluster = configurationMappings.get( value ); rep.saveJobEntryAttribute( id_job, getObjectId(), i, SOURCE_FILE_FOLDER, value ); rep.saveJobEntryAttribute( id_job, id_jobentry, i, SOURCE_CONFIGURATION_NAME, namedCluster ); }
public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleException { try { shapeFilename = rep.getStepAttributeString (id_step, "shapefilename" ); dbfFilename = rep.getStepAttributeString (id_step, "dbffilename" ); } catch(Exception e) { throw new KettleException("Unexpected error reading step information from the repository", e); } }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { int nrCalcs = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrCalcs ); for ( int i = 0; i < nrCalcs; i++ ) { formula[i] = new FormulaMetaFunction( rep, id_step, i ); } }
@Override public void loadRep( Repository rep, IMetaStore metaStore, ObjectId idJobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers ) throws KettleException { try { server = rep.getJobEntryAttributeString( idJobentry, "server" ); port = rep.getJobEntryAttributeString( idJobentry, "port" ); variableName = rep.getJobEntryAttributeString( idJobentry, "variable" ); } catch ( KettleException dbe ) { throw new KettleException( "Unable to load job entry from the repository for id_jobentry=" + idJobentry, dbe ); } }
@Override public long getStepAttributeInteger( ObjectId objectId, String s ) throws KettleException { return getDelegate().getStepAttributeInteger( objectId, s ); }
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers ) throws KettleException { try { tablename = rep.getJobEntryAttributeString( id_jobentry, "tablename" ); schemaname = rep.getJobEntryAttributeString( id_jobentry, "schemaname" ); connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases ); } catch ( KettleDatabaseException dbe ) { throw new KettleException( BaseMessages.getString( PKG, "TableExists.Meta.UnableLoadRep", "" + id_jobentry ), dbe ); } }