use of com.emc.metalnx.modelattribute.enums.URLMap in project metalnx-web by irods-contrib.
the class HttpResponseHandlerInterceptor method postHandle.
@Override
public void postHandle(final HttpServletRequest request, final HttpServletResponse response, final Object handler, final ModelAndView modelAndView) throws Exception {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
if (modelAndView != null && auth != null) {
if (urlMap == null) {
urlMap = new URLMap();
}
if (emcmetalnxVersion == null) {
emcmetalnxVersion = new EmcMetalnxVersion();
}
modelAndView.getModelMap().addAttribute("urlMap", urlMap);
modelAndView.getModelMap().addAttribute("emcmetalnxVersion", emcmetalnxVersion);
modelAndView.getModelMap().addAttribute("jargonVersion", new JargonVersion());
modelAndView.getModelMap().addAttribute("globalConfig", configService.getGlobalConfig());
DataGridUser loggedUser = loggedUserUtils.getLoggedDataGridUser();
logger.debug("added user prefs to model as 'dataGridUser':{}", loggedUser);
modelAndView.getModelMap().addAttribute("dataGridUser", loggedUser);
if (auth instanceof UsernamePasswordAuthenticationToken) {
userTokenDetails = (UserTokenDetails) auth.getDetails();
modelAndView.getModelMap().addAttribute("userDetails", userTokenDetails.getUser());
}
}
// closing sessions to avoid idle agents
irodsAccessObjectFactory.closeSessionAndEatExceptions();
}
Aggregations