Java Code Examples for org.pentaho.di.repository.Repository#getJobEntryAttributeBoolean()

The following examples show how to use org.pentaho.di.repository.Repository#getJobEntryAttributeBoolean() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobEntryMysqlBulkLoad.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    schemaname = rep.getJobEntryAttributeString( id_jobentry, "schemaname" );
    tablename = rep.getJobEntryAttributeString( id_jobentry, "tablename" );
    filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );
    separator = rep.getJobEntryAttributeString( id_jobentry, "separator" );
    enclosed = rep.getJobEntryAttributeString( id_jobentry, "enclosed" );
    escaped = rep.getJobEntryAttributeString( id_jobentry, "escaped" );
    linestarted = rep.getJobEntryAttributeString( id_jobentry, "linestarted" );
    lineterminated = rep.getJobEntryAttributeString( id_jobentry, "lineterminated" );
    replacedata = rep.getJobEntryAttributeBoolean( id_jobentry, "replacedata" );
    ignorelines = rep.getJobEntryAttributeString( id_jobentry, "ignorelines" );
    listattribut = rep.getJobEntryAttributeString( id_jobentry, "listattribut" );
    localinfile = rep.getJobEntryAttributeBoolean( id_jobentry, "localinfile" );
    prorityvalue = (int) rep.getJobEntryAttributeInteger( id_jobentry, "prorityvalue" );
    addfiletoresult = rep.getJobEntryAttributeBoolean( id_jobentry, "addfiletoresult" );

    connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'Mysql bulk load' from the repository for id_jobentry=" + id_jobentry,
      dbe );
  }
}
 
Example 2
Source File: JobEntryXMLWellFormed.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
  try {
    arg_from_previous = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    include_subfolders = rep.getJobEntryAttributeBoolean( id_jobentry, "include_subfolders" );

    nr_errors_less_than = rep.getJobEntryAttributeString( id_jobentry, "nr_errors_less_than" );
    success_condition = rep.getJobEntryAttributeString( id_jobentry, "success_condition" );
    resultfilenames = rep.getJobEntryAttributeString( id_jobentry, "resultfilenames" );

    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "source_filefolder" );
    source_filefolder = new String[argnr];
    wildcard = new String[argnr];

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      source_filefolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, "source_filefolder" );
      wildcard[a] = rep.getJobEntryAttributeString( id_jobentry, a, "wildcard" );
    }
  } catch ( KettleException dbe ) {

    throw new KettleException( BaseMessages.getString( PKG, "JobXMLWellFormed.Error.Exception.UnableLoadRep" )
        + id_jobentry, dbe );
  }
}
 
Example 3
Source File: JobEntryDeleteFiles.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    argFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    includeSubfolders = rep.getJobEntryAttributeBoolean( id_jobentry, "include_subfolders" );

    int numberOfArgs = rep.countNrJobEntryAttributes( id_jobentry, "name" );
    allocate( numberOfArgs );

    for ( int i = 0; i < numberOfArgs; i++ ) {
      arguments[i] = rep.getJobEntryAttributeString( id_jobentry, i, "name" );
      filemasks[i] = rep.getJobEntryAttributeString( id_jobentry, i, "filemask" );
    }
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobEntryDeleteFiles.UnableToLoadFromRepo", String
      .valueOf( id_jobentry ) ), dbe );
  }
}
 
