public void login(Session session) { session.addSessionListener(this); }
public void login(Session session) { session.addSessionListener(this); }
/** * Adds the given session to this SingleSignOnEntry if it does not * already exist. * * @return true if the session was added, false otherwise */ public synchronized boolean addSession(SingleSignOn sso, Session session) { boolean result = sessions.add(session); if (result) { session.addSessionListener(sso); } return true; }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public synchronized void addSession(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param session The <code>Session</code> being associated with the SSO. * @return <code>true</code> if the given Session was a new addition (i.e. * was not previously associated with this entry); * <code>false</code> otherwise. */ synchronized boolean addSession2(SingleSignOn sso, Session session) { for (int i = 0; i < sessions.length; i++) { if (session == sessions[i]) return false; } Session results[] = new Session[sessions.length + 1]; System.arraycopy(sessions, 0, results, 0, sessions.length); results[sessions.length] = session; sessions = results; session.addSessionListener(sso); return true; }
protected void login(Session session, String username) { Map<String, Session> map = userSessionMap.get(username); if (map == null) { final Map<String, Session> value = new HashMap<String, Session>(); map = userSessionMap.putIfAbsent(username, value); if (map == null) { map = value; } } synchronized (map) { map.put(session.getId(), session); } session.addSessionListener(this); }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param ssoId The ID of the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public void addSession(SingleSignOn sso, String ssoId, Session session) { SingleSignOnSessionKey key = new SingleSignOnSessionKey(session); SingleSignOnSessionKey currentKey = sessionKeys.putIfAbsent(key, key); if (currentKey == null) { // Session not previously added session.addSessionListener(sso.getSessionListener(ssoId)); } }
/** * Adds a <code>Session</code> to the list of those associated with * this SSO. * * @param sso The <code>SingleSignOn</code> valve that is managing * the SSO session. * @param ssoId The ID of the SSO session. * @param session The <code>Session</code> being associated with the SSO. */ public void addSession(SingleSignOn sso, String ssoId, Session session) { SingleSignOnSessionKey key = new SingleSignOnSessionKey(session); SingleSignOnSessionKey currentKey = sessionKeys.putIfAbsent(key, key); if (currentKey == null) { // Session not previously added session.addSessionListener(sso.getSessionListener(ssoId)); } }
/** * Tracks the given session, by registering this SessionTracker as a * listener with the given session, and by incrementing the counter of * currently tracked sessions. * * @param session The session to track */ public synchronized void track(Session session) { if (trackedSessionId == null) { trackedSessionId = session.getIdInternal(); } else if (!trackedSessionId.equals(session.getIdInternal())) { throw new IllegalArgumentException("Should never reach here"); } count++; if (session.getManager() != null && session.getManager().getContainer() != null && session.getManager().getContainer().getName() != null) { contextNames.add(session.getManager().getContainer().getName()); } session.addSessionListener(this); }