use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.
the class SnowflakeConnectionProperties method validateTestConnection.
public ValidationResult validateTestConnection() throws Exception {
ValidationResultMutable vr = new ValidationResultMutable(SnowflakeSourceOrSink.validateConnection(this));
if (vr.getStatus() == ValidationResult.Result.OK) {
vr.setMessage(i18nMessages.getMessage("messages.connectionSuccessful"));
getForm(FORM_WIZARD).setAllowForward(true);
} else {
getForm(FORM_WIZARD).setAllowForward(false);
}
return vr;
}
use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.
the class TMarketoBulkExecProperties method validateBulkImportTo.
public ValidationResult validateBulkImportTo() {
ValidationResultMutable vr = new ValidationResultMutable().setStatus(Result.OK);
if (isApiSOAP()) {
vr.setStatus(Result.ERROR);
vr.setMessage(messages.getMessage("error.validation.soap.bulkexec"));
return vr;
}
return vr;
}
use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.
the class TMarketoInputProperties method validateFetchCustomObjectSchema.
public ValidationResult validateFetchCustomObjectSchema() {
ValidationResultMutable vr = new ValidationResultMutable();
try (SandboxedInstance sandboxedInstance = getSandboxedInstance(RUNTIME_SOURCEORSINK_CLASS, USE_CURRENT_JVM_PROPS)) {
MarketoSourceOrSinkRuntime sos = (MarketoSourceOrSinkRuntime) sandboxedInstance.getInstance();
sos.initialize(null, this);
ValidationResult vConn = sos.validateConnection(this);
if (!Result.OK.equals(vConn.getStatus())) {
return vConn;
}
try {
Schema schema = ((MarketoSourceOrSinkSchemaProvider) sos).getSchemaForCustomObject(customObjectName.getValue());
if (schema == null) {
vr.setStatus(ValidationResult.Result.ERROR).setMessage(messages.getMessage("error.validation.customobjects.fetchcustomobjectschema", customObjectName.getValue(), "NULL"));
return vr;
}
schemaInput.schema.setValue(schema);
vr.setStatus(ValidationResult.Result.OK);
} catch (RuntimeException | IOException e) {
vr.setStatus(ValidationResult.Result.ERROR).setMessage(messages.getMessage("error.validation.customobjects.fetchcustomobjectschema", customObjectName.getValue(), e.getMessage()));
}
}
return vr;
}
use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.
the class TMarketoInputProperties method validateInputOperation.
public ValidationResult validateInputOperation() {
if (isApiSOAP()) {
switch(inputOperation.getValue()) {
case getLead:
case getMultipleLeads:
case getLeadActivity:
case getLeadChanges:
return ValidationResult.OK;
case CustomObject:
ValidationResultMutable vr = new ValidationResultMutable();
vr.setStatus(Result.ERROR);
vr.setMessage(messages.getMessage("error.validation.customobjects.nosoap"));
return vr;
}
}
return ValidationResult.OK;
}
use of org.talend.daikon.properties.ValidationResultMutable in project components by Talend.
the class TMarketoInputProperties method validateFetchCompoundKey.
public ValidationResult validateFetchCompoundKey() {
ValidationResultMutable vr = new ValidationResultMutable();
try (SandboxedInstance sandboxedInstance = getSandboxedInstance(RUNTIME_SOURCEORSINK_CLASS, USE_CURRENT_JVM_PROPS)) {
MarketoSourceOrSinkRuntime sos = (MarketoSourceOrSinkRuntime) sandboxedInstance.getInstance();
sos.initialize(null, this);
ValidationResult vConn = sos.validateConnection(this);
if (!Result.OK.equals(vConn.getStatus())) {
return vConn;
}
try {
List<String> keys = ((MarketoSourceOrSinkSchemaProvider) sos).getCompoundKeyFields(customObjectName.getValue());
if (keys == null) {
vr.setStatus(ValidationResult.Result.ERROR).setMessage(messages.getMessage("error.validation.customobjects.fetchcompoundkey", customObjectName.getValue(), "NULL"));
return vr;
}
compoundKey.keyName.setValue(keys);
compoundKey.keyValue.setValue(Arrays.asList(new String[keys.size()]));
vr.setStatus(ValidationResult.Result.OK);
} catch (RuntimeException | IOException e) {
vr.setStatus(ValidationResult.Result.ERROR).setMessage(messages.getMessage("error.validation.customobjects.fetchcompoundkey", customObjectName.getValue(), e.getMessage()));
}
}
return vr;
}
Aggregations