use of org.talend.components.api.exception.ComponentException in project components by Talend.
the class PythonRowDefinition method getRuntimeInfo.
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
assertEngineCompatibility(engine);
assertConnectorTopologyCompatibility(connectorTopology);
try {
return new JarRuntimeInfo(new URL("mvn:org.talend.components/processing-runtime"), DependenciesReader.computeDependenciesFilePath(ProcessingFamilyDefinition.MAVEN_GROUP_ID, ProcessingFamilyDefinition.MAVEN_ARTIFACT_ID), "org.talend.components.processing.runtime.pythonrow.PythonRowDoFn");
} catch (MalformedURLException e) {
throw new ComponentException(e);
}
}
use of org.talend.components.api.exception.ComponentException in project components by Talend.
the class WindowDefinition method getRuntimeInfo.
@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
assertEngineCompatibility(engine);
assertConnectorTopologyCompatibility(connectorTopology);
try {
return new JarRuntimeInfo(new URL("mvn:org.talend.components/processing-runtime"), DependenciesReader.computeDependenciesFilePath(ProcessingFamilyDefinition.MAVEN_GROUP_ID, ProcessingFamilyDefinition.MAVEN_ARTIFACT_ID), "org.talend.components.processing.runtime.window.WindowRuntime");
} catch (MalformedURLException e) {
throw new ComponentException(e);
}
}
use of org.talend.components.api.exception.ComponentException in project components by Talend.
the class PubSubDatasetProperties method beforeTopic.
public ValidationResult beforeTopic() {
PubSubDatasetDefinition definition = new PubSubDatasetDefinition();
RuntimeInfo runtimeInfo = definition.getRuntimeInfo(this);
try (SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, getClass().getClassLoader())) {
IPubSubDatasetRuntime runtime = (IPubSubDatasetRuntime) sandboxedInstance.getInstance();
runtime.initialize(null, this);
List<NamedThing> topics = new ArrayList<>();
for (String topicName : runtime.listTopics()) {
topics.add(new SimpleNamedThing(topicName, topicName));
}
topic.setPossibleValues(topics);
return ValidationResult.OK;
} catch (Exception e) {
return new ValidationResult(new ComponentException(e));
}
}
use of org.talend.components.api.exception.ComponentException in project components by Talend.
the class PubSubOutputDefinition method getRuntimeInfo.
@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
assertEngineCompatibility(engine);
assertConnectorTopologyCompatibility(connectorTopology);
try {
return new JarRuntimeInfo(new URL("mvn:org.talend.components/pubsub-runtime"), DependenciesReader.computeDependenciesFilePath("org.talend.components", "pubsub-runtime"), RUNTIME);
} catch (MalformedURLException e) {
throw new ComponentException(e);
}
}
use of org.talend.components.api.exception.ComponentException in project components by Talend.
the class SalesforceModuleListProperties method beforeFormPresentMain.
public void beforeFormPresentMain() throws Exception {
try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) {
SalesforceRuntimeSourceOrSink ss = (SalesforceRuntimeSourceOrSink) sandboxedInstance.getInstance();
ss.initialize(null, this);
ValidationResult vr = ss.validate(null);
if (vr.getStatus() == ValidationResult.Result.OK) {
try {
moduleNames = ss.getSchemaNames(null);
} catch (Exception ex) {
throw new ComponentException(ExceptionUtil.exceptionToValidationResult(ex));
}
selectedModuleNames.setPossibleValues(moduleNames);
getForm(Form.MAIN).setAllowBack(true);
getForm(Form.MAIN).setAllowFinish(true);
} else {
throw new ComponentException(vr);
}
}
}
Aggregations