From 397259ecc15404b40e5589203db2637115426170 Mon Sep 17 00:00:00 2001 From: vempo Date: Tue, 16 Jan 2018 17:37:58 +0200 Subject: Removed MDC from two modules Change-Id: Ib1d4df731fa6b6626d49042df9a7bf902940be27 Issue-ID: SDC-772 Signed-off-by: vempo --- .../facade/impl/VendorLicenseFacadeImpl.java | 26 ---------------------- .../healing/impl/SimpleHealingServiceImpl.java | 23 +++++-------------- 2 files changed, 5 insertions(+), 44 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java index 33e3b4c545..b02f6a527e 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java @@ -25,12 +25,6 @@ import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory; @@ -207,9 +201,6 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { VendorLicenseModelEntity vendorLicenseModel = vendorLicenseModelDao.get(new VendorLicenseModelEntity(vlmId, version)); if (vendorLicenseModel == null) { - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.GET_VLM, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.ENTITY_NOT_FOUND); throw new CoreException(new VendorLicenseModelNotFoundErrorBuilder(vlmId).build()); } return vendorLicenseModel; @@ -217,7 +208,6 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { @Override public LicenseAgreementEntity createLicenseAgreement(LicenseAgreementEntity licenseAgreement) { - //licenseAgreement.setId(CommonMethods.nextUuId()); VersioningUtil.validateEntitiesExistence(licenseAgreement.getFeatureGroupIds(), new FeatureGroupEntity(licenseAgreement.getVendorLicenseModelId(), licenseAgreement.getVersion(), @@ -296,16 +286,6 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { public Collection validateLicensingData(String vlmId, Version version, String licenseAgreementId, Collection featureGroupIds) { - // TODO: 5/21/2017 validate version exists and final -/* try { - VersionInfo versionInfo = getVersionInfo(vlmId, VersionableEntityAction.Read, ""); - if (version == null || !version.isFinal() - || !versionInfo.getViewableVersions().contains(version)) { - return Collections.singletonList(new RequestedVersionInvalidErrorBuilder().build()); - } - } catch (CoreException exception) { - return Collections.singletonList(exception.code()); - }*/ List errorMessages = new ArrayList<>(); @@ -385,9 +365,6 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { if (CollectionUtils.isNotEmpty(licenseAgreements)) { licenseAgreements.forEach(licenseAgreement -> { if (CollectionUtils.isEmpty(licenseAgreement.getFeatureGroupIds())) { - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY); throw new CoreException( new SubmitUncompletedLicenseModelErrorBuilder( SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG).build()); @@ -399,9 +376,6 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { FeatureGroupEntity featureGroupEntity = featureGroupDao.get(new FeatureGroupEntity(vendorLicenseModelId, version, fg)); if (CollectionUtils.isEmpty(featureGroupEntity.getEntitlementPoolIds())) { - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.SUBMIT_ENTITY, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.SUBMIT_ENTITY); throw new CoreException( new SubmitUncompletedLicenseModelErrorBuilder( SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP).build()); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java index 456348688e..76635b3132 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java @@ -1,31 +1,21 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * Copyright © 2016-2017 European Support Limited + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END========================================================= */ package org.openecomp.sdc.vendorlicense.healing.impl; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDaoFactory; import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; @@ -68,9 +58,6 @@ public class SimpleHealingServiceImpl implements HealingService { toHeal.setVersionUuId(UUID.randomUUID().toString()); licenseKeyGroupDao.update((LicenseKeyGroupEntity) toHeal); } else { - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION); throw new UnsupportedOperationException( "Unsupported operation for 1610 release/1607->1610 migration."); } -- cgit 1.2.3-korg