001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $
018 */
019
020package org.nuxeo.ecm.platform.ui.web.auth;
021
022import java.io.Serializable;
023import java.security.Principal;
024
025import javax.security.auth.login.LoginContext;
026
027import org.nuxeo.ecm.platform.api.login.UserIdentificationInfo;
028
029public class CachableUserIdentificationInfo implements Serializable {
030
031    private static final long serialVersionUID = 13278976543651L;
032
033    protected final UserIdentificationInfo userInfo;
034
035    protected boolean alreadyAuthenticated;
036
037    protected Principal principal;
038
039    protected transient LoginContext loginContext;
040
041    public CachableUserIdentificationInfo(String userName, String password) {
042        userInfo = new UserIdentificationInfo(userName, password);
043        alreadyAuthenticated = false;
044    }
045
046    public CachableUserIdentificationInfo(UserIdentificationInfo uii) {
047        userInfo = uii;
048        alreadyAuthenticated = false;
049    }
050
051    public Boolean getAlreadyAuthenticated() {
052        return alreadyAuthenticated;
053    }
054
055    public void setAlreadyAuthenticated(boolean alreadyAuthenticated) {
056        this.alreadyAuthenticated = alreadyAuthenticated;
057    }
058
059    public Principal getPrincipal() {
060        return principal;
061    }
062
063    public void setPrincipal(Principal principal) {
064        this.principal = principal;
065    }
066
067    public LoginContext getLoginContext() {
068        return loginContext;
069    }
070
071    public void setLoginContext(LoginContext loginContext) {
072        this.loginContext = loginContext;
073    }
074
075    public UserIdentificationInfo getUserInfo() {
076        return userInfo;
077    }
078
079}