X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fservice%2Fsessionmgt%2FSessionCommunication.java;h=441e99a71f083e942c8cd1a609d3ff5c28a0af34;hb=230c71614b1d2fb71a8fb482c749ff5a6dad65d8;hp=14616b31e8d09888bd4e6f9a96f0f2aae9ac11da;hpb=e276ad30dc38f55e06877df8fd0d3372534c8f47;p=portal.git diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java index 14616b31..441e99a7 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java @@ -85,12 +85,12 @@ public class SessionCommunication { String appResponse = ""; String appName = ""; int responseCode = 0; - if (app != null && app.name != null && app.name != "") { + if (app != null && app.getAppName() != null && app.getAppName() != "") { try { - appName = app.name; - String url = app.restUrl + "/sessionTimeOuts"; - String encriptedPwdDB = app.appPassword; - String appUserName = app.username; + appName = app.getAppName(); + String url = app.getRestUrl() + "/sessionTimeOuts"; + String encriptedPwdDB = app.getAppBasicAuthPassword(); + String appUserName = app.getAppBasicAuthUsername(); setLocalMDCContext(app, "/sessionTimeOuts", url); @@ -157,12 +157,12 @@ public class SessionCommunication { try { if (app == null) throw new Exception("SessionCommunication.pingSession: app is null"); - if (app != null && app.name != null && app.name != "") { - appName = app.name; + if (app != null && app.getAppName() != null && app.getAppName() != "") { + appName = app.getAppName(); } - String url = app.restUrl + "/updateSessionTimeOuts"; - String encriptedPwdDB = app.appPassword; - String appUserName = app.username; + String url = app.getRestUrl() + "/updateSessionTimeOuts"; + String encriptedPwdDB = app.getAppBasicAuthPassword(); + String appUserName = app.getAppBasicAuthUsername(); setLocalMDCContext(app, "/updateSessionTimeOuts", url); @@ -218,13 +218,13 @@ public class SessionCommunication { public Boolean timeoutSession(OnboardingApp app, String portalJSessionId) throws Exception { String appName = "Unknwon"; int responseCode = 0; - if (app != null && app.name != null && app.name != "") { + if (app != null && app.getAppName() != null && app.getAppName() != "") { try { - appName = app.name; - String url = app.restUrl + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId; + appName = app.getAppName(); + String url = app.getRestUrl() + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId; - String encriptedPwdDB = app.appPassword; - String appUserName = app.username; + String encriptedPwdDB = app.getAppBasicAuthPassword(); + String appUserName = app.getAppBasicAuthUsername(); // String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB, // SystemProperties.getProperty(SystemProperties.Decryption_Key)); @@ -287,7 +287,7 @@ public class SessionCommunication { MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS); } MDC.put(EPCommonSystemProperties.FULL_URL, url); - MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.myLoginsAppName); + MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.getMyLoginsAppName()); MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath); } @@ -332,15 +332,15 @@ public class SessionCommunication { Map headersMap = new HashMap<>(); EPApp externalApp = null; - if(app.appPassword.isEmpty() || app.appPassword==null){ + if(app.getAppBasicAuthPassword().isEmpty() || app.getAppBasicAuthPassword()==null){ logger.debug(EELFLoggerDelegate.debugLogger, "Entering in the externalApp get app password contains null : {}"); externalApp = appsCacheService.getApp(1L); logger.debug(EELFLoggerDelegate.debugLogger, "external App Information : {}",externalApp); - String mechidUsername=externalApp.getUsername(); + String mechidUsername=externalApp.getAppBasicAuthUsername(); logger.debug(EELFLoggerDelegate.debugLogger, "external App mechidUsername Information : {}",mechidUsername); - String password=externalApp.getAppPassword(); + String password=externalApp.getAppBasicAuthPassword(); String decreptedexternalAppPwd = StringUtils.EMPTY; try { decreptedexternalAppPwd = CipherUtil.decryptPKC(password, @@ -353,8 +353,8 @@ public class SessionCommunication { encriptedPwdDB = decreptedexternalAppPwd; }else{ - appUserName = app.username; - encriptedPwdDB = app.appPassword; + appUserName = app.getAppBasicAuthUsername(); + encriptedPwdDB = app.getAppBasicAuthPassword(); } headersMap.put("username", appUserName);