Example 4
Source File: JobEntryWaitForSQL.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Override
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases );

    schemaname = rep.getJobEntryAttributeString( id_jobentry, "schemaname" );
    tablename = rep.getJobEntryAttributeString( id_jobentry, "tablename" );
    successCondition =
      getSuccessConditionByCode( Const.NVL(
        rep.getJobEntryAttributeString( id_jobentry, "success_condition" ), "" ) );
    rowsCountValue = rep.getJobEntryAttributeString( id_jobentry, "rows_count_value" );
    iscustomSQL = rep.getJobEntryAttributeBoolean( id_jobentry, "is_custom_sql" );
    isUseVars = rep.getJobEntryAttributeBoolean( id_jobentry, "is_usevars" );
    isAddRowsResult = rep.getJobEntryAttributeBoolean( id_jobentry, "add_rows_result" );
    customSQL = rep.getJobEntryAttributeString( id_jobentry, "custom_sql" );
    maximumTimeout = rep.getJobEntryAttributeString( id_jobentry, "maximum_timeout" );
    checkCycleTime = rep.getJobEntryAttributeString( id_jobentry, "check_cycle_time" );
    successOnTimeout = rep.getJobEntryAttributeBoolean( id_jobentry, "success_on_timeout" );
    isClearResultList = rep.getJobEntryAttributeBoolean( id_jobentry, "clear_result_rows" );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( BaseMessages
      .getString( PKG, "JobEntryWaitForSQL.UnableLoadRep", "" + id_jobentry ), dbe );
  }
}
 
Example 5
Source File: JobEntrySyslog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    port = rep.getJobEntryAttributeString( id_jobentry, "port" );
    serverName = rep.getJobEntryAttributeString( id_jobentry, "servername" );
    facility = rep.getJobEntryAttributeString( id_jobentry, "facility" );
    priority = rep.getJobEntryAttributeString( id_jobentry, "priority" );
    message = rep.getJobEntryAttributeString( id_jobentry, "message" );
    datePattern = rep.getJobEntryAttributeString( id_jobentry, "datePattern" );
    addTimestamp = rep.getJobEntryAttributeBoolean( id_jobentry, "addTimestamp" );
    addHostname = rep.getJobEntryAttributeBoolean( id_jobentry, "addHostname" );

  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'Syslog' from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}
 
Example 6
Source File: JobEntryEvalTableContent.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases );

    schemaname = rep.getJobEntryAttributeString( id_jobentry, "schemaname" );
    tablename = rep.getJobEntryAttributeString( id_jobentry, "tablename" );
    successCondition =
      getSuccessConditionByCode( Const.NVL(
        rep.getJobEntryAttributeString( id_jobentry, "success_condition" ), "" ) );
    limit = rep.getJobEntryAttributeString( id_jobentry, "limit" );
    useCustomSQL = rep.getJobEntryAttributeBoolean( id_jobentry, "is_custom_sql" );
    useVars = rep.getJobEntryAttributeBoolean( id_jobentry, "is_usevars" );
    addRowsResult = rep.getJobEntryAttributeBoolean( id_jobentry, "add_rows_result" );
    clearResultList = rep.getJobEntryAttributeBoolean( id_jobentry, "clear_result_rows" );

    customSQL = rep.getJobEntryAttributeString( id_jobentry, "custom_sql" );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobEntryEvalTableContent.UnableLoadRep", ""
      + id_jobentry ), dbe );
  }
}
 
Example 7
Source File: JobEntryCheckFilesLocked.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId idJobEntry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    argFromPrevious = rep.getJobEntryAttributeBoolean( idJobEntry, ARG_FROM_PREVIOUS_ATTR );
    includeSubfolders = rep.getJobEntryAttributeBoolean( idJobEntry, INCLUDE_SUBFOLDERS_ATTR );

    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( idJobEntry, NAME_ATTR );
    arguments = new String[argnr];
    filemasks = new String[argnr];

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      arguments[a] = rep.getJobEntryAttributeString( idJobEntry, a, NAME_ATTR );
      filemasks[a] = rep.getJobEntryAttributeString( idJobEntry, a, FILE_MASK_ATTR );
    }
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "JobEntryCheckFilesLocked.UnableToLoadFromRepo", String.valueOf( idJobEntry ) ), dbe );
  }
}
 
