summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
index 120bb3d6a0..8c31303b3b 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/EntitlementPoolsImpl.java
@@ -34,7 +34,6 @@ import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
import org.openecomp.sdcrests.wrappers.StringWrapperResponse;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
@@ -64,7 +63,7 @@ public class EntitlementPoolsImpl implements EntitlementPools {
MdcUtil.initMdc(LoggerServiceName.List_EP.toString());
Collection<EntitlementPoolEntity> entitlementPools =
- vendorLicenseManager.listEntitlementPools(vlmId, Version.valueOf(versionId), user);
+ vendorLicenseManager.listEntitlementPools(vlmId, new Version(versionId));
GenericCollectionWrapper<EntitlementPoolEntityDto> result = new GenericCollectionWrapper<>();
MapEntitlementPoolEntityToEntitlementPoolEntityDto outputMapper =
@@ -96,9 +95,10 @@ public class EntitlementPoolsImpl implements EntitlementPools {
new MapEntitlementPoolRequestDtoToEntitlementPoolEntity()
.applyMapping(request, EntitlementPoolEntity.class);
entitlementPoolEntity.setVendorLicenseModelId(vlmId);
+ entitlementPoolEntity.setVersion(new Version(versionId));
EntitlementPoolEntity createdEntitlementPool =
- vendorLicenseManager.createEntitlementPool(entitlementPoolEntity, user);
+ vendorLicenseManager.createEntitlementPool(entitlementPoolEntity);
StringWrapperResponse result =
createdEntitlementPool != null ? new StringWrapperResponse(createdEntitlementPool.getId())
: null;
@@ -127,9 +127,10 @@ public class EntitlementPoolsImpl implements EntitlementPools {
new MapEntitlementPoolRequestDtoToEntitlementPoolEntity()
.applyMapping(request, EntitlementPoolEntity.class);
entitlementPoolEntity.setVendorLicenseModelId(vlmId);
+ entitlementPoolEntity.setVersion(new Version(versionId));
entitlementPoolEntity.setId(entitlementPoolId);
- vendorLicenseManager.updateEntitlementPool(entitlementPoolEntity, user);
+ vendorLicenseManager.updateEntitlementPool(entitlementPoolEntity);
mdcDataDebugMessage.debugExitMessage("VLM id, EP id", vlmId, entitlementPoolId);
@@ -140,12 +141,12 @@ public class EntitlementPoolsImpl implements EntitlementPools {
* Gets entitlement pool.
*
* @param vlmId the vlm id
- * @param version the version
+ * @param versionId the version id
* @param entitlementPoolId the entitlement pool id
* @param user the user
* @return the entitlement pool
*/
- public Response getEntitlementPool(String vlmId, String version, String entitlementPoolId,
+ public Response getEntitlementPool(String vlmId, String versionId, String entitlementPoolId,
String user) {
mdcDataDebugMessage.debugEntryMessage("VLM id, EP id", vlmId, entitlementPoolId);
@@ -153,9 +154,9 @@ public class EntitlementPoolsImpl implements EntitlementPools {
MdcUtil.initMdc(LoggerServiceName.Get_EP.toString());
EntitlementPoolEntity epInput = new EntitlementPoolEntity();
epInput.setVendorLicenseModelId(vlmId);
- epInput.setVersion(Version.valueOf(version));
+ epInput.setVersion(new Version(versionId));
epInput.setId(entitlementPoolId);
- EntitlementPoolEntity entitlementPool = vendorLicenseManager.getEntitlementPool(epInput, user);
+ EntitlementPoolEntity entitlementPool = vendorLicenseManager.getEntitlementPool(epInput);
EntitlementPoolEntityDto entitlementPoolEntityDto = entitlementPool == null ? null :
new MapEntitlementPoolEntityToEntitlementPoolEntityDto()
@@ -183,7 +184,8 @@ public class EntitlementPoolsImpl implements EntitlementPools {
EntitlementPoolEntity epInput = new EntitlementPoolEntity();
epInput.setVendorLicenseModelId(vlmId);
epInput.setId(entitlementPoolId);
- vendorLicenseManager.deleteEntitlementPool(epInput, user);
+ epInput.setVersion(new Version(versionId));
+ vendorLicenseManager.deleteEntitlementPool(epInput);
mdcDataDebugMessage.debugExitMessage("VLM id, EP id", vlmId, entitlementPoolId);