use of com.sequenceiq.cloudbreak.domain.FlowChainLog in project cloudbreak by hortonworks.
the class FlowLogService method saveChain.
public FlowChainLog saveChain(String flowChainId, String parentFlowChainId, Queue<Selectable> chain) {
String chainJson = JsonWriter.objectToJson(chain);
FlowChainLog chainLog = new FlowChainLog(flowChainId, parentFlowChainId, chainJson);
return flowChainLogRepository.save(chainLog);
}
use of com.sequenceiq.cloudbreak.domain.FlowChainLog in project cloudbreak by hortonworks.
the class FlowChainHandler method restoreFlowChain.
public void restoreFlowChain(String flowChainId) {
FlowChainLog chainLog = flowChainLogRepository.findFirstByFlowChainIdOrderByCreatedDesc(flowChainId);
if (chainLog != null) {
Queue<Selectable> chain = (Queue<Selectable>) JsonReader.jsonToJava(chainLog.getChain());
flowChains.putFlowChain(flowChainId, chainLog.getParentFlowChainId(), chain);
if (chainLog.getParentFlowChainId() != null) {
restoreFlowChain(chainLog.getParentFlowChainId());
}
}
}
Aggregations