From efedea1c5d80532f5b1180d57c8dafce5dcb302a Mon Sep 17 00:00:00 2001 From: Ofir Sonsino Date: Tue, 20 Feb 2018 18:03:30 +0200 Subject: org.onap migration Change-Id: I5e2d01a6da21d4003c910b5fe0702b35c2089a77 Issue-ID: VID-86 Signed-off-by: Ofir Sonsino --- .../org/onap/vid/controller/ControllersUtils.java | 40 ---------------------- 1 file changed, 40 deletions(-) delete mode 100644 vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java (limited to 'vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java') diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java b/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java deleted file mode 100644 index 1df4f42b..00000000 --- a/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.onap.vid.controller; - -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.openecomp.portalsdk.core.domain.User; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.util.SystemProperties; -import org.onap.vid.model.ExceptionResponse; -import org.slf4j.MDC; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID; -import static org.onap.vid.utils.Logging.getMethodName; - -public class ControllersUtils { - - - public static String extractUserId(HttpServletRequest request) { - String userId = ""; - HttpSession session = request.getSession(); - if (session != null) { - User user = (User) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME)); - if (user != null) { - //userId = user.getHrid(); - userId = user.getLoginId(); - if (userId == null) - userId = user.getOrgUserId(); - } - } - return userId; - } - - public static ExceptionResponse handleException(Exception e, EELFLoggerDelegate logger) { - logger.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodName(), ExceptionUtils.getMessage(e), e); - - ExceptionResponse exceptionResponse = new ExceptionResponse(e); - return exceptionResponse; - } -} -- cgit 1.2.3-korg