public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); }
private Set<SessionManager> getAllSessionManagers() { HashSet<SessionManager> managers = new HashSet<>(); 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 JDBCSessionManager) managers.add(manager); } } return managers; }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; SecurityHandler security = context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); return security; }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; SecurityHandler security = context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); return security; }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; SecurityHandler security = context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); return security; }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; SecurityHandler security = context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); return security; }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); }
public static SecurityHandler getCurrentSecurityHandler() { Context context = ContextHandler.getCurrentContext(); if (context==null) return null; return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class); }
public SessionContext (String workerName, ContextHandler.Context context) { if (context != null) _sessionHandler = context.getContextHandler().getChildHandlerByClass(SessionHandler.class); _workerName = workerName; _context = context; _canonicalContextPath = canonicalizeContextPath(_context); _vhost = canonicalizeVHost(_context); }
public void invalidateAll(String sessionId) { synchronized (sessionsIds) { sessionsIds.remove(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 HazelcastSessionManager) { ((HazelcastSessionManager) manager).invalidateSession(sessionId); } } } } }
private void forEachSessionManager(SessionManagerCallback callback) { 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 SessionManagerSkeleton) callback.execute((SessionManagerSkeleton) manager); } } }
private void forEachSessionManager(final SessionManagerCallback callback) { Handler[] contexts = server.getChildHandlersByClass(ContextHandler.class); for (int i = 0; contexts != null && i < contexts.length; i++) { final SessionHandler sessionHandler = ((ContextHandler) contexts[i]).getChildHandlerByClass(SessionHandler.class); if (sessionHandler != null) { final SessionManager manager = sessionHandler.getSessionManager(); if (manager != null && manager instanceof AbstractSessionManager) { callback.execute((AbstractSessionManager) manager); } } } }
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); } } } }
@Override public void renewSessionId(String oldClusterId, String oldNodeId, HttpServletRequest request) { //generate a new id String newClusterId = newSessionId(request.hashCode()); synchronized (sessionsIds) { //remove the old one from the list sessionsIds.remove(oldClusterId); //add in the new session id to the list sessionsIds.add(newClusterId); //tell all contexts to update the id 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 HazelcastSessionManager) { ((HazelcastSessionManager) manager). renewSessionId(oldClusterId, oldNodeId, newClusterId, getNodeId(newClusterId, request)); } } } } }
@Override public void renewSessionId(final String oldClusterId, final String oldNodeId, final HttpServletRequest request) { //generate a new id String newClusterId = newSessionId(request.hashCode()); //tell all contexts to update the id 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).renewSessionId(oldClusterId, oldNodeId, newClusterId, getNodeId(newClusterId, request)); } } } } }
/** * Invalidate the session matching the id on all contexts. * * @see org.eclipse.jetty.server.SessionIdManager#invalidateAll(java.lang.String) */ public void invalidateAll(String id) { //take the id out of the list of known sessionids for this node removeSession(id); synchronized (_sessionIds) { //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 = (SessionHandler)((ContextHandler)contexts[i]).getChildHandlerByClass(SessionHandler.class); if (sessionHandler != null) { SessionManager manager = sessionHandler.getSessionManager(); if (manager != null && manager instanceof JDBCSessionManager) { ((JDBCSessionManager)manager).invalidateSession(id); } } } } }
public void renewSessionId (String oldClusterId, String oldNodeId, HttpServletRequest request) { //generate a new id String newClusterId = newSessionId(request.hashCode()); synchronized (_sessionIds) { removeSession(oldClusterId);//remove the old one from the list (and database) addSession(newClusterId); //add in the new session id to the list (and database) //tell all contexts to update the id Handler[] contexts = _server.getChildHandlersByClass(ContextHandler.class); for (int i=0; contexts!=null && i<contexts.length; i++) { SessionHandler sessionHandler = (SessionHandler)((ContextHandler)contexts[i]).getChildHandlerByClass(SessionHandler.class); if (sessionHandler != null) { SessionManager manager = sessionHandler.getSessionManager(); if (manager != null && manager instanceof JDBCSessionManager) { ((JDBCSessionManager)manager).renewSessionId(oldClusterId, oldNodeId, newClusterId, getNodeId(newClusterId, request)); } } } } }