KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > ac > User


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 package org.apache.lenya.ac;
19
20 /**
21  * A user.
22  * @version $Id: User.java 43240 2004-08-16 16:21:22Z andreas $
23  */

24 public interface User extends Identifiable, Item, Groupable {
25     
26     /**
27      * Get the email address
28      *
29      * @return a <code>String</code>
30      */

31     String JavaDoc getEmail();
32     
33     /**
34      * Set the email address
35      *
36      * @param email the new email address
37      */

38     void setEmail(String JavaDoc email);
39     
40     /**
41      * Sets the password.
42      * @param plainTextPassword The plain text passwrod.
43      */

44     void setPassword(String JavaDoc plainTextPassword);
45     
46     /**
47      * Save the user
48      *
49      * @throws AccessControlException if the save failed
50      */

51     void save() throws AccessControlException;
52     
53     /**
54      * Delete a user
55      *
56      * @throws AccessControlException if the delete failed
57      */

58     void delete() throws AccessControlException;
59     
60     /**
61      * Authenticate a user. This is done by encrypting
62      * the given password and comparing this to the
63      * encryptedPassword.
64      *
65      * @param password to authenticate with
66      * @return true if the given password matches the password for this user
67      */

68     boolean authenticate(String JavaDoc password);
69     
70 }
Popular Tags