From 001fe2af138c08755f68025eeffd8c7a25cc8e5c Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Fri, 14 Aug 2020 11:11:36 -0400 Subject: Remove legacy operational policy from models Removing all the legacy operational policy related concepts, providers, examples etc from models repo. Issue-ID: POLICY-2764 Change-Id: Ie820271381674ccc4eaef0bd6379f673f67701e7 Signed-off-by: Ram Krishna Verma --- .../models/provider/PolicyModelsProvider.java | 44 +--------------------- .../impl/DatabasePolicyModelsProviderImpl.java | 35 +---------------- .../impl/DummyPolicyModelsProviderImpl.java | 27 +------------ 3 files changed, 3 insertions(+), 103 deletions(-) (limited to 'models-provider/src/main/java') diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java index a8fc4ed73..f2f7318e8 100644 --- a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java +++ b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +35,6 @@ 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.legacy.concepts.LegacyOperationalPolicy; /** * This interface describes the operations that are provided to users and components for reading objects from and @@ -193,48 +193,6 @@ public interface PolicyModelsProvider extends AutoCloseable { public ToscaServiceTemplate deletePolicy(@NonNull final String name, @NonNull final String version) throws PfModelException; - /** - * Get legacy operational policy. - * - * @param policyId ID of the policy - * @param policyVersion version of the policy, set to null to get the latest policy - * @return the policies found - * @throws PfModelException on errors getting policies - */ - public LegacyOperationalPolicy getOperationalPolicy(@NonNull final String policyId, final String policyVersion) - throws PfModelException; - - /** - * Create legacy operational policy. - * - * @param legacyOperationalPolicy the definition of the policy to be created. - * @return the created policy - * @throws PfModelException on errors creating policies - */ - public LegacyOperationalPolicy createOperationalPolicy( - @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException; - - /** - * Update legacy operational policy. - * - * @param legacyOperationalPolicy the definition of the policy to be updated - * @return the updated policy - * @throws PfModelException on errors updating policies - */ - public LegacyOperationalPolicy updateOperationalPolicy( - @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException; - - /** - * Delete legacy operational policy. - * - * @param policyId ID of the policy. - * @param policyVersion version of the policy - * @return the deleted policy - * @throws PfModelException on errors deleting policies - */ - public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull final String policyId, - @NonNull final String policyVersion) throws PfModelException; - /** * Get PDP groups. * diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java index 7d28b61c3..77a72adb0 100644 --- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java +++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,8 +52,6 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeFilter; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; import org.onap.policy.models.tosca.authorative.provider.AuthorativeToscaProvider; -import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy; -import org.onap.policy.models.tosca.legacy.provider.LegacyProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -241,38 +240,6 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider { return new AuthorativeToscaProvider().deletePolicy(pfDao, name, version); } - @Override - public LegacyOperationalPolicy getOperationalPolicy(@NonNull final String policyId, final String policyVersion) - throws PfModelException { - assertInitialized(); - return new LegacyProvider().getOperationalPolicy(pfDao, policyId, policyVersion); - } - - @Override - public LegacyOperationalPolicy createOperationalPolicy( - @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException { - assertInitialized(); - return new LegacyProvider().createOperationalPolicy(pfDao, legacyOperationalPolicy); - } - - @Override - public LegacyOperationalPolicy updateOperationalPolicy( - @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException { - assertInitialized(); - return new LegacyProvider().updateOperationalPolicy(pfDao, legacyOperationalPolicy); - } - - @Override - public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull final String policyId, - @NonNull final String policyVersion) throws PfModelException { - assertInitialized(); - - assertPolicyNotDeployedInPdpGroup( - new ToscaPolicyIdentifier(policyId, policyVersion + LegacyProvider.LEGACY_MINOR_PATCH_SUFFIX)); - - return new LegacyProvider().deleteOperationalPolicy(pfDao, policyId, policyVersion); - } - @Override public List getPdpGroups(final String name) throws PfModelException { assertInitialized(); diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java index 465685c3e..16f5a2b74 100644 --- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java +++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2019-2020 Nordix Foundation. * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +42,6 @@ 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.legacy.concepts.LegacyOperationalPolicy; /** * This class provides a dummy implementation of the Policy Models Provider for the ONAP Policy Framework. @@ -139,31 +139,6 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider { return getDummyResponse("dummyimpl/DummyToscaPolicyDeleteResponse.json"); } - @Override - - public LegacyOperationalPolicy getOperationalPolicy(final String policyId, final String policyVersion) - throws PfModelException { - return new LegacyOperationalPolicy(); - } - - @Override - public LegacyOperationalPolicy createOperationalPolicy(final LegacyOperationalPolicy legacyOperationalPolicy) - throws PfModelException { - return legacyOperationalPolicy; - } - - @Override - public LegacyOperationalPolicy updateOperationalPolicy(final LegacyOperationalPolicy legacyOperationalPolicy) - throws PfModelException { - return legacyOperationalPolicy; - } - - @Override - public LegacyOperationalPolicy deleteOperationalPolicy(final String policyId, final String policyVersion) - throws PfModelException { - return new LegacyOperationalPolicy(); - } - @Override public List getPdpGroups(final String name) throws PfModelException { return new ArrayList<>(); -- cgit 1.2.3-korg