Search in sources :

Example 16 with DataSourceType

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

the class BaseJsonValidationServiceTest 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 17 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 18 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 19 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 20 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)21 JsonDataSource (io.atlasmap.json.v2.JsonDataSource)2 XmlDataSource (io.atlasmap.xml.v2.XmlDataSource)2 DataShapeKinds (io.syndesis.common.model.DataShapeKinds)2 ArrayList (java.util.ArrayList)2 XmlNamespaces (io.atlasmap.xml.v2.XmlNamespaces)1 Marshaller (javax.xml.bind.Marshaller)1 AbstractProcessType (org.geotoolkit.sml.xml.v100.AbstractProcessType)1 Capabilities (org.geotoolkit.sml.xml.v100.Capabilities)1 Characteristics (org.geotoolkit.sml.xml.v100.Characteristics)1 Classification (org.geotoolkit.sml.xml.v100.Classification)1 ComponentType (org.geotoolkit.sml.xml.v100.ComponentType)1 Contact (org.geotoolkit.sml.xml.v100.Contact)1 DataSourceType (org.geotoolkit.sml.xml.v100.DataSourceType)1 Documentation (org.geotoolkit.sml.xml.v100.Documentation)1 History (org.geotoolkit.sml.xml.v100.History)1 Identification (org.geotoolkit.sml.xml.v100.Identification)1 Keywords (org.geotoolkit.sml.xml.v100.Keywords)1 LegalConstraint (org.geotoolkit.sml.xml.v100.LegalConstraint)1 Member (org.geotoolkit.sml.xml.v100.Member)1