Search in sources :

Example 41 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryFTPSPUT method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "servername", serverName);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "serverport", serverPort);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "username", userName);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "password", Encr.encryptPasswordIfNotUsingVariables(password));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "remoteDirectory", remoteDirectory);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "localDirectory", localDirectory);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcard", wildcard);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "binary", binaryMode);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "timeout", timeout);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "remove", remove);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "only_new", onlyPuttingNewFiles);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "active", activeConnection);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_host", proxyHost);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_port", proxyPort);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_username", proxyUsername);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "proxy_password", proxyPassword);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "connection_type", FTPSConnection.getConnectionType(connectionType));
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobFTPSPUT.UnableToSaveToRepo", String.valueOf(id_job)), dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 42 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryMail method saveRep.

public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "server", server);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "port", port);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "destination", destination);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "destinationCc", destinationCc);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "destinationBCc", destinationBCc);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "replyto", replyAddress);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "replytoname", replyName);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "subject", subject);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "include_date", includeDate);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "contact_person", contactPerson);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "contact_phone", contactPhone);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "comment", comment);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "encoding", encoding);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "priority", priority);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "importance", importance);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "sensitivity", sensitivity);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "include_files", includingFiles);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "use_auth", usingAuthentication);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "use_secure_auth", usingSecureAuthentication);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "auth_user", authenticationUser);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "auth_password", Encr.encryptPasswordIfNotUsingVariables(authenticationPassword));
        rep.saveJobEntryAttribute(id_job, getObjectId(), "only_comment", onlySendComment);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "use_HTML", useHTML);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "use_Priority", usePriority);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "secureconnectiontype", secureConnectionType);
        if (fileType != null) {
            for (int i = 0; i < fileType.length; i++) {
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "file_type", ResultFile.getTypeCode(fileType[i]));
            }
        }
        rep.saveJobEntryAttribute(id_job, getObjectId(), "zip_files", zipFiles);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "zip_name", zipFilename);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "replyToAddresses", replyToAddresses);
        // save the arguments...
        if (embeddedimages != null) {
            for (int i = 0; i < embeddedimages.length; i++) {
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "embeddedimage", embeddedimages[i]);
                rep.saveJobEntryAttribute(id_job, getObjectId(), i, "contentid", contentids[i]);
            }
        }
    } catch (KettleDatabaseException dbe) {
        throw new KettleException("Unable to save job entry of type 'mail' to the repository for id_job=" + id_job, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 43 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryMailValidator method loadRep.

public void loadRep(Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException {
    try {
        smtpCheck = rep.getJobEntryAttributeBoolean(id_jobentry, "smtpCheck");
        timeout = rep.getJobEntryAttributeString(id_jobentry, "timeout");
        defaultSMTP = rep.getJobEntryAttributeString(id_jobentry, "defaultSMTP");
        emailSender = rep.getJobEntryAttributeString(id_jobentry, "emailSender");
        emailAddress = rep.getJobEntryAttributeString(id_jobentry, "emailAddress");
    } catch (KettleDatabaseException dbe) {
        throw new KettleException(BaseMessages.getString(PKG, "JobEntryMailValidator.Meta.UnableToLoadFromRep") + id_jobentry, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 44 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryMsgBoxInfo method saveRep.

// Save the attributes of this job entry
// 
public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_job) throws KettleException {
    try {
        rep.saveJobEntryAttribute(id_job, getObjectId(), "bodymessage", bodymessage);
        rep.saveJobEntryAttribute(id_job, getObjectId(), "titremessage", titremessage);
    } catch (KettleDatabaseException dbe) {
        throw new KettleException("Unable to save job entry of type 'Msgbox Info' to the repository for id_job=" + id_job, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Example 45 with KettleDatabaseException

use of org.pentaho.di.core.exception.KettleDatabaseException in project pentaho-kettle by pentaho.

the class JobEntryMsgBoxInfo method loadRep.

public void loadRep(Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException {
    try {
        bodymessage = rep.getJobEntryAttributeString(id_jobentry, "bodymessage");
        titremessage = rep.getJobEntryAttributeString(id_jobentry, "titremessage");
    } catch (KettleDatabaseException dbe) {
        throw new KettleException("Unable to load job entry of type 'Msgbox Info' from the repository with id_jobentry=" + id_jobentry, dbe);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException)

Aggregations

KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)279 KettleException (org.pentaho.di.core.exception.KettleException)176 SQLException (java.sql.SQLException)69 Database (org.pentaho.di.core.database.Database)46 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)41 KettleValueException (org.pentaho.di.core.exception.KettleValueException)39 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)37 KettleDatabaseBatchException (org.pentaho.di.core.exception.KettleDatabaseBatchException)33 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)31 BatchUpdateException (java.sql.BatchUpdateException)27 ResultSet (java.sql.ResultSet)27 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)26 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)25 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)24 RowMeta (org.pentaho.di.core.row.RowMeta)22 FileObject (org.apache.commons.vfs2.FileObject)18 LongObjectId (org.pentaho.di.repository.LongObjectId)17 Savepoint (java.sql.Savepoint)16 ArrayList (java.util.ArrayList)16 Test (org.junit.Test)14