@Override protected boolean removeSession(final String idInCluster) { return deleteKey(idInCluster); }
protected boolean setKey(final String idInCluster, final ISerializableSession data) throws TranscoderException { byte[] raw = getSessionFactory().pack(data); if (raw == null) { return false; } else { return ((KeyValueStoreSessionIdManager) _sessionIdManager).setKey(mangleKey(idInCluster), raw, getMaxInactiveInterval()); } }
@Override public AbstractSession getSession(final String idInCluster) { AbstractSession session; return loadSession(idInCluster); }
protected ISerializableSession getKey(final String idInCluster) throws TranscoderException { byte[] raw = ((KeyValueStoreSessionIdManager) _sessionIdManager).getKey(mangleKey(idInCluster)); if (raw == null) { return null; } else { return getSessionFactory().unpack(raw); } }
@Override protected void update(final NoSqlSession session, final String newClusterId, final String newNodeId) throws Exception { ISerializableSession data = getKey(session.getClusterId()); if (data == null) { log.warn("Couldn't get session data for old key {}", session.getClusterId()); return; } deleteKey(session.getClusterId()); setKey(newClusterId, data); }
deleteKey(session.getId()); return null; synchronized (session) data = getSessionFactory().create(session); if (!setKey(session.getId(), data))
if (_cookieDomain == null) String[] cookieDomains = getContextHandler().getVirtualHosts(); String cookiePath = getContext().getContextPath(); if (cookiePath == null || "".equals(cookiePath)) ClassLoader cl = getContext().getClassLoader(); if (cl != null) { sessionFactory.setClassLoader(cl);
ISerializableSession data = getKey(clusterId); log.debug("loadSession: loaded: id=" + clusterId + ", data=" + data);
@Override public void doStart() throws Exception { log.info("starting..."); super.doStart(); log.info("started."); }
@Override public void doStop() throws Exception { log.info("stopping..."); super.doStop(); log.info("stopped."); } }
public void invalidateAll(final String sessionId) { // tell all contexts that may have a session object with this id to // get rid of them Handler[] contexts = _server.getChildHandlersByClass(ContextHandler.class); for (int i = 0; contexts != null && i < contexts.length; i++) { SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class); if (sessionHandler != null) { SessionManager manager = sessionHandler.getSessionManager(); if (manager != null && manager instanceof KeyValueStoreSessionManager) { ((KeyValueStoreSessionManager) manager).invalidateSession(sessionId); } } } }
try data = getKey(session.getClusterId());
protected boolean addKey(final String idInCluster, final ISerializableSession data) throws TranscoderException { byte[] raw = getSessionFactory().pack(data); if (raw == null) { return false; } else { return ((KeyValueStoreSessionIdManager) _sessionIdManager).addKey(mangleKey(idInCluster), raw, getMaxInactiveInterval()); } }
@Override protected boolean remove(final NoSqlSession session) { if (session == null) { return false; } else { return deleteKey(session.getId()); } }