001    /*
002      Copyright (C) 2002-2003 Renaud Pawlak <renaud@aopsys.com>
003    
004      This program is free software; you can redistribute it and/or modify
005      it under the terms of the GNU Lesser General Public License as
006      published by the Free Software Foundation; either version 2 of the
007      License, or (at your option) any later version.
008    
009      This program 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
012      GNU Lesser General Public License for more details.
013    
014      You should have received a copy of the GNU Lesser General Public License
015      along with this program; if not, write to the Free Software
016      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
017    
018    package org.objectweb.jac.aspects.user;
019    
020    import java.util.Hashtable;
021    import java.util.Map;
022    import org.objectweb.jac.core.Wrappee;
023    
024    /**
025     * Binding with profiles
026     */
027    
028    public class UserManager {
029    
030        public UserManager() {
031        }
032       
033        Hashtable profiles = new Hashtable();
034    
035        /**
036         * Get a profile with its name.
037         * 
038         * @param name the name of the profile.
039         */
040        public Profile getProfile(String name) {
041            return (Profile)profiles.get(name);
042        }
043    
044        public Map getProfiles() {
045            return profiles;
046        }
047    
048        /**
049         * Add a news profile.
050         * 
051         * @param name the name of the new profile.
052         * @param profile the profile associated with the name.
053         */
054        public void addProfile(String name, Profile profile) {
055            profile.setName(name);
056            profiles.put(name,profile);
057        }
058    
059        Wrappee defaultAdmin;
060       
061        /**
062         * Get the value of defaultAdmin.
063         * @return value of defaultAdmin.
064         */
065        public Wrappee getDefaultAdmin() {
066            return defaultAdmin;
067        }
068       
069        /**
070         * Set the value of defaultAdmin.
071         * @param v  Value to assign to defaultAdmin.
072         */
073        public void setDefaultAdmin(Wrappee  v) {
074            this.defaultAdmin = v;
075        }
076          
077    }