Example 8
Source File: JobEntryTruncateTables.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases );

    this.argFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "name" );
    allocate( argnr );

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      this.arguments[a] = rep.getJobEntryAttributeString( id_jobentry, a, "name" );
      this.schemaname[a] = rep.getJobEntryAttributeString( id_jobentry, a, "schemaname" );
    }

  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobEntryTruncateTables.UnableLoadRep", ""
      + id_jobentry ), dbe );
  }
}
 
Example 9
Source File: JobEntryDeleteResultFilenames.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    foldername = rep.getJobEntryAttributeString( id_jobentry, "foldername" );
    specifywildcard = rep.getJobEntryAttributeBoolean( id_jobentry, "specify_wildcard" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
    wildcardexclude = rep.getJobEntryAttributeString( id_jobentry, "wildcardexclude" );
  } catch ( KettleException dbe ) {
    throw new KettleXMLException( BaseMessages.getString(
      PKG, "JobEntryDeleteResultFilenames.CanNotLoadFromRep", "" + id_jobentry, dbe.getMessage() ) );
  }
}
 
Example 10
Source File: JobEntryDTDValidator.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
  try {
    xmlfilename = rep.getJobEntryAttributeString( id_jobentry, "xmlfilename" );
    dtdfilename = rep.getJobEntryAttributeString( id_jobentry, "dtdfilename" );
    dtdintern = rep.getJobEntryAttributeBoolean( id_jobentry, "dtdintern" );

  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'DTDvalidator' from the repository for id_jobentry="
        + id_jobentry, dbe );
  }
}
 
Example 11
Source File: JobEntryCreateFolder.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    foldername = rep.getJobEntryAttributeString( id_jobentry, "foldername" );
    failOfFolderExists = rep.getJobEntryAttributeBoolean( id_jobentry, "fail_of_folder_exists" );
  } catch ( KettleException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'create Folder' from the repository for id_jobentry=" + id_jobentry,
      dbe );
  }
}
 
Example 12
Source File: JobEntryShell.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    setFileName( rep.getJobEntryAttributeString( id_jobentry, "file_name" ) );
    setWorkDirectory( rep.getJobEntryAttributeString( id_jobentry, "work_directory" ) );
    argFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    execPerRow = rep.getJobEntryAttributeBoolean( id_jobentry, "exec_per_row" );

    setLogfile = rep.getJobEntryAttributeBoolean( id_jobentry, "set_logfile" );
    setAppendLogfile = rep.getJobEntryAttributeBoolean( id_jobentry, "set_append_logfile" );
    addDate = rep.getJobEntryAttributeBoolean( id_jobentry, "add_date" );
    addTime = rep.getJobEntryAttributeBoolean( id_jobentry, "add_time" );
    logfile = rep.getJobEntryAttributeString( id_jobentry, "logfile" );
    logext = rep.getJobEntryAttributeString( id_jobentry, "logext" );
    logFileLevel = LogLevel.getLogLevelForCode( rep.getJobEntryAttributeString( id_jobentry, "loglevel" ) );
    insertScript = rep.getJobEntryAttributeBoolean( id_jobentry, "insertScript" );

    script = rep.getJobEntryAttributeString( id_jobentry, "script" );
    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "argument" );
    allocate( argnr );

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      arguments[a] = rep.getJobEntryAttributeString( id_jobentry, a, "argument" );
    }
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'shell' from the repository with id_jobentry="
      + id_jobentry, dbe );
  }
}
 
