KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > drftpd > master > usermanager > UserManager


1 /*
2  * This file is part of DrFTPD, Distributed FTP Daemon.
3  *
4  * DrFTPD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * DrFTPD is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with DrFTPD; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package net.sf.drftpd.master.usermanager;
19 import java.util.Collection JavaDoc;
20 import java.util.List JavaDoc;
21
22 import net.sf.drftpd.master.ConnectionManager;
23
24 /**
25  * This is the base class of all the user manager classes.
26  * If we want to add a new user manager, we have to override
27  * this class.
28  *
29  * @author <a HREF="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
30  * @version $Id: UserManager.java,v 1.20 2004/02/10 00:03:09 mog Exp $
31  */

32 public interface UserManager {
33
34     /**
35      * A kind of constuctor defined in the interface for allowing the usermanager
36      * to get a hold of the ConnectionManager object for dispatching events etc.
37      */

38     public abstract void init(ConnectionManager mgr);
39     public abstract User create(String JavaDoc username) throws UserFileException;
40     /**
41      * User existance check.
42      *
43      * @param name user name
44      */

45     public abstract boolean exists(String JavaDoc name);
46     public abstract Collection JavaDoc getAllGroups() throws UserFileException;
47
48     /**
49      * Get all user names in the system.
50      */

51     public abstract List JavaDoc getAllUsers() throws UserFileException;
52     public abstract Collection JavaDoc getAllUsersByGroup(String JavaDoc group)
53         throws UserFileException;
54     
55
56     /**
57      * Get user by name.
58      */

59     //TODO garbage collected Map of users.
60
public abstract User getUserByName(String JavaDoc name)
61         throws NoSuchUserException, UserFileException;
62     public User getUserByNameUnchecked(String JavaDoc username) throws NoSuchUserException, UserFileException;
63     public abstract void saveAll() throws UserFileException;
64
65 }
66
Popular Tags