Search in sources :

Example 16 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class PubSubInputDefinition 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);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Example 17 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class S3OutputDefinition method getRuntimeInfo.

@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
    assertEngineCompatibility(engine);
    assertConnectorTopologyCompatibility(connectorTopology);
    try {
        switch(engine) {
            case DI:
                return new JarRuntimeInfo(new URL(SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_DI_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(SimpleFileIOComponentFamilyDefinition.MAVEN_GROUP_ID, SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_DI_RUNTIME_ARTIFACT_ID), DI_RUNTIME);
            case BEAM:
            default:
                return new JarRuntimeInfo(new URL(SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(SimpleFileIOComponentFamilyDefinition.MAVEN_GROUP_ID, SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_ARTIFACT_ID), RUNTIME);
        }
    } catch (MalformedURLException e) {
        throw new ComponentException(e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Example 18 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class ElasticsearchOutputDefinition method getRuntimeInfo.

@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
    assertEngineCompatibility(engine);
    assertConnectorTopologyCompatibility(connectorTopology);
    try {
        switch(((ElasticsearchOutputProperties) properties).getDatasetProperties().getDatastoreProperties().version.getValue()) {
            case V_2_4:
            default:
                return new JarRuntimeInfo(new URL(MAVEN_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(MAVEN_GROUP_ID, MAVEN_RUNTIME_ARTIFACT_ID), RUNTIME_2_4);
        }
    } catch (MalformedURLException e) {
        throw new ComponentException(e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Example 19 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class SimpleFileIOOutputDefinition method getRuntimeInfo.

@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
    assertEngineCompatibility(engine);
    assertConnectorTopologyCompatibility(connectorTopology);
    try {
        return new JarRuntimeInfo(new URL(SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(SimpleFileIOComponentFamilyDefinition.MAVEN_GROUP_ID, SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_ARTIFACT_ID), RUNTIME);
    } catch (MalformedURLException e) {
        throw new ComponentException(e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Example 20 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class HadoopClusterConfigurationInputDefinition method getRuntimeInfo.

@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
    assertEngineCompatibility(engine);
    assertConnectorTopologyCompatibility(connectorTopology);
    try {
        HadoopClusterConfigurationInputProperties inputProperties = (HadoopClusterConfigurationInputProperties) properties;
        switch(inputProperties.clusterManagerType.getValue()) {
            case AMBARI:
                return new JarRuntimeInfo(new URL(HadoopClusterFamilyDefinition.MAVEN_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(HadoopClusterFamilyDefinition.MAVEN_GROUP_ID, HadoopClusterFamilyDefinition.MAVEN_RUNTIME_ARTIFACT_ID), RUNTIME_AMBARI);
            case CLOUDERA_MANAGER:
                return new JarRuntimeInfo(new URL(HadoopClusterFamilyDefinition.MAVEN_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(HadoopClusterFamilyDefinition.MAVEN_GROUP_ID, HadoopClusterFamilyDefinition.MAVEN_RUNTIME_ARTIFACT_ID), RUNTIME_CM);
            default:
                throw new ComponentException(new RuntimeException("Do not support"));
        }
    } catch (MalformedURLException e) {
        throw new ComponentException(e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Aggregations

JarRuntimeInfo (org.talend.components.api.component.runtime.JarRuntimeInfo)44 URL (java.net.URL)28 MalformedURLException (java.net.MalformedURLException)27 ComponentException (org.talend.components.api.exception.ComponentException)27 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)7 Test (org.junit.Test)5 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Bundle (org.osgi.framework.Bundle)1 BusinessException (org.talend.commons.exception.BusinessException)1 ConnectorTopology (org.talend.components.api.component.ConnectorTopology)1 NetSuiteConnectionProperties (org.talend.components.netsuite.connection.NetSuiteConnectionProperties)1 ModuleNeeded (org.talend.core.model.general.ModuleNeeded)1 MavenArtifact (org.talend.core.runtime.maven.MavenArtifact)1