summaryrefslogtreecommitdiffstats
path: root/models-provider/src/main/java
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-08-14 11:11:36 -0400
committerRam Krishna Verma <ram_krishna.verma@bell.ca>2020-08-14 21:22:06 +0000
commit001fe2af138c08755f68025eeffd8c7a25cc8e5c (patch)
treefc167cf2e304ce222051ef8abed403156319f4a4 /models-provider/src/main/java
parentf5eeaaeaeadf04571d8881f497c770ee1bbbdde5 (diff)
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 <ram_krishna.verma@bell.ca>
Diffstat (limited to 'models-provider/src/main/java')
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java44
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java35
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java27
3 files changed, 3 insertions, 103 deletions
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
@@ -194,48 +194,6 @@ public interface PolicyModelsProvider extends AutoCloseable {
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.
*
* @param name the name of the policy to get, null to get all 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;
@@ -242,38 +241,6 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
}
@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<PdpGroup> getPdpGroups(final String name) throws PfModelException {
assertInitialized();
return new PdpProvider().getPdpGroups(pfDao, name);
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.
@@ -140,31 +140,6 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
}
@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<PdpGroup> getPdpGroups(final String name) throws PfModelException {
return new ArrayList<>();
}