Changeset 1236 for EDIS/trunk/java/tracking-server-core/src
- Timestamp:
- Sep 7, 2011, 4:32:20 AM (13 years ago)
- Location:
- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/TrackingController.java
r1227 r1236 1 1 package gov.va.med.edp.web.controller; 2 2 3 import gov.va.med.authentication.kernel.LoginUserInfoVO;4 3 import gov.va.med.edp.dao.ServerPackageVersionDao; 5 4 import gov.va.med.edp.dao.TrackingDao; 5 import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails; 6 6 import gov.va.med.edp.vo.BigBoardDebugInfoVO; 7 7 import gov.va.med.edp.web.view.XmlView; 8 8 import org.springframework.beans.factory.InitializingBean; 9 import org.springframework.security.context.SecurityContextHolder; 9 10 import org.springframework.util.Assert; 10 11 import org.springframework.util.StringUtils; … … 37 38 protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { 38 39 validateSwfID(request); 39 LoginUserInfoVOuserInfo = getUserInfo(request);40 String result = trackingDao.executeCommand(userInfo.getLoginStationNumber(), userInfo.get UserDuz(), buildParameterMap(request));40 VistaUserDetails userInfo = getUserInfo(request); 41 String result = trackingDao.executeCommand(userInfo.getLoginStationNumber(), userInfo.getDuz(), buildParameterMap(request)); 41 42 if (isInitDisplayBoardCommand(request)) 42 43 result = appendSiteAndVistaLinkConnectionInfo(result, request); … … 62 63 } 63 64 64 protected LoginUserInfoVOgetUserInfo(HttpServletRequest request) throws NoUserInfoInSessionException {65 LoginUserInfoVO userInfo = (LoginUserInfoVO) request.getSession().getAttribute(LoginUserInfoVO.SESSION_KEY);65 protected VistaUserDetails getUserInfo(HttpServletRequest request) throws NoUserInfoInSessionException { 66 VistaUserDetails userInfo = (VistaUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 66 67 if (userInfo == null) throw new NoUserInfoInSessionException(); 67 68 return userInfo; -
EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/listener/TimeOutIntegrationSessionAttributeListener.java
r1227 r1236 1 1 package gov.va.med.edp.web.servlet.listener; 2 2 3 import gov.va.med.authentication.kernel.LoginUserInfoVO;4 3 import gov.va.med.edp.dao.SessionDao; 4 import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails; 5 5 import gov.va.med.edp.vo.SessionVO; 6 6 import gov.va.med.edp.web.controller.SessionConstants; 7 7 import org.apache.commons.logging.Log; 8 8 import org.apache.commons.logging.LogFactory; 9 import org.springframework.security.context.HttpSessionContextIntegrationFilter; 10 import org.springframework.security.context.SecurityContext; 9 11 import org.springframework.web.context.WebApplicationContext; 10 12 import org.springframework.web.context.support.WebApplicationContextUtils; … … 20 22 21 23 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; 23 25 24 26 setTimeOut(event); … … 26 28 27 29 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; 29 31 } 30 32 31 33 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; 33 35 34 36 setTimeOut(event); … … 36 38 37 39 private void setTimeOut(HttpSessionBindingEvent event) { 38 LoginUserInfoVO userInfo = (LoginUserInfoVO) event.getValue(); 40 SecurityContext securityContext = (SecurityContext) event.getValue(); 41 VistaUserDetails userInfo = (VistaUserDetails) securityContext.getAuthentication().getPrincipal(); 39 42 40 43 try { … … 42 45 SessionDao dao = (SessionDao) ac.getBean(SESSION_DAO_BEAN_NAME, SessionDao.class); 43 46 44 SessionVO sessionInfo = dao.getSessionInfo(userInfo.getLoginStationNumber(), userInfo.get UserDuz());47 SessionVO sessionInfo = dao.getSessionInfo(userInfo.getLoginStationNumber(), userInfo.getDuz()); 45 48 46 49 String serverPackageVersion = sessionInfo.getServerPackageVersion(); … … 50 53 int timeOut = sessionInfo.getMaxInactiveInterval(); 51 54 event.getSession().setMaxInactiveInterval(timeOut); 52 if (log.isDebugEnabled()) log.debug("set timeout for user " + userInfo.get UserDuz() + " to " + timeOut + " seconds.");55 if (log.isDebugEnabled()) log.debug("set timeout for user " + userInfo.getDuz() + " to " + timeOut + " seconds."); 53 56 } catch (DataAccessException e) { 54 57 log.error("unable to fetch session info", e);
Note:
See TracChangeset
for help on using the changeset viewer.