aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2018-05-01 10:10:09 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-05-01 07:50:22 +0000
commit53d5049c1b4acab91c90e491abdee7cc0b1c0cc5 (patch)
tree67985ea3cfe8d860aa12ded33beb84fe5ec04cf1 /openecomp-be/api/openecomp-sdc-rest-webapp
parent0258442c39183fdd7e4812054d095cafdcab420d (diff)
Remove vsp and vlm redundant properties
Change-Id: I1faf9af304c7c97303e98744b036f9b1c0db8f0c Issue-ID: SDC-343 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp')
-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/VendorLicenseModelsImpl.java20
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java12
2 files changed, 12 insertions, 20 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/VendorLicenseModelsImpl.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/VendorLicenseModelsImpl.java
index 0e645dd4e9..f596a8dd1b 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/VendorLicenseModelsImpl.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/VendorLicenseModelsImpl.java
@@ -28,7 +28,6 @@ import static org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelActio
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
-import java.util.Optional;
import java.util.function.Predicate;
import javax.inject.Named;
import javax.ws.rs.core.Response;
@@ -163,19 +162,16 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels {
public Response getLicenseModel(String vlmId, String versionId, String user) {
Version version = versioningManager.get(vlmId, new Version(versionId));
VendorLicenseModelEntity vlm = vendorLicenseManager.getVendorLicenseModel(vlmId, version);
- vlm.setWritetimeMicroSeconds(version.getModificationTime().getTime());
try {
- Optional<Version> healedVersion = HealingManagerFactory.getInstance().createInterface()
- .healItemVersion(vlmId, version, ItemType.vlm,
- false);
-
- if (healedVersion.isPresent()) {
- vlm.setVersion(healedVersion.get());
- if (version.getStatus() == VersionStatus.Certified) {
- submitHealedVersion(vlmId, healedVersion.get(), versionId, user);
- }
- }
+ HealingManagerFactory.getInstance().createInterface()
+ .healItemVersion(vlmId, version, ItemType.vlm, false)
+ .ifPresent(healedVersion -> {
+ vlm.setVersion(healedVersion);
+ if (version.getStatus() == VersionStatus.Certified) {
+ submitHealedVersion(vlmId, healedVersion, versionId, user);
+ }
+ });
} catch (Exception e) {
LOGGER.error(String.format("Error while auto healing VLM with Id %s and version %s", vlmId, versionId), e);
}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
index 16ef8c5761..9610da8553 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/VendorSoftwareProductsImpl.java
@@ -224,7 +224,6 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
public Response getVsp(String vspId, String versionId, String user) {
Version version = versioningManager.get(vspId, new Version(versionId));
VspDetails vspDetails = vendorSoftwareProductManager.getVsp(vspId, version);
- vspDetails.setWritetimeMicroSeconds(version.getModificationTime().getTime());
try {
HealingManagerFactory.getInstance().createInterface()
@@ -252,13 +251,10 @@ public class VendorSoftwareProductsImpl implements VendorSoftwareProducts {
versioningManager.get(vspDetails.getVendorId(), vspDetails.getVlmVersion());
}
- Optional<ValidationResponse> validationResponse =
- submit(vspDetails.getId(), vspDetails.getVersion(), "Submit healed Vsp", user);
- // TODO: 8/9/2017 before collaboration checkout was done at this scenario (equivalent
- // to new version in collaboration). need to decide what should be done now.
- validationResponse.ifPresent(validationResponse1 -> {
- throw new IllegalStateException("Certified vsp after healing failed on validation");
- });
+ submit(vspDetails.getId(), vspDetails.getVersion(), "Submit healed Vsp", user)
+ .ifPresent(validationResponse -> {
+ throw new IllegalStateException("Certified vsp after healing failed on validation");
+ });
vendorSoftwareProductManager.createPackage(vspDetails.getId(), vspDetails.getVersion());
} catch (Exception ex) {
LOGGER.error(String.format(SUBMIT_HEALED_VERSION_ERROR, vspDetails.getId(), vspDetails.getVersion().getId(),