X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fmodel%2Fproperties%2FModelProperties.java;h=d5f3ae2283dbbfcca137a2e8a0ac417e10c0c73e;hb=269d207cee2ec47b2ecf1830e46ac45b7cea38f2;hp=5b002e716aee87fdbacd1ab4dd2f14df7cf2f5d4;hpb=880a4ae41cfb06d43fa0a0d0b86f358c965534b7;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java b/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java index 5b002e71..d5f3ae22 100644 --- a/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java +++ b/src/main/java/org/onap/clamp/clds/model/properties/ModelProperties.java @@ -217,11 +217,15 @@ public class ModelProperties { return normalizePolicyScopeName(controlName + "_" + currentModelElementId); } + private String createScopeSeparator(String policyScope) { + return policyScope.contains(".") ? "" : "."; + } + /** * @return the currentPolicyScopeAndPolicyName */ public String getCurrentPolicyScopeAndPolicyName() { - return normalizePolicyScopeName(modelName + "." + getCurrentPolicyName()); + return normalizePolicyScopeName(modelName + createScopeSeparator(modelName) + getCurrentPolicyName()); } /** @@ -229,7 +233,7 @@ public class ModelProperties { * deploy */ public String getPolicyNameForDcaeDeploy(ClampProperties refProp) { - return normalizePolicyScopeName(modelName + "." + return normalizePolicyScopeName(modelName + createScopeSeparator(modelName) + refProp.getStringValue(PolicyClient.POLICY_MS_NAME_PREFIX_PROPERTY_NAME) + getCurrentPolicyName()); } @@ -237,22 +241,16 @@ public class ModelProperties { * @return the policyScopeAndNameWithUniqueId */ public String getPolicyScopeAndNameWithUniqueId() { - return normalizePolicyScopeName(modelName + "." + getCurrentPolicyName() + "_" + policyUniqueId); + return normalizePolicyScopeName( + modelName + createScopeSeparator(modelName) + getCurrentPolicyName() + "_" + policyUniqueId); } /** * @return the currentPolicyScopeAndFullPolicyName */ public String getCurrentPolicyScopeAndFullPolicyName(String policyNamePrefix) { - return normalizePolicyScopeName(modelName + "." + policyNamePrefix + getCurrentPolicyName()); - } - - /** - * @return the currentPolicyScopeAndFullPolicyNameWithVersion - */ - public String getCurrentPolicyScopeAndFullPolicyNameWithVersion(String policyNamePrefix, int version) { return normalizePolicyScopeName( - modelName + "." + policyNamePrefix + getCurrentPolicyName() + "." + version + ".xml"); + modelName + createScopeSeparator(modelName) + policyNamePrefix + getCurrentPolicyName()); } /**