Example 13
Source File: JobEntryFTPSPUT.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    serverName = rep.getJobEntryAttributeString( id_jobentry, "servername" );
    serverPort = rep.getJobEntryAttributeString( id_jobentry, "serverport" );
    userName = rep.getJobEntryAttributeString( id_jobentry, "username" );
    password =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "password" ) );
    remoteDirectory = rep.getJobEntryAttributeString( id_jobentry, "remoteDirectory" );
    localDirectory = rep.getJobEntryAttributeString( id_jobentry, "localDirectory" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
    binaryMode = rep.getJobEntryAttributeBoolean( id_jobentry, "binary" );
    timeout = (int) rep.getJobEntryAttributeInteger( id_jobentry, "timeout" );
    remove = rep.getJobEntryAttributeBoolean( id_jobentry, "remove" );
    onlyPuttingNewFiles = rep.getJobEntryAttributeBoolean( id_jobentry, "only_new" );
    activeConnection = rep.getJobEntryAttributeBoolean( id_jobentry, "active" );

    proxyHost = rep.getJobEntryAttributeString( id_jobentry, "proxy_host" );
    proxyPort = rep.getJobEntryAttributeString( id_jobentry, "proxy_port" );
    proxyUsername = rep.getJobEntryAttributeString( id_jobentry, "proxy_username" );
    proxyPassword = rep.getJobEntryAttributeString( id_jobentry, "proxy_password" );
    connectionType =
      FTPSConnection.getConnectionTypeByCode( Const.NVL( rep.getJobEntryAttributeString(
        id_jobentry, "connection_type" ), "" ) );
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobFTPSPUT.UnableToLoadFromRepo", String
      .valueOf( id_jobentry ) ), dbe );
  }
}
 
Example 14
Source File: JobEntrySimpleEval.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    valuetype = getValueTypeByCode( Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "valuetype" ), "" ) );
    fieldname = rep.getJobEntryAttributeString( id_jobentry, "fieldname" );
    variablename = rep.getJobEntryAttributeString( id_jobentry, "variablename" );
    fieldtype = getFieldTypeByCode( Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "fieldtype" ), "" ) );
    mask = rep.getJobEntryAttributeString( id_jobentry, "mask" );
    comparevalue = rep.getJobEntryAttributeString( id_jobentry, "comparevalue" );
    minvalue = rep.getJobEntryAttributeString( id_jobentry, "minvalue" );
    maxvalue = rep.getJobEntryAttributeString( id_jobentry, "maxvalue" );
    successcondition =
      getSuccessConditionByCode( Const.NVL(
        rep.getJobEntryAttributeString( id_jobentry, "successcondition" ), "" ) );
    successnumbercondition =
      getSuccessNumberConditionByCode( Const.NVL( rep.getJobEntryAttributeString(
        id_jobentry, "successnumbercondition" ), "" ) );
    successbooleancondition =
      getSuccessBooleanConditionByCode( Const.NVL( rep.getJobEntryAttributeString(
        id_jobentry, "successbooleancondition" ), "" ) );
    successwhenvarset = rep.getJobEntryAttributeBoolean( id_jobentry, "successwhenvarset" );
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobEntrySimple.Error.Exception.UnableLoadRep" )
      + id_jobentry, dbe );
  }
}
 
Example 15
Source File: JobEntryPGPVerify.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    gpglocation = rep.getJobEntryAttributeString( id_jobentry, "gpglocation" );
    filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );
    detachedfilename = rep.getJobEntryAttributeString( id_jobentry, "detachedfilename" );
    useDetachedSignature = rep.getJobEntryAttributeBoolean( id_jobentry, "useDetachedSignature" );
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "JobEntryPGPVerify.ERROR_0002_Cannot_Load_Job_From_Repository", id_jobentry ), dbe );
  }
}
 
