From b87e0242ce1a957740ee988bec3b82e3628adbed Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 17 Dec 2020 12:10:21 +0000 Subject: Add Service Template TOSCA handling Today we can only handle a single service template in the database. We should be able to handle multiple service templates and assign arbitrary policy types and policies to maned and versioned service templates. This review brings in the Java API in models provider for handling service templates in this way and uses a simplistic single-teplate implementation in models-tosca, that will work but still only handles a single service template under the hood. Issue-ID: POLICY-2900 Change-Id: Ia02dea8abe44b7f407e685090a4b8e0360889653 Signed-off-by: liamfallon --- .../models/provider/impl/DummyBadProviderImpl.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'models-provider/src/test') diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java index 453f86633..1158307b4 100644 --- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java +++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java @@ -41,6 +41,7 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyFilter; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeFilter; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; +import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplateFilter; /** * Dummy implementation of {@link PolicyModelsProvider} with bad constructor. @@ -62,6 +63,30 @@ public class DummyBadProviderImpl implements PolicyModelsProvider { // do nothing } + @Override + public List getFilteredServiceTemplateList(@NonNull ToscaServiceTemplateFilter filter) + throws PfModelException { + return null; + } + + @Override + public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) + throws PfModelException { + return null; + } + + @Override + public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate) + throws PfModelException { + return null; + } + + @Override + public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version) + throws PfModelException { + return null; + } + @Override public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException { return null; @@ -203,4 +228,10 @@ public class DummyBadProviderImpl implements PolicyModelsProvider { // Not implemented return null; } + + @Override + public List getServiceTemplateList(String name, String version) throws PfModelException { + // TODO Auto-generated method stub + return null; + } } -- cgit 1.2.3-korg