KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > security > authentication > MutableAuthenticationDao


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.security.authentication;
18
19 import java.util.Date JavaDoc;
20
21 import net.sf.acegisecurity.providers.dao.AuthenticationDao;
22 import net.sf.acegisecurity.providers.dao.SaltSource;
23
24 /**
25  * A service provider interface to provide both acegi integration via AuthenticationDao and SaltSource
26  * and mutability support for user definitions.
27  *
28  * @author Andy Hind
29  */

30 public interface MutableAuthenticationDao extends AuthenticationDao, SaltSource
31 {
32     /**
33      * Create a user with the given userName and password
34      *
35      * @param userName
36      * @param rawPassword
37      * @throws AuthenticationException
38      */

39     public void createUser(String JavaDoc userName, char[] rawPassword) throws AuthenticationException;
40     
41     /**
42      * Update a user's password.
43      *
44      * @param userName
45      * @param rawPassword
46      * @throws AuthenticationException
47      */

48     public void updateUser(String JavaDoc userName, char[] rawPassword) throws AuthenticationException;
49     
50     /**
51      * Delete a user.
52      *
53      * @param userName
54      * @throws AuthenticationException
55      */

56     public void deleteUser(String JavaDoc userName) throws AuthenticationException;
57     
58     /**
59      * CHeck is a user exists.
60      *
61      * @param userName
62      * @return
63      */

64     public boolean userExists(String JavaDoc userName);
65     
66     /**
67      * Enable/disable a user.
68      *
69      * @param userName
70      * @param enabled
71      */

72     public void setEnabled(String JavaDoc userName, boolean enabled);
73     
74     /**
75      * Getter for user enabled
76      *
77      * @param userName
78      * @return
79      */

80     public boolean getEnabled(String JavaDoc userName);
81     
82     /**
83      * Set if the account should expire
84      *
85      * @param userName
86      * @param expires
87      */

88     public void setAccountExpires(String JavaDoc userName, boolean expires);
89     
90     /**
91      * Does the account expire?
92      *
93      * @param userName
94      * @return
95      */

96             
97     public boolean getAccountExpires(String JavaDoc userName);
98     
99     /**
100      * Has the account expired?
101      *
102      * @param userName
103      * @return
104      */

105     public boolean getAccountHasExpired(String JavaDoc userName);
106   
107     /**
108      * Set if the password expires.
109      *
110      * @param userName
111      * @param expires
112      */

113     public void setCredentialsExpire(String JavaDoc userName, boolean expires);
114   
115     /**
116      * Do the credentials for the user expire?
117      *
118      * @param userName
119      * @return
120      */

121     public boolean getCredentialsExpire(String JavaDoc userName);
122     
123     /**
124      * Have the credentials for the user expired?
125      *
126      * @param userName
127      * @return
128      */

129     public boolean getCredentialsHaveExpired(String JavaDoc userName);
130     
131     /**
132      * Set if the account is locked.
133      *
134      * @param userName
135      * @param locked
136      */

137     public void setLocked(String JavaDoc userName, boolean locked);
138     
139     /**
140      * Is the account locked?
141      *
142      * @param userName
143      * @return
144      */

145     public boolean getAccountlocked(String JavaDoc userName);
146     
147     /**
148      * Set the date on which the account expires
149      *
150      * @param userName
151      * @param exipryDate
152      */

153     public void setAccountExpiryDate(String JavaDoc userName, Date JavaDoc exipryDate);
154     
155     /**
156      * Get the date when this account expires.
157      *
158      * @param userName
159      * @return
160      */

161     public Date JavaDoc getAccountExpiryDate(String JavaDoc userName);
162     
163     /**
164      * Set the date when credentials expire.
165      *
166      * @param userName
167      * @param exipryDate
168      */

169     public void setCredentialsExpiryDate(String JavaDoc userName, Date JavaDoc exipryDate);
170     
171     /**
172      * Get the date when the credentials/password expire.
173      *
174      * @param userName
175      * @return
176      */

177     public Date JavaDoc getCredentialsExpiryDate(String JavaDoc userName);
178     
179     /**
180      * Get the MD4 password hash
181      *
182      * @param userName
183      * @return
184      */

185     public String JavaDoc getMD4HashedPassword(String JavaDoc userName);
186     
187     /**
188      * Are user names case sensitive?
189      *
190      * @return
191      */

192     public boolean getUserNamesAreCaseSensitive();
193     
194 }
195
Popular Tags