diff options
Diffstat (limited to 'models-interactions/model-yaml')
-rw-r--r-- | models-interactions/model-yaml/pom.xml | 2 | ||||
-rw-r--r-- | models-interactions/model-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/models-interactions/model-yaml/pom.xml b/models-interactions/model-yaml/pom.xml index 56df41fbe..fb80eafa6 100644 --- a/models-interactions/model-yaml/pom.xml +++ b/models-interactions/model-yaml/pom.xml @@ -52,7 +52,7 @@ <dependency> <groupId>org.jgrapht</groupId> <artifactId>jgrapht-core</artifactId> - <version>0.9.2</version> + <version>1.2.0</version> </dependency> <dependency> <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId> diff --git a/models-interactions/model-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java b/models-interactions/model-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java index 0bfc9062a..5204a1b7f 100644 --- a/models-interactions/model-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java +++ b/models-interactions/model-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java @@ -27,7 +27,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import org.apache.commons.lang3.StringUtils; -import org.jgrapht.DirectedGraph; +import org.jgrapht.Graph; import org.jgrapht.graph.ClassBasedEdgeFactory; import org.jgrapht.graph.DefaultEdge; import org.jgrapht.graph.DirectedMultigraph; @@ -115,7 +115,7 @@ public class ControlLoopCompiler implements Serializable { // // For this version we can use a directed multigraph, in the future we may not be able to // - DirectedGraph<NodeWrapper, LabeledEdge> graph = + Graph<NodeWrapper, LabeledEdge> graph = new DirectedMultigraph<>(new ClassBasedEdgeFactory<NodeWrapper, LabeledEdge>(LabeledEdge.class)); // @@ -226,7 +226,7 @@ public class ControlLoopCompiler implements Serializable { } private static Map<Policy, PolicyNodeWrapper> addPoliciesAsNodes(ControlLoopPolicy policy, - DirectedGraph<NodeWrapper, LabeledEdge> graph, TriggerNodeWrapper triggerNode, + Graph<NodeWrapper, LabeledEdge> graph, TriggerNodeWrapper triggerNode, ControlLoopCompilerCallback callback) { Map<Policy, PolicyNodeWrapper> mapNodes = new HashMap<>(); for (Policy operPolicy : policy.getPolicies()) { @@ -259,7 +259,7 @@ public class ControlLoopCompiler implements Serializable { return mapNodes; } - private static void addEdge(DirectedGraph<NodeWrapper, LabeledEdge> graph, Map<Policy, PolicyNodeWrapper> mapNodes, + private static void addEdge(Graph<NodeWrapper, LabeledEdge> graph, Map<Policy, PolicyNodeWrapper> mapNodes, String policyId, String connectedPolicy, FinalResultNodeWrapper finalResultNodeWrapper, PolicyResult policyResult, NodeWrapper node) throws CompilerException { @@ -278,7 +278,7 @@ public class ControlLoopCompiler implements Serializable { } } - private static void validateNodesAndEdges(DirectedGraph<NodeWrapper, LabeledEdge> graph, + private static void validateNodesAndEdges(Graph<NodeWrapper, LabeledEdge> graph, ControlLoopCompilerCallback callback) throws CompilerException { for (NodeWrapper node : graph.vertexSet()) { if (node instanceof TriggerNodeWrapper) { @@ -294,7 +294,7 @@ public class ControlLoopCompiler implements Serializable { } } - private static void validateTriggerNodeWrapper(DirectedGraph<NodeWrapper, LabeledEdge> graph, + private static void validateTriggerNodeWrapper(Graph<NodeWrapper, LabeledEdge> graph, NodeWrapper node) throws CompilerException { if (LOGGER.isDebugEnabled()) { LOGGER.info("Trigger Node {}", node); @@ -313,7 +313,7 @@ public class ControlLoopCompiler implements Serializable { } } - private static void validateFinalResultNodeWrapper(DirectedGraph<NodeWrapper, LabeledEdge> graph, + private static void validateFinalResultNodeWrapper(Graph<NodeWrapper, LabeledEdge> graph, NodeWrapper node) throws CompilerException { if (LOGGER.isDebugEnabled()) { LOGGER.info("FinalResult Node {}", node); @@ -326,7 +326,7 @@ public class ControlLoopCompiler implements Serializable { } } - private static void validatePolicyNodeWrapper(DirectedGraph<NodeWrapper, LabeledEdge> graph, + private static void validatePolicyNodeWrapper(Graph<NodeWrapper, LabeledEdge> graph, NodeWrapper node, ControlLoopCompilerCallback callback) throws CompilerException { if (LOGGER.isDebugEnabled()) { LOGGER.info("Policy Node {}", node); |