Change getCanonicalName to getName in models
[policy/models.git] / models-provider / src / main / java / org / onap / policy / models / provider / impl / DatabasePolicyModelsProviderImpl.java
index a6e8f32..565eb9a 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019 AT&T Intellectual Property. 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.
@@ -94,7 +95,7 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
 
         // Parameters for the DAO
         final DaoParameters daoParameters = new DaoParameters();
-        daoParameters.setPluginClass(DefaultPfDao.class.getCanonicalName());
+        daoParameters.setPluginClass(DefaultPfDao.class.getName());
         daoParameters.setPersistenceUnit(parameters.getPersistenceUnit());
 
         // Decode the password using Base64
@@ -231,9 +232,10 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public LegacyOperationalPolicy getOperationalPolicy(@NonNull final String policyId) throws PfModelException {
+    public LegacyOperationalPolicy getOperationalPolicy(@NonNull final String policyId, final String policyVersion)
+            throws PfModelException {
         assertInitilized();
-        return new LegacyProvider().getOperationalPolicy(pfDao, policyId);
+        return new LegacyProvider().getOperationalPolicy(pfDao, policyId, policyVersion);
     }
 
     @Override
@@ -251,15 +253,17 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull final String policyId) throws PfModelException {
+    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull final String policyId,
+            @NonNull final String policyVersion) throws PfModelException {
         assertInitilized();
-        return new LegacyProvider().deleteOperationalPolicy(pfDao, policyId);
+        return new LegacyProvider().deleteOperationalPolicy(pfDao, policyId, policyVersion);
     }
 
     @Override
-    public Map<String, LegacyGuardPolicyOutput> getGuardPolicy(@NonNull final String policyId) throws PfModelException {
+    public Map<String, LegacyGuardPolicyOutput> getGuardPolicy(@NonNull final String policyId,
+            final String policyVersion) throws PfModelException {
         assertInitilized();
-        return new LegacyProvider().getGuardPolicy(pfDao, policyId);
+        return new LegacyProvider().getGuardPolicy(pfDao, policyId, policyVersion);
     }
 
     @Override
@@ -277,10 +281,10 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
     }
 
     @Override
-    public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(@NonNull final String policyId)
-            throws PfModelException {
+    public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(@NonNull final String policyId,
+            @NonNull final String policyVersion) throws PfModelException {
         assertInitilized();
-        return new LegacyProvider().deleteGuardPolicy(pfDao, policyId);
+        return new LegacyProvider().deleteGuardPolicy(pfDao, policyId, policyVersion);
     }
 
     @Override
@@ -336,8 +340,7 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
     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, pdpType, pdpInstanceId,
-                pdpStatistics);
+        new PdpProvider().updatePdpStatistics(pfDao, pdpGroupName, pdpType, pdpInstanceId, pdpStatistics);
     }
 
     /**