FileDocCategorySizeDatePackage
SingleSignOnEntry.javaAPI DocGlassfish v2 API4771Fri May 04 22:35:28 BST 2007com.sun.enterprise.security.web

SingleSignOnEntry

public class SingleSignOnEntry extends Object
A private class representing entries in the cache of authenticated users.

Fields Summary
public String
authType
public String
password
public Principal
principal
public org.apache.catalina.Session[]
sessions
public String
username
public String
realmName
public long
lastAccessTime
Constructors Summary
public SingleSignOnEntry(Principal principal, String authType, String username, String password, String realmName)


        
                                   
        super();
        this.principal = principal;
        this.authType = authType;
        this.username = username;
        this.password = password;
        this.realmName = realmName;
        this.lastAccessTime = System.currentTimeMillis();
    
Methods Summary
public synchronized booleanaddSession(SingleSignOn sso, org.apache.catalina.Session session)
Adds the given session to this SingleSignOnEntry if it does not already exist.

return
true if the session was added, false otherwise

        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;
    
public synchronized org.apache.catalina.Session[]findSessions()

        return (this.sessions);
    
public synchronized voidremoveSession(org.apache.catalina.Session session)

        Session[] nsessions = new Session[sessions.length - 1];
        for (int i = 0, j = 0; i < sessions.length; i++) {
            if (session == sessions[i])
                continue;
            nsessions[j++] = sessions[i];
        }
        sessions = nsessions;