com.marklogic.hub.step.MarkLogicStepDefinitionProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marklogic-data-hub Show documentation
Show all versions of marklogic-data-hub Show documentation
Library for Creating an Operational Data Hub on MarkLogic
package com.marklogic.hub.step;
import com.fasterxml.jackson.databind.JsonNode;
import com.marklogic.client.DatabaseClient;
import com.marklogic.hub.dataservices.StepDefinitionService;
/**
* Implementation that retrieves step definitions from MarkLogic via a data service.
*/
public class MarkLogicStepDefinitionProvider implements StepDefinitionProvider {
private final StepDefinitionService service;
public MarkLogicStepDefinitionProvider(DatabaseClient databaseClient) {
this.service = StepDefinitionService.on(databaseClient);
}
@Override
public StepDefinition getStepDefinition(String name, StepDefinition.StepDefinitionType type) {
JsonNode json = service.getStepDefinition(name, type.name());
StepDefinition step = StepDefinition.create(name, type);
step.deserialize(json);
return step;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy