From ca297aeb432b3d718bf09f0bac7b9f051c26e66d Mon Sep 17 00:00:00 2001 From: vempo Date: Tue, 30 Jan 2018 21:35:14 +0200 Subject: Removed log constants Removed constants associated with audit/metrics logging. Deleted unused code. Some other safe cleanup and refactoring. Change-Id: Idfda72e1fb27ca695a74f2a09cb46381c9caed1a Issue-ID: SDC-772 Signed-off-by: vempo --- .../openecomp/sdc/versioning/VersioningUtil.java | 24 ++++++---------------- 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api') diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java index c4479d7105..7411edec08 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/VersioningUtil.java @@ -39,6 +39,10 @@ import java.util.stream.Collectors; */ public class VersioningUtil { + private VersioningUtil() { + // prevent instantiation + } + /** * Validate entity existence. * @@ -51,10 +55,6 @@ public class VersioningUtil { T inputEntity, String firstClassCitizenType) { if (retrievedEntity == null) { - //MdcDataErrorMessage.createErrorMessageAndUpdateMDC(LoggerServiceName - // .getServiceName(LoggerServiceName.Submit_Entity), - // LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.SUBMIT_ENTITY, - // ErrorLevel.ERROR.name(), null, LoggerErrorDescription.SUBMIT_ENTITY); throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( inputEntity.getEntityType(), inputEntity.getId(), @@ -88,11 +88,7 @@ public class VersioningUtil { } } - if (nonExistingIds.size() > 0) { - //MdcDataErrorMessage.createErrorMessageAndUpdateMDC - // (LoggerServiceName.getServiceName(LoggerServiceName.Submit_Entity), - // LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.SUBMIT_ENTITY, - // ErrorLevel.ERROR.name(), null, LoggerErrorDescription.SUBMIT_ENTITY); + if (!nonExistingIds.isEmpty()) { if (nonExistingIds.size() == 1) { throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( entity.getEntityType(), @@ -130,12 +126,8 @@ public class VersioningUtil { .filter(entityId -> !retrievedContainedEntityIds.contains(entityId)) .collect(Collectors.toList()); - if (nonExistingIds.size() > 0) { + if (!nonExistingIds.isEmpty()) { if (nonExistingIds.size() == 1) { - //MdcDataErrorMessage.createErrorMessageAndUpdateMDC(LoggerServiceName - // .getServiceName(LoggerServiceName.Submit_Entity), LoggerConstants.TARGET_ENTITY_DB, - // LoggerTragetServiceName.ENTIT, ErrorLevel.ERROR.name(), - // null, LoggerErrorDescription.SUBMIT_ENTITY); throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( containedEntityType, nonExistingIds.get(0), @@ -143,10 +135,6 @@ public class VersioningUtil { containingEntity.getId(), containingEntity.getVersion()).build()); } - //MdcDataErrorMessage.createErrorMessageAndUpdateMDC(LoggerServiceName - // .getServiceName(LoggerServiceName.Submit_Entity), - // LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.SUBMIT_ENTITY, - // ErrorLevel.ERROR.name(), null, LoggerErrorDescription.SUBMIT_ENTITY); throw new CoreException(new VersionableSubEntityNotFoundErrorBuilder( containedEntityType, nonExistingIds, -- cgit 1.2.3-korg