Search in sources :

Example 6 with DataSourceType

use of io.atlasmap.v2.DataSourceType in project syndesis-qe by syndesisio.

the class AtlasMapperGenerator method createDataSource.

/**
 * Used to generate data source elements for atlasMapping. There are three types of them: Java, Json, XML.
 *
 * TODO(tplevko): update also for XML
 *
 * @param dataShape
 * @param step
 * @param dataSourceType
 * @return
 */
private DataSource createDataSource(DataShape dataShape, StepDefinition step, DataSourceType dataSourceType) {
    DataShapeKinds dataShapeKind = dataShape.getKind();
    DataSource source = null;
    if (dataShapeKind.toString().contains("json")) {
        source = new JsonDataSource();
        source.setUri("atlas:" + "json:" + step.getStep().getId().get());
    } else if (dataShapeKind.toString().contains("java")) {
        source = new DataSource();
        source.setUri("atlas:" + "java:" + step.getStep().getId().get() + "?className=" + dataShape.getType());
    } else if (dataShapeKind.toString().contains("xml")) {
        source = new XmlDataSource();
    // TODO(tplevko): find out how should look the XML datasource definition
    }
    source.setId(step.getStep().getId().get());
    source.setDataSourceType(dataSourceType);
    return source;
}
Also used : JsonDataSource(io.atlasmap.json.v2.JsonDataSource) DataShapeKinds(io.syndesis.common.model.DataShapeKinds) DataSource(io.atlasmap.v2.DataSource) JsonDataSource(io.atlasmap.json.v2.JsonDataSource) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource) XmlDataSource(io.atlasmap.xml.v2.XmlDataSource)

Example 7 with DataSourceType

use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.

the class XmlValidationServiceTest method generateDataSource.

protected DataSource generateDataSource(String uri, DataSourceType type) {
    DataSource ds = new DataSource();
    ds.setUri(uri);
    ds.setDataSourceType(type);
    return ds;
}
Also used : DataSource(io.atlasmap.v2.DataSource)

Example 8 with DataSourceType

use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.

the class JsonValidationServiceTest method generateDataSource.

protected DataSource generateDataSource(String uri, DataSourceType type) {
    DataSource ds = new DataSource();
    ds.setUri(uri);
    ds.setDataSourceType(type);
    return ds;
}
Also used : DataSource(io.atlasmap.v2.DataSource)

Example 9 with DataSourceType

use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.

the class JsonJsonFlatMappingTest method generateDataSource.

protected DataSource generateDataSource(String uri, DataSourceType type) {
    DataSource ds = new DataSource();
    ds.setUri(uri);
    ds.setDataSourceType(type);
    return ds;
}
Also used : DataSource(io.atlasmap.v2.DataSource)

Example 10 with DataSourceType

use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.

the class JavaJavaDateTimeMappingTest method addDataSource.

private void addDataSource(AtlasMapping mapping, String uri, DataSourceType type) {
    DataSource ds = new DataSource();
    ds.setUri(uri);
    ds.setDataSourceType(type);
    mapping.getDataSource().add(ds);
}
Also used : DataSource(io.atlasmap.v2.DataSource)

Aggregations

DataSource (io.atlasmap.v2.DataSource)12 JsonDataSource (io.atlasmap.json.v2.JsonDataSource)1 XmlDataSource (io.atlasmap.xml.v2.XmlDataSource)1 DataShapeKinds (io.syndesis.common.model.DataShapeKinds)1