Example 16
Source File: JobEntryMysqlBulkFile.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    schemaname = rep.getJobEntryAttributeString( id_jobentry, "schemaname" );
    tablename = rep.getJobEntryAttributeString( id_jobentry, "tablename" );
    filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );
    separator = rep.getJobEntryAttributeString( id_jobentry, "separator" );
    enclosed = rep.getJobEntryAttributeString( id_jobentry, "enclosed" );
    lineterminated = rep.getJobEntryAttributeString( id_jobentry, "lineterminated" );
    limitlines = rep.getJobEntryAttributeString( id_jobentry, "limitlines" );
    listcolumn = rep.getJobEntryAttributeString( id_jobentry, "listcolumn" );
    highpriority = rep.getJobEntryAttributeBoolean( id_jobentry, "highpriority" );
    optionenclosed = rep.getJobEntryAttributeBoolean( id_jobentry, "optionenclosed" );

    outdumpvalue = (int) rep.getJobEntryAttributeInteger( id_jobentry, "outdumpvalue" );

    iffileexists = (int) rep.getJobEntryAttributeInteger( id_jobentry, "iffileexists" );

    addfiletoresult = rep.getJobEntryAttributeBoolean( id_jobentry, "addfiletoresult" );

    connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'table exists' from the repository for id_jobentry=" + id_jobentry,
      dbe );
  }
}
 
Example 17
Source File: JobEntryDeleteFile.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
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" );
    failIfFileNotExists = rep.getJobEntryAttributeBoolean( id_jobentry, "fail_if_file_not_exists" );
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "JobEntryDeleteFile.ERROR_0002_Unable_To_Load_From_Repository", id_jobentry ), dbe );
  }
}
 
Example 18
Source File: JobEntryFTP.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    port = rep.getJobEntryAttributeString( id_jobentry, "port" );
    serverName = rep.getJobEntryAttributeString( id_jobentry, "servername" );
    userName = rep.getJobEntryAttributeString( id_jobentry, "username" );
    password =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "password" ) );
    ftpDirectory = rep.getJobEntryAttributeString( id_jobentry, "ftpdirectory" );
    targetDirectory = rep.getJobEntryAttributeString( id_jobentry, "targetdirectory" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
    binaryMode = rep.getJobEntryAttributeBoolean( id_jobentry, "binary" );
    timeout = (int) rep.getJobEntryAttributeInteger( id_jobentry, "timeout" );
    remove = rep.getJobEntryAttributeBoolean( id_jobentry, "remove" );
    onlyGettingNewFiles = rep.getJobEntryAttributeBoolean( id_jobentry, "only_new" );
    activeConnection = rep.getJobEntryAttributeBoolean( id_jobentry, "active" );
    controlEncoding = rep.getJobEntryAttributeString( id_jobentry, "control_encoding" );
    if ( controlEncoding == null ) {
      // if we couldn't retrieve an encoding, assume it's an old instance and
      // put in the the encoding used before v 2.4.0
      controlEncoding = LEGACY_CONTROL_ENCODING;
    }

    movefiles = rep.getJobEntryAttributeBoolean( id_jobentry, "movefiles" );
    movetodirectory = rep.getJobEntryAttributeString( id_jobentry, "movetodirectory" );

    adddate = rep.getJobEntryAttributeBoolean( id_jobentry, "adddate" );
    addtime = rep.getJobEntryAttributeBoolean( id_jobentry, "addtime" );
    SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, "SpecifyFormat" );
    date_time_format = rep.getJobEntryAttributeString( id_jobentry, "date_time_format" );
    AddDateBeforeExtension = rep.getJobEntryAttributeBoolean( id_jobentry, "AddDateBeforeExtension" );

    String addToResult = rep.getJobEntryAttributeString( id_jobentry, "isaddresult" );
    if ( Utils.isEmpty( addToResult ) ) {
      isaddresult = true;
    } else {
      isaddresult = rep.getJobEntryAttributeBoolean( id_jobentry, "isaddresult" );
    }

    createmovefolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createmovefolder" );

    proxyHost = rep.getJobEntryAttributeString( id_jobentry, "proxy_host" );
    proxyPort = rep.getJobEntryAttributeString( id_jobentry, "proxy_port" );
    proxyUsername = rep.getJobEntryAttributeString( id_jobentry, "proxy_username" );
    proxyPassword =
      Encr
        .decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "proxy_password" ) );
    socksProxyHost = rep.getJobEntryAttributeString( id_jobentry, "socksproxy_host" );
    socksProxyPort = rep.getJobEntryAttributeString( id_jobentry, "socksproxy_port" );
    socksProxyUsername = rep.getJobEntryAttributeString( id_jobentry, "socksproxy_username" );
    socksProxyPassword =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString(
        id_jobentry, "socksproxy_password" ) );
    SifFileExists = rep.getJobEntryAttributeString( id_jobentry, "ifFileExists" );
    if ( Utils.isEmpty( SifFileExists ) ) {
      ifFileExists = ifFileExistsSkip;
    } else {
      if ( SifFileExists.equals( SifFileExistsCreateUniq ) ) {
        ifFileExists = ifFileExistsCreateUniq;
      } else if ( SifFileExists.equals( SifFileExistsFail ) ) {
        ifFileExists = ifFileExistsFail;
      } else {
        ifFileExists = ifFileExistsSkip;
      }
    }
    nr_limit = rep.getJobEntryAttributeString( id_jobentry, "nr_limit" );
    success_condition =
      Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "success_condition" ), SUCCESS_IF_NO_ERRORS );

  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'ftp' from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}
 
