Ignore:
Timestamp:
Sep 7, 2011, 4:32:20 AM (13 years ago)
Author:
Solomon Blaz
Message:

removed dependencies on KAAJEE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/listener/TimeOutIntegrationSessionAttributeListener.java

    r1227 r1236  
    11package gov.va.med.edp.web.servlet.listener;
    22
    3 import gov.va.med.authentication.kernel.LoginUserInfoVO;
    43import gov.va.med.edp.dao.SessionDao;
     4import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
    55import gov.va.med.edp.vo.SessionVO;
    66import gov.va.med.edp.web.controller.SessionConstants;
    77import org.apache.commons.logging.Log;
    88import org.apache.commons.logging.LogFactory;
     9import org.springframework.security.context.HttpSessionContextIntegrationFilter;
     10import org.springframework.security.context.SecurityContext;
    911import org.springframework.web.context.WebApplicationContext;
    1012import org.springframework.web.context.support.WebApplicationContextUtils;
     
    2022
    2123    public void attributeAdded(HttpSessionBindingEvent event) {
    22         if (!event.getName().equals(LoginUserInfoVO.SESSION_KEY)) return;
     24        if (!event.getName().equals(HttpSessionContextIntegrationFilter.SPRING_SECURITY_CONTEXT_KEY)) return;
    2325
    2426        setTimeOut(event);
     
    2628
    2729    public void attributeRemoved(HttpSessionBindingEvent event) {
    28         if (!event.getName().equals(LoginUserInfoVO.SESSION_KEY)) return;
     30        if (!event.getName().equals(HttpSessionContextIntegrationFilter.SPRING_SECURITY_CONTEXT_KEY)) return;
    2931    }
    3032
    3133    public void attributeReplaced(HttpSessionBindingEvent event) {
    32         if (!event.getName().equals(LoginUserInfoVO.SESSION_KEY)) return;
     34        if (!event.getName().equals(HttpSessionContextIntegrationFilter.SPRING_SECURITY_CONTEXT_KEY)) return;
    3335
    3436        setTimeOut(event);
     
    3638
    3739    private void setTimeOut(HttpSessionBindingEvent event) {
    38         LoginUserInfoVO userInfo = (LoginUserInfoVO) event.getValue();
     40        SecurityContext securityContext = (SecurityContext) event.getValue();
     41        VistaUserDetails userInfo = (VistaUserDetails) securityContext.getAuthentication().getPrincipal();
    3942
    4043        try {
     
    4245            SessionDao dao = (SessionDao) ac.getBean(SESSION_DAO_BEAN_NAME, SessionDao.class);
    4346
    44             SessionVO sessionInfo = dao.getSessionInfo(userInfo.getLoginStationNumber(), userInfo.getUserDuz());
     47            SessionVO sessionInfo = dao.getSessionInfo(userInfo.getLoginStationNumber(), userInfo.getDuz());
    4548
    4649            String serverPackageVersion = sessionInfo.getServerPackageVersion();
     
    5053            int timeOut = sessionInfo.getMaxInactiveInterval();
    5154            event.getSession().setMaxInactiveInterval(timeOut);
    52             if (log.isDebugEnabled()) log.debug("set timeout for user " + userInfo.getUserDuz() + " to " + timeOut + " seconds.");
     55            if (log.isDebugEnabled()) log.debug("set timeout for user " + userInfo.getDuz() + " to " + timeOut + " seconds.");
    5356        } catch (DataAccessException e) {
    5457            log.error("unable to fetch session info", e);
Note: See TracChangeset for help on using the changeset viewer.