use of io.syndesis.common.model.DataShape in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method processTarget.
/**
* Gets input data shape for specified step, which should follow after the mapping.
*
* @param followingStep
* @return
*/
private DataSource processTarget(StepDefinition followingStep) {
DataSource target = null;
DataShape inDataShape = followingStep.getConnectorDescriptor().get().getInputDataShape().get();
target = createDataSource(inDataShape, followingStep, DataSourceType.TARGET);
return target;
}
use of io.syndesis.common.model.DataShape in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method getMapperStepAction.
public Action getMapperStepAction(ConnectorDescriptor outputConnectorDescriptor) {
ObjectMapper mapper = new ObjectMapper().registerModules(new Jdk8Module());
Action ts = new StepAction.Builder().descriptor(new StepDescriptor.Builder().build()).build();
try {
DataShape inputDataShape = new DataShape.Builder().kind(DataShapeKinds.ANY).name("All preceding outputs").build();
JSONObject json = new JSONObject(mapper.writeValueAsString(ts));
JSONObject inputDataType = new JSONObject(mapper.writeValueAsString(inputDataShape));
JSONObject outputDataType = new JSONObject(mapper.writeValueAsString(outputConnectorDescriptor.getInputDataShape().get()));
json.getJSONObject("descriptor").put("inputDataShape", inputDataType);
json.getJSONObject("descriptor").put("outputDataShape", outputDataType);
ts = Json.reader().forType(Action.class).readValue(json.toString());
log.debug(mapper.writeValueAsString(ts));
} catch (IOException ex) {
log.error("Error: " + ex);
}
return ts;
}
use of io.syndesis.common.model.DataShape in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method processSources.
/**
* Gets list of output data shapes for preceding steps.
*
* @param precedingSteps
* @return
*/
private List<DataSource> processSources(List<StepDefinition> precedingSteps) {
List<DataSource> sources = new ArrayList<>();
for (StepDefinition s : precedingSteps) {
DataShape outDataShape = s.getConnectorDescriptor().get().getOutputDataShape().get();
sources.add(createDataSource(outDataShape, s, DataSourceType.SOURCE));
}
return sources;
}
Aggregations