X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fpolicy%2Fmicroservice%2FMicroServicePolicy.java;h=c2c60c9c0e62c5df3d7a036425f12b561a8be718;hb=a6d09fbe1046057b72247f97ac72a521949409ce;hp=3962a3d4ef643b6e5f93f5230e4dc8851867c3d9;hpb=c62d1b74275b8d5e9d4cef6c308ef16440cfa500;p=clamp.git diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java index 3962a3d4..c2c60c9c 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java +++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java @@ -59,6 +59,14 @@ public class MicroServicePolicy implements Serializable, Policy { @Column(nullable = false, name = "name", unique = true) private String name; + @Expose + @Column(nullable = false, name = "model_type") + private String modelType; + + @Expose + @Column(nullable = false, name = "blueprint_name") + private String blueprintName; + @Expose @Type(type = "json") @Column(columnDefinition = "json", name = "properties") @@ -86,34 +94,42 @@ public class MicroServicePolicy implements Serializable, Policy { /** * The constructor. * @param name The name of the MicroService + * @param type The model type of the MicroService + * @param blueprintName The name in the blueprint * @param policyTosca The policy Tosca of the MicroService * @param shared The flag indicate whether the MicroService is shared * @param usedByLoops The list of loops that uses this MicroService */ - public MicroServicePolicy(String name, String policyTosca, Boolean shared, Set usedByLoops) { + public MicroServicePolicy(String name, String modelType, String policyTosca, Boolean shared, Set usedByLoops, String blueprintName) { this.name = name; + this.modelType = modelType; this.policyTosca = policyTosca; this.shared = shared; this.jsonRepresentation = JsonUtils.GSON_JPA_MODEL .fromJson(new ToscaYamlToJsonConvertor(null).parseToscaYaml(policyTosca), JsonObject.class); this.usedByLoops = usedByLoops; + this.blueprintName = blueprintName; } /** * The constructor. * @param name The name of the MicroService + * @param type The model type of the MicroService + * @param blueprintName The name in the blueprint * @param policyTosca The policy Tosca of the MicroService * @param shared The flag indicate whether the MicroService is shared * @param jsonRepresentation The UI representation in json format * @param usedByLoops The list of loops that uses this MicroService */ - public MicroServicePolicy(String name, String policyTosca, Boolean shared, JsonObject jsonRepresentation, - Set usedByLoops) { + public MicroServicePolicy(String name, String modelType, String policyTosca, Boolean shared, JsonObject jsonRepresentation, + Set usedByLoops, String blueprintName) { this.name = name; + this.modelType = modelType; this.policyTosca = policyTosca; this.shared = shared; this.usedByLoops = usedByLoops; this.jsonRepresentation = jsonRepresentation; + this.blueprintName = blueprintName; } @Override @@ -121,6 +137,14 @@ public class MicroServicePolicy implements Serializable, Policy { return name; } + public String getModelType() { + return modelType; + } + + public String getBlueprintName() { + return blueprintName; + } + public JsonObject getProperties() { return properties; }