@Override public void putSession(Session session) { getOperatingRegion().put(session.getId(), (HttpSession) session); }
public void remove(Session session, boolean update) { // super.remove(session); // Remove the session from the region if necessary. // It will have already been removed if it expired implicitly. DeltaSessionInterface ds = (DeltaSessionInterface) session; if (ds.getExpired()) { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Expired session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } } else { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Destroying session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } getSessionCache().destroySession(session.getId()); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Destroyed session " + session.getId() + " from " + getSessionCache().getOperatingRegionName()); } } }
@Override public void add(Session session) { // super.add(session); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Storing session " + session.getId() + " into " + getSessionCache().getOperatingRegionName()); } getSessionCache().putSession(session); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Stored session " + session.getId() + " into " + getSessionCache().getOperatingRegionName()); } getSessionCache().getStatistics().incSessionsCreated(); }
private void removeInternal( final Session session, final boolean update, final boolean removeFromMemcached ) { if ( _log.isDebugEnabled() ) { _log.debug( "remove invoked, removeFromMemcached: " + removeFromMemcached + ", id: " + session.getId() ); } if ( removeFromMemcached ) { _msm.deleteFromMemcached( session.getId() ); } super.remove( session, update ); _msm.sessionRemoved((MemcachedBackupSession) session); }
private void removeInternal( final Session session, final boolean update, final boolean removeFromMemcached ) { if ( _log.isDebugEnabled() ) { _log.debug( "remove invoked, removeFromMemcached: " + removeFromMemcached + ", id: " + session.getId() ); } if ( removeFromMemcached ) { _msm.deleteFromMemcached( session.getId() ); } super.remove( session, update ); _msm.sessionRemoved((MemcachedBackupSession) session); }
private void remove( final Session session, final boolean removeFromMemcached ) { if ( _log.isDebugEnabled() ) { _log.debug( "remove invoked, removeFromMemcached: " + removeFromMemcached + ", id: " + session.getId() ); } if ( removeFromMemcached ) { _msm.deleteFromMemcached( session.getId() ); } super.remove( session ); _msm.sessionRemoved((MemcachedBackupSession) session); }
private void removeInternal( final Session session, final boolean update, final boolean removeFromMemcached ) { if ( _log.isDebugEnabled() ) { _log.debug( "remove invoked, removeFromMemcached: " + removeFromMemcached + ", id: " + session.getId() ); } if ( removeFromMemcached ) { _msm.deleteFromMemcached( session.getId() ); } super.remove( session, update ); _msm.sessionRemoved((MemcachedBackupSession) session); }
sbean = new ApplicationSession(); sbean.setId(session.getId()); sbean.setCreationTime(new Date(session.getCreationTime())); sbean.setLastAccessTime(new Date(session.getLastAccessedTime()));
@Override public Comparable<String> getComparableObject(Session session) { return session.getId(); } };
/** * Test for issue #49: * Sessions not associated with a memcached node don't get associated as soon as a memcached is available * @throws InterruptedException * @throws IOException * @throws TimeoutException * @throws ExecutionException */ @Test( enabled = true ) public void testNotAssociatedSessionGetsAssociatedIssue49() throws InterruptedException, IOException, ExecutionException, TimeoutException { _daemon.stop(); final SessionManager manager = _tomcat1.getManager(); manager.setMaxInactiveInterval( 5 ); manager.setSticky( true ); final SessionIdFormat sessionIdFormat = new SessionIdFormat(); final Session session = manager.createSession( null ); assertNull( sessionIdFormat.extractMemcachedId( session.getId() ) ); _daemon.start(); // Wait so that the daemon will be available and the client can reconnect (async get didn't do the trick) waitForReconnect(manager.getMemcachedSessionService().getStorageClient(), 1, 4000); final String newSessionId = manager.getMemcachedSessionService().changeSessionIdOnMemcachedFailover( session.getId() ); assertNotNull( newSessionId ); assertEquals( newSessionId, session.getId() ); assertEquals( sessionIdFormat.extractMemcachedId( newSessionId ), _memcachedNodeId ); }
protected Session getSessionForNameAndId(ContextName cn, String id, StringManager smClient) { List<Session> sessions = getSessionsForName(cn, smClient); if (sessions.isEmpty()) return null; for(Session session : sessions) { if (session.getId().equals(id)) { return session; } } return null; }
protected Session getSessionForNameAndId(ContextName cn, String id, StringManager smClient) { List<Session> sessions = getSessionsForName(cn, smClient); if (sessions == null || sessions.isEmpty()) return null; for(Session session : sessions) { if (session.getId().equals(id)) { return session; } } return null; }
/** {@inheritDoc} */ public void sessionEvent(final SessionEvent event) { if (Session.SESSION_DESTROYED_EVENT.equals(event.getType())) { logger.debug("Cleaning up SessionMappingStorage on destroySession event"); this.handler.getSessionMappingStorage().removeBySessionById(event.getSession().getId()); } }
/** {@inheritDoc} */ public void sessionEvent(final SessionEvent event) { if (Session.SESSION_DESTROYED_EVENT.equals(event.getType())) { logger.debug("Cleaning up SessionMappingStorage on destroySession event"); this.handler.getSessionMappingStorage().removeBySessionById(event.getSession().getId()); } }
/** {@inheritDoc} */ public void sessionEvent(final SessionEvent event) { if (Session.SESSION_DESTROYED_EVENT.equals(event.getType())) { logger.debug("Cleaning up SessionMappingStorage on destroySession event"); this.handler.getSessionMappingStorage().removeBySessionById(event.getSession().getId()); } }
/** {@inheritDoc} */ public void sessionEvent(final SessionEvent event) { if (Session.SESSION_DESTROYED_EVENT.equals(event.getType())) { logger.debug("Cleaning up SessionMappingStorage on destroySession event"); this.handler.getSessionMappingStorage().removeBySessionById(event.getSession().getId()); } }
public SingleSignOnSessionKey(Session session) { this.sessionId = session.getId(); Context context = session.getManager().getContext(); this.contextName = context.getName(); this.hostName = context.getParent().getName(); }
public SingleSignOnSessionKey(Session session) { this.sessionId = session.getId(); Context context = session.getManager().getContext(); this.contextName = context.getName(); this.hostName = context.getParent().getName(); }