X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fpolicy%2FPolicy.java;h=3b220646111a41df0e207018573cc4293509e80c;hb=723de7f63f0951d0cfe7a23956cf9d00128809b1;hp=c9055bf9dc1301bb8d70caff5cbeb3abdc6ff52a;hpb=774b4ba65f0d23ae34d3bddb63058796121c1ae3;p=clamp.git diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/clamp/policy/Policy.java index c9055bf9..3b220646 100644 --- a/src/main/java/org/onap/clamp/policy/Policy.java +++ b/src/main/java/org/onap/clamp/policy/Policy.java @@ -30,7 +30,6 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; -import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.Map; import javax.persistence.Column; @@ -44,9 +43,6 @@ import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; import org.json.JSONObject; -import org.onap.clamp.clds.tosca.update.ToscaConverterManager; -import org.onap.clamp.clds.tosca.update.UnknownComponentException; -import org.onap.clamp.clds.util.ResourceFileUtil; import org.onap.clamp.dao.model.jsontype.StringJsonUserType; import org.onap.clamp.loop.common.AuditEntity; import org.onap.clamp.loop.template.LoopElementModel; @@ -286,23 +282,4 @@ public abstract class Policy extends AuditEntity { .append(blueprintFilename.replaceAll(".yaml", "")); return buffer.toString().replace('.', '_').replaceAll(" ", ""); } - - /** - * This method can be used to generate the json Schema used by the UI. - * - * @param policyToscaModel The tosca model as String that must be converted - * @param policyModelType The tosca model type (the policy_type entry in the tosca) that will used to create the - * json schema - * @return THe Json Schema as JsonObject - * @throws IOException In case of failure when opening the templates.json file - * @throws UnknownComponentException If the policyModelType is not found in the tosca model - */ - public static JsonObject generateJsonRepresentationFromToscaModel(String policyToscaModel, - String policyModelType) - throws IOException, UnknownComponentException { - return new ToscaConverterManager(policyToscaModel,ResourceFileUtil.getResourceAsString( - "clds/tosca_update/default-tosca-types.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")) - .startConversionToJson(policyModelType); - } }