use of io.syndesis.common.model.DataShapeKinds in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method processPrecedingSteps.
/**
* Using output datashape, generates jsonInspectionResponse for steps preceding atlasMapping we want to generate. In
* case, the specification is of JavaClass-type, is only transforms this scpecification into required Field listing.
* The jsonInspectionResponse is stored in StepDefinition.
*/
private void processPrecedingSteps() {
precedingSteps.stream().filter(s -> s.getStep().getAction().isPresent()).forEach(s -> {
String stepSpecification = s.getStep().getAction().get().getOutputDataShape().get().getSpecification();
DataShapeKinds dsKind = s.getStep().getAction().get().getOutputDataShape().get().getKind();
s.setInspectionResponseFields(processDataShapeIntoFields(stepSpecification, dsKind));
});
}
use of io.syndesis.common.model.DataShapeKinds in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method processFolowingStep.
/**
* Using input datashape, generates jsonInspectionResponse for step following after atlasMapping we want to
* generate. The jsonInspectionResponse is stored in StepDefinition.
*
* @param followingStep
*/
private void processFolowingStep(StepDefinition followingStep) {
String stepSpecification = followingStep.getConnectorDescriptor().get().getInputDataShape().get().getSpecification();
DataShapeKinds dsKind = followingStep.getConnectorDescriptor().get().getInputDataShape().get().getKind();
followingStep.setInspectionResponseFields(Optional.ofNullable(processDataShapeIntoFields(stepSpecification, dsKind)));
}
use of io.syndesis.common.model.DataShapeKinds in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method processPrecedingSteps.
/**
* Using output datashape, generates jsonInspectionResponse for steps preceding atlasMapping we want to generate. In
* case, the specification is of JavaClass-type, is only transforms this scpecification into required Field listing.
* The jsonInspectionResponse is stored in StepDefinition.
*
* @param precedingSteps
*/
private void processPrecedingSteps(List<StepDefinition> precedingSteps) {
for (StepDefinition s : precedingSteps) {
String stepSpecification = s.getConnectorDescriptor().get().getOutputDataShape().get().getSpecification();
DataShapeKinds dsKind = s.getConnectorDescriptor().get().getOutputDataShape().get().getKind();
s.setInspectionResponseFields(Optional.ofNullable(processDataShapeIntoFields(stepSpecification, dsKind)));
}
}
use of io.syndesis.common.model.DataShapeKinds 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;
}
use of io.syndesis.common.model.DataShapeKinds in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method processFollowingStep.
/**
* Using input datashape, generates jsonInspectionResponse for step following after atlasMapping we want to
* generate. The jsonInspectionResponse is stored in StepDefinition.
*/
private void processFollowingStep() {
String stepSpecification = followingStep.getStep().getAction().get().getInputDataShape().get().getSpecification();
DataShapeKinds dsKind = followingStep.getStep().getAction().get().getInputDataShape().get().getKind();
followingStep.setInspectionResponseFields(processDataShapeIntoFields(stepSpecification, dsKind));
}
Aggregations