diff options
author | sebdet <sebastien.determe@intl.att.com> | 2018-11-01 23:50:04 +0100 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2018-11-02 00:34:15 +0100 |
commit | 7253c2b707c1ac985fee1f6ed7ab45757a67b797 (patch) | |
tree | e1e54eaba59efdbfe05c47673b68f7b92059f60a /src/main/java/org | |
parent | eff88976a4a9cbe246744b36c44cf84e14204308 (diff) |
Fix Policy Yaml
Fix Policy Yaml generation, remove service and resource section + update
the actor/recipe
Issue-ID: CLAMP-243
Change-Id: Ia1adad6e653e7e85576858f2971f60f7903bfae2
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java b/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java index 1fc360820..b9ed0c095 100644 --- a/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java +++ b/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java @@ -57,6 +57,7 @@ public class OperationalPolicyYamlFormatter { protected OperationalPolicyYamlFormatter() { } + /** * Format Operational OpenLoop Policy yaml. * @@ -67,8 +68,8 @@ public class OperationalPolicyYamlFormatter { * @throws BuilderException * @throws UnsupportedEncodingException */ - public static String formatOpenLoopYaml(ModelProperties prop, String modelElementId, - PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException { + public static String formatOpenLoopYaml(ModelProperties prop, String modelElementId, PolicyChain policyChain) + throws BuilderException, UnsupportedEncodingException { // get property objects Global global = prop.getGlobal(); prop.setCurrentModelElementId(modelElementId); @@ -86,20 +87,15 @@ public class OperationalPolicyYamlFormatter { return URLEncoder.encode(results.getSpecification(), "UTF-8"); } - public static String formatYaml(ModelProperties prop, String modelElementId, - PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException { + public static String formatYaml(ModelProperties prop, String modelElementId, PolicyChain policyChain) + throws BuilderException, UnsupportedEncodingException { // get property objects - Global global = prop.getGlobal(); prop.setCurrentModelElementId(modelElementId); prop.setPolicyUniqueId(policyChain.getPolicyId()); - // convert values to SDC objects - Service service = new Service(global.getService()); - Resource[] vfResources = convertToResources(global.getResourceVf(), ResourceType.VF); - Resource[] vfcResources = convertToResources(global.getResourceVfc(), ResourceType.VFC); + // create builder ControlLoopPolicyBuilder builder = ControlLoopPolicyBuilder.Factory.buildControlLoop(prop.getControlName(), - policyChain.getTimeout(), service, vfResources); - builder.addResource(vfcResources); + policyChain.getTimeout()); // process each policy Map<String, Policy> policyObjMap = new HashMap<>(); List<PolicyItem> policyItemList = orderParentFirst(policyChain.getPolicyItems()); @@ -196,7 +192,6 @@ public class OperationalPolicyYamlFormatter { } } - protected static Resource[] convertToResources(List<String> stringList, ResourceType resourceType) { if (stringList == null || stringList.isEmpty()) { return new Resource[0]; |