summaryrefslogtreecommitdiffstats
path: root/controlloop/common/policy-yaml
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2018-08-15 18:11:01 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-15 18:11:01 +0000
commit7ee4720a0a6a7a5ea418ebea0eeff845d70170d6 (patch)
treeb3362d9bd52c4f579b0078994e5766c8bac4f8f9 /controlloop/common/policy-yaml
parentbfb9c07ce52db84ada4f851a5b8f0efdda0828b8 (diff)
parentdbe1d23be5420a5efa4d3977fee974c452bbfd29 (diff)
Merge "Fix checkstyle issues"
Diffstat (limited to 'controlloop/common/policy-yaml')
-rw-r--r--controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java
index b088af78a..27c9bf8cd 100644
--- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java
+++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/compiler/ControlLoopCompiler.java
@@ -52,6 +52,9 @@ public class ControlLoopCompiler implements Serializable {
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = LoggerFactory.getLogger(ControlLoopCompiler.class.getName());
+ /**
+ * Compiles the policy from an object.
+ */
public static ControlLoopPolicy compile(ControlLoopPolicy policy,
ControlLoopCompilerCallback callback) throws CompilerException {
//
@@ -66,6 +69,15 @@ public class ControlLoopCompiler implements Serializable {
return policy;
}
+ /**
+ * Compiles the policy from an input stream.
+ *
+ * @param yamlSpecification the yaml input stream
+ * @param callback method to callback during compilation
+ * @return
+ *
+ * @throws CompilerException throws any compile exception found
+ */
public static ControlLoopPolicy compile(InputStream yamlSpecification,
ControlLoopCompilerCallback callback) throws CompilerException {
Yaml yaml = new Yaml(new Constructor(ControlLoopPolicy.class));
@@ -84,7 +96,7 @@ public class ControlLoopCompiler implements Serializable {
if (controlLoop == null && callback != null) {
callback.onError("controlLoop cannot be null");
}
- if (controlLoop!=null){
+ if (controlLoop != null) {
if ((controlLoop.getControlLoopName() == null || controlLoop.getControlLoopName().length() < 1)
&& callback != null) {
callback.onError("Missing controlLoopName");