summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/api')
-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(),