From 2a98583ab8a211566ec8cfd7b70a014c682401c2 Mon Sep 17 00:00:00 2001 From: vempo Date: Thu, 4 Jan 2018 18:46:18 +0200 Subject: Remove enter/exit debug #6 Change-Id: Ic9d9ebfabc52c6d1bd785e6b0f9d1ecc177f996e Issue-ID: SDC-875 Signed-off-by: vempo --- .../org/openecomp/core/util/UniqueValueUtil.java | 33 ---------------------- 1 file changed, 33 deletions(-) (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api') diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java index 15e9ceeee7..4341899d8a 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-api/src/main/java/org/openecomp/core/util/UniqueValueUtil.java @@ -27,7 +27,6 @@ import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import java.util.Optional; @@ -37,8 +36,6 @@ public class UniqueValueUtil { private static final UniqueValueDao uniqueValueDao = UniqueValueDaoFactory.getInstance().createInterface(); - private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - /** * Create unique value. * @@ -46,16 +43,12 @@ public class UniqueValueUtil { * @param uniqueCombination the unique combination */ public static void createUniqueValue(String type, String... uniqueCombination) { - mdcDataDebugMessage.debugEntryMessage(null); - Optional value = formatValue(uniqueCombination); if (!value.isPresent()) { return; } validateUniqueValue(type, value.get(), uniqueCombination); uniqueValueDao.create(new UniqueValueEntity(type, value.get())); - - mdcDataDebugMessage.debugExitMessage(null); } /** @@ -65,17 +58,11 @@ public class UniqueValueUtil { * @param uniqueCombination the unique combination */ public static void deleteUniqueValue(String type, String... uniqueCombination) { - - - mdcDataDebugMessage.debugEntryMessage(null); - Optional value = formatValue(uniqueCombination); if (!value.isPresent()) { return; } uniqueValueDao.delete(new UniqueValueEntity(type, value.get())); - - mdcDataDebugMessage.debugExitMessage(null); } /** @@ -88,16 +75,10 @@ public class UniqueValueUtil { */ public static void updateUniqueValue(String type, String oldValue, String newValue, String... uniqueContext) { - - - mdcDataDebugMessage.debugEntryMessage(null); - if (newValue == null || oldValue == null || !newValue.equalsIgnoreCase(oldValue)) { createUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{newValue})); deleteUniqueValue(type, CommonMethods.concat(uniqueContext, new String[]{oldValue})); } - - mdcDataDebugMessage.debugExitMessage(null); } /** @@ -107,20 +88,14 @@ public class UniqueValueUtil { * @param uniqueCombination the unique combination */ public static void validateUniqueValue(String type, String... uniqueCombination) { - mdcDataDebugMessage.debugEntryMessage(null); - Optional value = formatValue(uniqueCombination); if (!value.isPresent()) { return; } validateUniqueValue(type, value.get(), uniqueCombination); - - mdcDataDebugMessage.debugExitMessage(null); } private static void validateUniqueValue(String type, String value, String... uniqueCombination) { - mdcDataDebugMessage.debugEntryMessage(null); - if (uniqueValueDao.get(new UniqueValueEntity(type, value)) != null) { throw new CoreException(new ErrorCode.ErrorCodeBuilder() .withCategory(ErrorCategory.APPLICATION) @@ -128,15 +103,9 @@ public class UniqueValueUtil { .withMessage(String.format(UNIQUE_VALUE_VIOLATION_MSG, type, uniqueCombination[uniqueCombination.length - 1])).build()); } - - mdcDataDebugMessage.debugExitMessage(null); } private static Optional formatValue(String[] uniqueCombination) { - - - mdcDataDebugMessage.debugEntryMessage(null); - if (uniqueCombination == null || uniqueCombination.length == 0 || uniqueCombination[uniqueCombination.length - 1] == null) { return Optional.empty(); @@ -144,8 +113,6 @@ public class UniqueValueUtil { uniqueCombination[uniqueCombination.length - 1] = uniqueCombination[uniqueCombination.length - 1].toLowerCase(); - - mdcDataDebugMessage.debugExitMessage(null); return Optional.of(CommonMethods.arrayToSeparatedString(uniqueCombination, '_')); } } -- cgit 1.2.3-korg