Example 19
Source File: JobEntryFTPSGet.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    port = rep.getJobEntryAttributeString( id_jobentry, "port" );
    serverName = rep.getJobEntryAttributeString( id_jobentry, "servername" );
    userName = rep.getJobEntryAttributeString( id_jobentry, "username" );
    password =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "password" ) );
    FTPSDirectory = rep.getJobEntryAttributeString( id_jobentry, "FTPSdirectory" );
    targetDirectory = rep.getJobEntryAttributeString( id_jobentry, "targetdirectory" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
    binaryMode = rep.getJobEntryAttributeBoolean( id_jobentry, "binary" );
    timeout = (int) rep.getJobEntryAttributeInteger( id_jobentry, "timeout" );
    remove = rep.getJobEntryAttributeBoolean( id_jobentry, "remove" );
    onlyGettingNewFiles = rep.getJobEntryAttributeBoolean( id_jobentry, "only_new" );
    activeConnection = rep.getJobEntryAttributeBoolean( id_jobentry, "active" );

    movefiles = rep.getJobEntryAttributeBoolean( id_jobentry, "movefiles" );
    movetodirectory = rep.getJobEntryAttributeString( id_jobentry, "movetodirectory" );

    adddate = rep.getJobEntryAttributeBoolean( id_jobentry, "adddate" );
    addtime = rep.getJobEntryAttributeBoolean( id_jobentry, "adddate" );
    SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, "SpecifyFormat" );
    date_time_format = rep.getJobEntryAttributeString( id_jobentry, "date_time_format" );
    AddDateBeforeExtension = rep.getJobEntryAttributeBoolean( id_jobentry, "AddDateBeforeExtension" );

    String addToResult = rep.getJobEntryAttributeString( id_jobentry, "isaddresult" );
    if ( Utils.isEmpty( addToResult ) ) {
      isaddresult = true;
    } else {
      isaddresult = rep.getJobEntryAttributeBoolean( id_jobentry, "isaddresult" );
    }

    createmovefolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createmovefolder" );

    proxyHost = rep.getJobEntryAttributeString( id_jobentry, "proxy_host" );
    proxyPort = rep.getJobEntryAttributeString( id_jobentry, "proxy_port" );
    proxyUsername = rep.getJobEntryAttributeString( id_jobentry, "proxy_username" );
    proxyPassword =
      Encr
        .decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "proxy_password" ) );

    ifFileExists = getFileExistsIndex( rep.getJobEntryAttributeString( id_jobentry, "ifFileExists" ) );
    nr_limit = rep.getJobEntryAttributeString( id_jobentry, "nr_limit" );
    success_condition =
      Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "success_condition" ), SUCCESS_IF_NO_ERRORS );
    connectionType =
      FTPSConnection.getConnectionTypeByCode( Const.NVL( rep.getJobEntryAttributeString(
        id_jobentry, "connection_type" ), "" ) );
  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'FTPS' from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}
 
