Search in sources :

Example 16 with ValidationResultMutable

use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.

the class MarketoSourceOrSink method validateConnection.

public ValidationResult validateConnection(MarketoProvideConnectionProperties properties) {
    ValidationResultMutable vr = new ValidationResultMutable().setStatus(Result.OK);
    try {
        MarketoSourceOrSink sos = new MarketoSourceOrSink();
        sos.initialize(null, (ComponentProperties) properties);
        sos.getClientService(null);
        vr.setMessage(messages.getMessage("success.validation.connection"));
    } catch (IOException e) {
        vr.setStatus(Result.ERROR);
        vr.setMessage(messages.getMessage("error.validation.connection.testconnection", e.getLocalizedMessage()));
    }
    return vr;
}
Also used : ValidationResultMutable(org.talend.daikon.properties.ValidationResultMutable) IOException(java.io.IOException)

Example 17 with ValidationResultMutable

use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.

the class GoogleDriveValidator method validateListProperties.

public ValidationResult validateListProperties(GoogleDriveListProperties properties) {
    ValidationResultMutable vr = new ValidationResultMutable(Result.OK);
    if (StringUtils.isEmpty(properties.folder.getValue())) {
        vr.setStatus(Result.ERROR);
        vr.setMessage(messages.getMessage("error.validation.folder.empty"));
        return vr;
    }
    return vr;
}
Also used : ValidationResultMutable(org.talend.daikon.properties.ValidationResultMutable)

Example 18 with ValidationResultMutable

use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.

the class GoogleDriveValidator method validateGetProperties.

public ValidationResult validateGetProperties(GoogleDriveGetProperties properties) {
    ValidationResultMutable vr = new ValidationResultMutable(Result.OK);
    if (StringUtils.isEmpty(properties.file.getValue())) {
        vr.setStatus(Result.ERROR);
        vr.setMessage(messages.getMessage("error.validation.filename.empty"));
        return vr;
    }
    return vr;
}
Also used : ValidationResultMutable(org.talend.daikon.properties.ValidationResultMutable)

Example 19 with ValidationResultMutable

use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.

the class GoogleDriveValidator method validateDeleteProperties.

public ValidationResult validateDeleteProperties(GoogleDriveDeleteProperties properties) {
    ValidationResultMutable vr = new ValidationResultMutable(Result.OK);
    if (StringUtils.isEmpty(properties.file.getValue())) {
        vr.setStatus(Result.ERROR);
        vr.setMessage(messages.getMessage("error.validation.delete.file.empty"));
        return vr;
    }
    return vr;
}
Also used : ValidationResultMutable(org.talend.daikon.properties.ValidationResultMutable)

Example 20 with ValidationResultMutable

use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.

the class GoogleDriveValidator method validateCopyProperties.

public ValidationResult validateCopyProperties(GoogleDriveCopyProperties properties) {
    ValidationResultMutable vr = new ValidationResultMutable(Result.OK);
    if (StringUtils.isEmpty(properties.destinationFolder.getValue())) {
        vr.setStatus(Result.ERROR);
        vr.setMessage(messages.getMessage("error.validation.destinationFolderName.empty"));
        return vr;
    }
    if (StringUtils.isEmpty(properties.source.getValue())) {
        vr.setStatus(Result.ERROR);
        vr.setMessage(messages.getMessage("error.validation.source.empty"));
        return vr;
    }
    if (properties.rename.getValue()) {
        if (StringUtils.isEmpty(properties.newName.getValue())) {
            vr.setStatus(Result.ERROR);
            vr.setMessage(messages.getMessage("error.validation.newname.empty"));
            return vr;
        }
    }
    return vr;
}
Also used : ValidationResultMutable(org.talend.daikon.properties.ValidationResultMutable)

Aggregations

ValidationResultMutable (org.talend.daikon.properties.ValidationResultMutable)41 IOException (java.io.IOException)11 SandboxedInstance (org.talend.daikon.sandbox.SandboxedInstance)8 ValidationResult (org.talend.daikon.properties.ValidationResult)7 SQLException (java.sql.SQLException)5 Schema (org.apache.avro.Schema)5 MarketoComponentDefinition.getSandboxedInstance (org.talend.components.marketo.MarketoComponentDefinition.getSandboxedInstance)3 MarketoSourceOrSinkRuntime (org.talend.components.marketo.runtime.MarketoSourceOrSinkRuntime)3 SalesforceDefinition.getSandboxedInstance (org.talend.components.salesforce.SalesforceDefinition.getSandboxedInstance)3 SalesforceRuntimeSourceOrSink (org.talend.components.salesforce.common.SalesforceRuntimeSourceOrSink)3 User (com.google.api.services.drive.model.User)2 File (java.io.File)2 GeneralSecurityException (java.security.GeneralSecurityException)2 Connection (java.sql.Connection)2 MarketoSourceOrSinkSchemaProvider (org.talend.components.marketo.runtime.MarketoSourceOrSinkSchemaProvider)2 TMarketoInputProperties (org.talend.components.marketo.tmarketoinput.TMarketoInputProperties)2 LeadSelector (org.talend.components.marketo.tmarketoinput.TMarketoInputProperties.LeadSelector)2 SalesforceSchemaHelper (org.talend.components.salesforce.schema.SalesforceSchemaHelper)2 NamedThing (org.talend.daikon.NamedThing)2 TalendRuntimeException (org.talend.daikon.exception.TalendRuntimeException)2