001/*
002 * (C) Copyright 2006-2010 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 *     bstefanescu
016 */
017package org.nuxeo.ecm.platform.usermanager;
018
019import java.io.Serializable;
020
021/**
022 * A class containing the configuration of an user principal instance. This class keeps the keys of the basic user
023 * fields.
024 *
025 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
026 */
027public class UserConfig implements Serializable {
028
029    private static final long serialVersionUID = 1L;
030
031    public static final UserConfig DEFAULT = new UserConfig();
032
033    /**
034     * The default key name for user id, configurable on the UserManager service
035     */
036    public static final String USERNAME_COLUMN = "username";
037
038    /**
039     * The default key name for user email, configurable on the UserManager service
040     */
041    public static final String EMAIL_COLUMN = "email";
042
043    public static final String FIRSTNAME_COLUMN = "firstName";
044
045    public static final String LASTNAME_COLUMN = "lastName";
046
047    public static final String COMPANY_COLUMN = "company";
048
049    public static final String PASSWORD_COLUMN = "password";
050
051    public static final String GROUPS_COLUMN = "groups";
052
053    public static final String SCHEMA_NAME = "user";
054
055    public String nameKey = USERNAME_COLUMN;
056
057    public String passwordKey = PASSWORD_COLUMN;
058
059    public String firstNameKey = FIRSTNAME_COLUMN;
060
061    public String lastNameKey = LASTNAME_COLUMN;
062
063    public String companyKey = COMPANY_COLUMN;
064
065    public String emailKey = EMAIL_COLUMN;
066
067    public String groupsKey = GROUPS_COLUMN;
068
069    public String schemaName = SCHEMA_NAME;
070
071    @Override
072    public UserConfig clone()
073    {
074        UserConfig usrCfg = new UserConfig();
075        usrCfg.companyKey = companyKey;
076        usrCfg.emailKey = emailKey;
077        usrCfg.firstNameKey = firstNameKey;
078        usrCfg.groupsKey = groupsKey;
079        usrCfg.lastNameKey = lastNameKey;
080        usrCfg.nameKey = nameKey;
081        usrCfg.passwordKey = passwordKey;
082        usrCfg.schemaName = schemaName;
083
084        return usrCfg;
085    }
086
087}