import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.exception.CipherUtilException;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.util.SystemProperties;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
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);
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);
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));
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);
}
Map<String,String> 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,
- SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY));
} catch (CipherUtilException e) {
logger.error(EELFLoggerDelegate.errorLogger, "failed to decreptedexternalAppPwd when external app pwd is null", e);
}
encriptedPwdDB = decreptedexternalAppPwd;
}else{
- appUserName = app.username;
- encriptedPwdDB = app.appPassword;
+ appUserName = app.getAppBasicAuthUsername();
+ encriptedPwdDB = app.getAppBasicAuthPassword();
}
headersMap.put("username", appUserName);