aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/clamp/policy/Policy.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/clamp/policy/Policy.java')
-rw-r--r--src/main/java/org/onap/clamp/policy/Policy.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/clamp/policy/Policy.java
index 13ba1a9f..c104b13e 100644
--- a/src/main/java/org/onap/clamp/policy/Policy.java
+++ b/src/main/java/org/onap/clamp/policy/Policy.java
@@ -21,7 +21,6 @@
*
*/
-
package org.onap.clamp.policy;
import com.google.gson.JsonObject;
@@ -32,4 +31,12 @@ public interface Policy {
JsonObject getJsonRepresentation();
+ static String generatePolicyName(String policyType, String serviceName, String serviceVersion, String resourceName,
+ String blueprintFilename) {
+ StringBuilder buffer = new StringBuilder(policyType).append("_").append(serviceName).append("_v")
+ .append(serviceVersion).append("_").append(resourceName).append("_")
+ .append(blueprintFilename.replaceAll(".yaml", ""));
+ return buffer.toString().replace('.', '_').replaceAll(" ", "");
+ }
+
}