From c3f68a3a585985d394116e8c8f141b77619793e1 Mon Sep 17 00:00:00 2001 From: vempo Date: Mon, 15 Jan 2018 18:56:23 +0200 Subject: Removed MDC from four modules Change-Id: I4cba1701cb52121709bbd98dbee4a0cb42f1e5f0 Issue-ID: SDC-772 Signed-off-by: vempo --- .../openecomp-zusammen-core/pom.xml | 1 + .../zusammen/db/impl/ZusammenConnectorImpl.java | 36 +++------------------- 2 files changed, 5 insertions(+), 32 deletions(-) (limited to 'openecomp-be/lib/openecomp-core-lib') diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/pom.xml index e6c72d1694..d90c9a39a0 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/pom.xml +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/pom.xml @@ -60,6 +60,7 @@ org.openecomp.sdc openecomp-sdc-logging-core ${project.version} + runtime org.openecomp.sdc diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java index e05d02d1e7..7525a6479a 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-core/src/main/java/org/openecomp/core/zusammen/db/impl/ZusammenConnectorImpl.java @@ -39,15 +39,9 @@ import com.amdocs.zusammen.datatypes.item.Resolution; import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions; import com.amdocs.zusammen.datatypes.itemversion.Tag; import com.amdocs.zusammen.datatypes.response.Response; -import com.amdocs.zusammen.datatypes.response.ReturnCode; import org.openecomp.core.zusammen.db.ZusammenConnector; import org.openecomp.core.zusammen.impl.CassandraConnectionInitializer; -import org.openecomp.core.zusammen.impl.ItemElementLoggerTargetServiceName; import org.openecomp.sdc.common.errors.SdcRuntimeException; -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 java.util.Collection; @@ -57,10 +51,10 @@ public class ZusammenConnectorImpl implements ZusammenConnector { "Failed to get element. Item Id: %s, version Id: %s, element Id: %s message: %s"; private static final String GET_ELEMENT_IN_REV_ERR_MSG = "Failed to get element. Item Id: %s, version Id: %s, revision Id: %s, element Id: %s message: %s"; - private ItemAdaptorFactory itemAdaptorFactory; - private ItemVersionAdaptorFactory versionAdaptorFactory; - private ElementAdaptorFactory elementAdaptorFactory; - private HealthAdaptorFactory healthAdaptorFactory; + private final ItemAdaptorFactory itemAdaptorFactory; + private final ItemVersionAdaptorFactory versionAdaptorFactory; + private final ElementAdaptorFactory elementAdaptorFactory; + private final HealthAdaptorFactory healthAdaptorFactory; public ZusammenConnectorImpl( ItemAdaptorFactory itemAdaptorFactory, @@ -130,8 +124,6 @@ public class ZusammenConnectorImpl implements ZusammenConnector { Response> versions = versionAdaptorFactory.createInterface(context).list(context, Space.PUBLIC, itemId); if (!versions.isSuccessful()) { - logErrorMessageToMdc(ItemElementLoggerTargetServiceName.ITEM_VERSION_RETRIEVAL, versions - .getReturnCode()); throw new SdcRuntimeException("failed to list public versions. message: " + versions.getReturnCode().toString()); } @@ -309,8 +301,6 @@ public class ZusammenConnectorImpl implements ZusammenConnector { if (response.isSuccessful()) { return response.getValue(); } else { - logErrorMessageToMdc(ItemElementLoggerTargetServiceName.ELEMENT_GET_BY_PROPERTY, - response.getReturnCode()); throw new SdcRuntimeException(response.getReturnCode().toString()); } } @@ -399,22 +389,4 @@ public class ZusammenConnectorImpl implements ZusammenConnector { elementContext.getRevisionId().getValue(), elementId.getValue(), zusammenErrorMessage)); } - - private void logErrorMessageToMdc(ItemElementLoggerTargetServiceName - itemElementLoggerTargetServiceName, - ReturnCode returnCode) { - logErrorMessageToMdc(itemElementLoggerTargetServiceName, returnCode.toString()); - } - - private void logErrorMessageToMdc(ItemElementLoggerTargetServiceName - itemElementLoggerTargetServiceName, - String message) { - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - itemElementLoggerTargetServiceName.getDescription(), - ErrorLevel.ERROR.name(), - LoggerErrorCode.BUSINESS_PROCESS_ERROR.getErrorCode(), - message); - } - - } -- cgit 1.2.3-korg