Use a logger to log this exception
Make sure creating this cookie without the "secure" flag is safe here
Either re-interrupt this method or rethrow the "InterruptedException"
Issue-ID: PORTAL-562
Change-Id: I91d6adce835d9adec4328642e8445f074f7d2d57
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Thread.sleep(10);
} catch (InterruptedException e) {
logger.error(EELFLoggerDelegate.errorLogger, "runHandler interrupted", e);
Thread.sleep(10);
} catch (InterruptedException e) {
logger.error(EELFLoggerDelegate.errorLogger, "runHandler interrupted", e);
+ Thread.currentThread().interrupt();
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "runHandler failed", e);
}
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "runHandler failed", e);
}
HttpServletResponse response) {
String jSessionId = getJessionId(request);
Cookie cookie1 = new Cookie(EP_SERVICE, jSessionId);
HttpServletResponse response) {
String jSessionId = getJessionId(request);
Cookie cookie1 = new Cookie(EP_SERVICE, jSessionId);
+ cookie1.setSecure(true);
cookie1.setMaxAge(cookieMaxAge);
cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
cookie1.setPath("/");
cookie1.setMaxAge(cookieMaxAge);
cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
cookie1.setPath("/");
userId = CipherUtil.encrypt(userId,
SystemProperties.getProperty(SystemProperties.Decryption_Key));
Cookie cookie1 = new Cookie(USER_ID, userId);
userId = CipherUtil.encrypt(userId,
SystemProperties.getProperty(SystemProperties.Decryption_Key));
Cookie cookie1 = new Cookie(USER_ID, userId);
+ cookie1.setSecure(true);
cookie1.setMaxAge(cookieMaxAge);
cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
cookie1.setPath("/");
cookie1.setMaxAge(cookieMaxAge);
cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
cookie1.setPath("/");
widgetCatalog = widgetCatalogService.getWidgetCatalog();
logger.debug("WidgetsCatalogController.getWidgetCatalog: getting widget list {}", widgetCatalog);
} catch (Exception e) {
widgetCatalog = widgetCatalogService.getWidgetCatalog();
logger.debug("WidgetsCatalogController.getWidgetCatalog: getting widget list {}", widgetCatalog);
} catch (Exception e) {
- logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetCatalog in widget microservices. Details:" + e.getMessage());
+ logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetCatalog in widget microservices. Details:", e);
}
return widgetCatalog;
}
}
return widgetCatalog;
}
widgetCatalog = widgetCatalogService.getUserWidgetCatalog(loginName);
logger.debug("WidgetsCatalogController.getUserWidgetCatalog: getting widget list {}", widgetCatalog);
} catch (Exception e) {
widgetCatalog = widgetCatalogService.getUserWidgetCatalog(loginName);
logger.debug("WidgetsCatalogController.getUserWidgetCatalog: getting widget list {}", widgetCatalog);
} catch (Exception e) {
- logger.error("Exception occurred while performing WidgetsCatalogController.getUserWidgetCatalog in widget microservices. Details:" + e.getMessage());
+ logger.error("Exception occurred while performing WidgetsCatalogController.getUserWidgetCatalog in widget microservices. Details:", e);
}
return widgetCatalog;
}
}
return widgetCatalog;
}
widgetCatalogService.updateWidgetCatalog(widgetId, newWidgetCatalog);
logger.debug("WidgetsCatalogController.updateWidgetCatalog: updating widget {}", newWidgetCatalog);
} catch (Exception e) {
widgetCatalogService.updateWidgetCatalog(widgetId, newWidgetCatalog);
logger.debug("WidgetsCatalogController.updateWidgetCatalog: updating widget {}", newWidgetCatalog);
} catch (Exception e) {
- logger.error("Exception occurred while performing WidgetsCatalogController.updateWidgetCatalog in widget microservices. Details:" + e.getMessage());
- e.printStackTrace();
+ logger.error("Exception occurred while performing WidgetsCatalogController.updateWidgetCatalog in widget microservices. Details:", e);
@RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST, produces = "application/json")
public ValidationRespond updateWidgetCatalogwithFiles(HttpServletRequest request, HttpServletResponse response, @RequestHeader(value="Authorization") String auth,
@RequestParam("file") MultipartFile file, @RequestParam("widget") String widget, @PathVariable("widgetId") long widgetId) throws IOException {
@RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST, produces = "application/json")
public ValidationRespond updateWidgetCatalogwithFiles(HttpServletRequest request, HttpServletResponse response, @RequestHeader(value="Authorization") String auth,
@RequestParam("file") MultipartFile file, @RequestParam("widget") String widget, @PathVariable("widgetId") long widgetId) throws IOException {
- System.out.println("microserivces updating with files" + widgetId);
+ logger.debug("microserivces updating with files {}", widgetId);
ValidationRespond respond = null;
if(!util.authorization(auth, security_user, security_pass)){
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
ValidationRespond respond = null;
if(!util.authorization(auth, security_user, security_pass)){
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
storageService.update(file, newWidget, widgetId);
}
} catch (Exception e) {
storageService.update(file, newWidget, widgetId);
}
} catch (Exception e) {
- logger.error("Exception occurred while performing WidgetsCatalogController.saveWidgetCatalog in widget microservices. Details:" + e.getMessage());
- e.printStackTrace();
+ logger.error("Exception occurred while performing WidgetsCatalogController.saveWidgetCatalog in widget microservices. Details:", e);
widgetCatalogService.deleteWidgetCatalog(widgetId);
storageService.deleteWidgetFile(widgetId);
} catch (Exception e) {
widgetCatalogService.deleteWidgetCatalog(widgetId);
storageService.deleteWidgetFile(widgetId);
} catch (Exception e) {
- logger.error("Exception occurred while performing WidgetsCatalogController.deleteOnboardingWidget in widget microservices. Details:" + e.getMessage());
+ logger.error("Exception occurred while performing WidgetsCatalogController.deleteOnboardingWidget in widget microservices. Details:", e);
logger.debug("WidgetsCatalogController.getServiceIdByWidget: getting service Id for widget {}", widgetId);
serviceId = widgetCatalogService.getServiceIdByWidget(widgetId);
}catch(Exception e){
logger.debug("WidgetsCatalogController.getServiceIdByWidget: getting service Id for widget {}", widgetId);
serviceId = widgetCatalogService.getServiceIdByWidget(widgetId);
}catch(Exception e){
- logger.error("Exception occurred while performing WidgetsCatalogController.getServiceIdByWidget in widget microservices. Details:" + e.getMessage());
+ logger.error("Exception occurred while performing WidgetsCatalogController.getServiceIdByWidget in widget microservices. Details:", e);
@RequestMapping(value = { "/microservices/widgetCatalog/service/{serviceId}" }, method = RequestMethod.GET, produces = "application/json")
public List<WidgetCatalog> getWidgetByServiceId(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") Long serviceId, @RequestHeader(value="Authorization") String auth) throws IOException {
@RequestMapping(value = { "/microservices/widgetCatalog/service/{serviceId}" }, method = RequestMethod.GET, produces = "application/json")
public List<WidgetCatalog> getWidgetByServiceId(HttpServletRequest request, HttpServletResponse response,
@PathVariable("serviceId") Long serviceId, @RequestHeader(value="Authorization") String auth) throws IOException {
- List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
+ List<WidgetCatalog> list = new ArrayList<>();
if(!util.authorization(auth, security_user, security_pass)){
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetByServiceId in widget microserivce. Please check your username and password.");
if(!util.authorization(auth, security_user, security_pass)){
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetByServiceId in widget microserivce. Please check your username and password.");
logger.debug("WidgetsCatalogController.getWidgetByServiceId: getting service Id for widget {}", serviceId);
list = widgetCatalogService.getWidgetsByServiceId(serviceId);
}catch(Exception e){
logger.debug("WidgetsCatalogController.getWidgetByServiceId: getting service Id for widget {}", serviceId);
list = widgetCatalogService.getWidgetsByServiceId(serviceId);
}catch(Exception e){
- logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetByServiceId in widget microservices. Details:" + e.getMessage());
+ logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetByServiceId in widget microservices. Details:", e);
byteFile = storageService.getWidgetCatalogContent(widgetId);
logger.debug("WidgetsCatalogController.getWidgetZipFile: getting widget zip file for widget with id {}", widgetId);
} catch (Exception e) {
byteFile = storageService.getWidgetCatalogContent(widgetId);
logger.debug("WidgetsCatalogController.getWidgetZipFile: getting widget zip file for widget with id {}", widgetId);
} catch (Exception e) {
- logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetZipFile in widget microservices. Details:" + e.getMessage());
+ logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetZipFile in widget microservices. Details:", e);