Example 20
Source File: JobEntryTrans.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
                     List<SlaveServer> slaveServers ) throws KettleException {
  try {
    String method = rep.getJobEntryAttributeString( id_jobentry, "specification_method" );
    specificationMethod = ObjectLocationSpecificationMethod.getSpecificationMethodByCode( method );
    String transId = rep.getJobEntryAttributeString( id_jobentry, "trans_object_id" );
    transObjectId = Utils.isEmpty( transId ) ? null : new StringObjectId( transId );
    transname = rep.getJobEntryAttributeString( id_jobentry, "name" );
    directory = rep.getJobEntryAttributeString( id_jobentry, "dir_path" );
    filename = rep.getJobEntryAttributeString( id_jobentry, "file_name" );

    // Backward compatibility check for object specification
    //
    checkObjectLocationSpecificationMethod();

    argFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    paramsFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, "params_from_previous" );
    execPerRow = rep.getJobEntryAttributeBoolean( id_jobentry, "exec_per_row" );
    clearResultRows = rep.getJobEntryAttributeBoolean( id_jobentry, "clear_rows", true );
    clearResultFiles = rep.getJobEntryAttributeBoolean( id_jobentry, "clear_files", true );
    setLogfile = rep.getJobEntryAttributeBoolean( id_jobentry, "set_logfile" );
    addDate = rep.getJobEntryAttributeBoolean( id_jobentry, "add_date" );
    addTime = rep.getJobEntryAttributeBoolean( id_jobentry, "add_time" );
    logfile = rep.getJobEntryAttributeString( id_jobentry, "logfile" );
    logext = rep.getJobEntryAttributeString( id_jobentry, "logext" );
    logFileLevel = LogLevel.getLogLevelForCode( rep.getJobEntryAttributeString( id_jobentry, "loglevel" ) );
    clustering = rep.getJobEntryAttributeBoolean( id_jobentry, "cluster" );
    createParentFolder = rep.getJobEntryAttributeBoolean( id_jobentry, "create_parent_folder" );

    remoteSlaveServerName = rep.getJobEntryAttributeString( id_jobentry, "slave_server_name" );
    setAppendLogfile = rep.getJobEntryAttributeBoolean( id_jobentry, "set_append_logfile" );
    waitingToFinish = rep.getJobEntryAttributeBoolean( id_jobentry, "wait_until_finished", true );
    followingAbortRemotely = rep.getJobEntryAttributeBoolean( id_jobentry, "follow_abort_remote" );
    loggingRemoteWork = rep.getJobEntryAttributeBoolean( id_jobentry, "logging_remote_work" );
    runConfiguration = rep.getJobEntryAttributeString( id_jobentry, "run_configuration" );
    setSuppressResultData( rep.getJobEntryAttributeBoolean( id_jobentry, "suppress_result_data", false ) );

    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "argument" );
    allocateArgs( argnr );

    // Read all arguments...
    for ( int a = 0; a < argnr; a++ ) {
      arguments[ a ] = rep.getJobEntryAttributeString( id_jobentry, a, "argument" );
    }

    // How many arguments?
    int parameternr = rep.countNrJobEntryAttributes( id_jobentry, "parameter_name" );
    allocateParams( parameternr );

    // Read all parameters ...
    for ( int a = 0; a < parameternr; a++ ) {
      parameters[ a ] = rep.getJobEntryAttributeString( id_jobentry, a, "parameter_name" );
      parameterFieldNames[ a ] = rep.getJobEntryAttributeString( id_jobentry, a, "parameter_stream_name" );
      parameterValues[ a ] = rep.getJobEntryAttributeString( id_jobentry, a, "parameter_value" );
    }

    passingAllParameters = rep.getJobEntryAttributeBoolean( id_jobentry, "pass_all_parameters", true );

  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'trans' from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}