Search in sources :

Example 1 with EmcMetalnxVersion

use of com.emc.metalnx.utils.EmcMetalnxVersion 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();
}
Also used : JargonVersion(org.irods.jargon.core.utils.JargonVersion) Authentication(org.springframework.security.core.Authentication) DataGridUser(com.emc.metalnx.core.domain.entity.DataGridUser) EmcMetalnxVersion(com.emc.metalnx.utils.EmcMetalnxVersion) UsernamePasswordAuthenticationToken(org.springframework.security.authentication.UsernamePasswordAuthenticationToken) URLMap(com.emc.metalnx.modelattribute.enums.URLMap)

Aggregations

DataGridUser (com.emc.metalnx.core.domain.entity.DataGridUser)1 URLMap (com.emc.metalnx.modelattribute.enums.URLMap)1 EmcMetalnxVersion (com.emc.metalnx.utils.EmcMetalnxVersion)1 JargonVersion (org.irods.jargon.core.utils.JargonVersion)1 UsernamePasswordAuthenticationToken (org.springframework.security.authentication.UsernamePasswordAuthenticationToken)1 Authentication (org.springframework.security.core.Authentication)1