diff options
Diffstat (limited to 'models-provider/src/main')
3 files changed, 45 insertions, 63 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 b186e2b36..a7d414533 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 @@ -278,11 +278,10 @@ public interface PolicyModelsProvider extends AutoCloseable { * Get PDP groups. * * @param name the name of the policy to get, null to get all PDP groups - * @param version the version of the policy to get, null to get all versions of a PDP group * @return the PDP groups found * @throws PfModelException on errors getting PDP groups */ - public List<PdpGroup> getPdpGroups(final String name, final String version) throws PfModelException; + public List<PdpGroup> getPdpGroups(final String name) throws PfModelException; /** * Get filtered PDP groups. @@ -315,56 +314,50 @@ public interface PolicyModelsProvider extends AutoCloseable { * Update a PDP subgroup. * * @param pdpGroupName the name of the PDP group of the PDP subgroup - * @param pdpGroupVersion the version of the PDP group of the PDP subgroup * @param pdpSubGroup the PDP subgroup to be updated * @throws PfModelException on errors updating PDP subgroups */ - public void updatePdpSubGroup(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion, - @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException; + public void updatePdpSubGroup(@NonNull final String pdpGroupName, @NonNull final PdpSubGroup pdpSubGroup) + throws PfModelException; /** * Update a PDP. * * @param pdpGroupName the name of the PDP group of the PDP subgroup - * @param pdpGroupVersion the version of the PDP group of the PDP subgroup * @param pdpSubGroup the PDP subgroup to be updated * @param pdp the PDP to be updated * @throws PfModelException on errors updating PDP subgroups */ - public void updatePdp(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion, - @NonNull final String pdpSubGroup, @NonNull final Pdp pdp) throws PfModelException; + public void updatePdp(@NonNull final String pdpGroupName, @NonNull final String pdpSubGroup, @NonNull final Pdp pdp) + throws PfModelException; /** * Delete a PDP group. * * @param name the name of the policy to get, null to get all PDP groups - * @param version the version of the policy to get, null to get all versions of a PDP group * @return the PDP group deleted * @throws PfModelException on errors deleting PDP groups */ - public PdpGroup deletePdpGroup(@NonNull final String name, @NonNull final String version) throws PfModelException; + public PdpGroup deletePdpGroup(@NonNull final String name) throws PfModelException; /** * Get PDP statistics. * * @param name the name of the PDP group to get statistics for, null to get all PDP groups - * @param version the version of the PDP group to get statistics for, null to get all versions of a PDP group * @return the statistics found * @throws PfModelException on errors getting statistics */ - public List<PdpStatistics> getPdpStatistics(final String name, final String version) throws PfModelException; + public List<PdpStatistics> getPdpStatistics(final String name) throws PfModelException; /** * Update PDP statistics for a PDP. * * @param pdpGroupName the name of the PDP group containing the PDP that the statistics are for - * @param pdpGroupVersion the version of the PDP group containing the PDP that the statistics are for * @param pdpType the PDP type of the subgroup containing the PDP that the statistics are for * @param pdpInstanceId the instance ID of the PDP to update statistics for * @param pdpStatistics the PDP statistics * @throws PfModelException on errors updating statistics */ - public void updatePdpStatistics(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion, - @NonNull final String pdpType, @NonNull final String pdpInstanceId, - @NonNull final PdpStatistics pdpStatistics) throws PfModelException; + public void updatePdpStatistics(@NonNull final String pdpGroupName, @NonNull final String pdpType, + @NonNull final String pdpInstanceId, @NonNull final PdpStatistics pdpStatistics) throws PfModelException; } 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 cd7b7f38e..a6e8f325b 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 @@ -284,9 +284,9 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider { } @Override - public List<PdpGroup> getPdpGroups(final String name, final String version) throws PfModelException { + public List<PdpGroup> getPdpGroups(final String name) throws PfModelException { assertInitilized(); - return new PdpProvider().getPdpGroups(pfDao, name, version); + return new PdpProvider().getPdpGroups(pfDao, name); } @Override @@ -308,36 +308,35 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider { } @Override - public void updatePdpSubGroup(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion, - @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException { + public void updatePdpSubGroup(@NonNull final String pdpGroupName, @NonNull final PdpSubGroup pdpSubGroup) + throws PfModelException { assertInitilized(); - new PdpProvider().updatePdpSubGroup(pfDao, pdpGroupName, pdpGroupVersion, pdpSubGroup); + new PdpProvider().updatePdpSubGroup(pfDao, pdpGroupName, pdpSubGroup); } @Override - public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpGroupVersion, @NonNull String pdpSubGroup, - @NonNull Pdp pdp) throws PfModelException { - new PdpProvider().updatePdp(pfDao, pdpGroupName, pdpGroupVersion, pdpSubGroup, pdp); + public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp) + throws PfModelException { + new PdpProvider().updatePdp(pfDao, pdpGroupName, pdpSubGroup, pdp); } @Override - public PdpGroup deletePdpGroup(@NonNull final String name, @NonNull final String version) throws PfModelException { + public PdpGroup deletePdpGroup(@NonNull final String name) throws PfModelException { assertInitilized(); - return new PdpProvider().deletePdpGroup(pfDao, name, version); + return new PdpProvider().deletePdpGroup(pfDao, name); } @Override - public List<PdpStatistics> getPdpStatistics(final String name, final String version) throws PfModelException { + public List<PdpStatistics> getPdpStatistics(final String name) throws PfModelException { assertInitilized(); - return new PdpProvider().getPdpStatistics(pfDao, name, version); + return new PdpProvider().getPdpStatistics(pfDao, name); } @Override - public void updatePdpStatistics(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion, - @NonNull final String pdpType, @NonNull final String pdpInstanceId, - @NonNull final PdpStatistics pdpStatistics) throws PfModelException { + public void updatePdpStatistics(@NonNull final String pdpGroupName, @NonNull final String pdpType, + @NonNull final String pdpInstanceId, @NonNull final PdpStatistics pdpStatistics) throws PfModelException { assertInitilized(); - new PdpProvider().updatePdpStatistics(pfDao, pdpGroupName, pdpGroupVersion, pdpType, pdpInstanceId, + new PdpProvider().updatePdpStatistics(pfDao, pdpGroupName, pdpType, pdpInstanceId, pdpStatistics); } 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 90545f389..9b1ca7669 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 @@ -93,20 +93,17 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider { } @Override - public ToscaServiceTemplate createPolicyTypes(final ToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate createPolicyTypes(final ToscaServiceTemplate serviceTemplate) throws PfModelException { return serviceTemplate; } @Override - public ToscaServiceTemplate updatePolicyTypes(final ToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate updatePolicyTypes(final ToscaServiceTemplate serviceTemplate) throws PfModelException { return serviceTemplate; } @Override - public ToscaServiceTemplate deletePolicyType(final String name, final String version) - throws PfModelException { + public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException { return getDummyResponse("dummyimpl/DummyToscaPolicyTypeDeleteResponse.json"); } @@ -131,20 +128,17 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider { } @Override - public ToscaServiceTemplate createPolicies(final ToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate createPolicies(final ToscaServiceTemplate serviceTemplate) throws PfModelException { return serviceTemplate; } @Override - public ToscaServiceTemplate updatePolicies(final ToscaServiceTemplate serviceTemplate) - throws PfModelException { + public ToscaServiceTemplate updatePolicies(final ToscaServiceTemplate serviceTemplate) throws PfModelException { return serviceTemplate; } @Override - public ToscaServiceTemplate deletePolicy(final String name, final String version) - throws PfModelException { + public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException { return getDummyResponse("dummyimpl/DummyToscaPolicyDeleteResponse.json"); } @@ -155,14 +149,14 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider { } @Override - public LegacyOperationalPolicy createOperationalPolicy( - final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException { + public LegacyOperationalPolicy createOperationalPolicy(final LegacyOperationalPolicy legacyOperationalPolicy) + throws PfModelException { return legacyOperationalPolicy; } @Override - public LegacyOperationalPolicy updateOperationalPolicy( - final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException { + public LegacyOperationalPolicy updateOperationalPolicy(final LegacyOperationalPolicy legacyOperationalPolicy) + throws PfModelException { return legacyOperationalPolicy; } @@ -177,25 +171,24 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider { } @Override - public Map<String, LegacyGuardPolicyOutput> createGuardPolicy( - final LegacyGuardPolicyInput legacyGuardPolicy) throws PfModelException { + public Map<String, LegacyGuardPolicyOutput> createGuardPolicy(final LegacyGuardPolicyInput legacyGuardPolicy) + throws PfModelException { return new HashMap<>(); } @Override - public Map<String, LegacyGuardPolicyOutput> updateGuardPolicy( - final LegacyGuardPolicyInput legacyGuardPolicy) throws PfModelException { + public Map<String, LegacyGuardPolicyOutput> updateGuardPolicy(final LegacyGuardPolicyInput legacyGuardPolicy) + throws PfModelException { return new HashMap<>(); } @Override - public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(final String policyId) - throws PfModelException { + public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(final String policyId) throws PfModelException { return new HashMap<>(); } @Override - public List<PdpGroup> getPdpGroups(final String name, final String version) throws PfModelException { + public List<PdpGroup> getPdpGroups(final String name) throws PfModelException { return new ArrayList<>(); } @@ -215,30 +208,27 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider { } @Override - public void updatePdpSubGroup(final String pdpGroupName, final String pdpGroupVersion, - final PdpSubGroup pdpSubGroup) throws PfModelException { + public void updatePdpSubGroup(final String pdpGroupName, final PdpSubGroup pdpSubGroup) throws PfModelException { // Not implemented } @Override - public void updatePdp(String pdpGroupName, String pdpGroupVersion, - String pdpSubGroup, Pdp pdp) throws PfModelException { + public void updatePdp(String pdpGroupName, String pdpSubGroup, Pdp pdp) throws PfModelException { // Not implemented } @Override - public PdpGroup deletePdpGroup(final String name, final String version) throws PfModelException { + public PdpGroup deletePdpGroup(final String name) throws PfModelException { return null; } @Override - public List<PdpStatistics> getPdpStatistics(final String name, final String version) throws PfModelException { + public List<PdpStatistics> getPdpStatistics(final String name) throws PfModelException { return new ArrayList<>(); } @Override - public void updatePdpStatistics(final String pdpGroupName, final String pdpGroupVersion, - final String pdpType, final String pdpInstanceId, + public void updatePdpStatistics(final String pdpGroupName, final String pdpType, final String pdpInstanceId, final PdpStatistics pdppStatistics) throws PfModelException { // Not implemented } |