]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
bfbd207551ef4d6933018e6b7bafb34399db46a3
[tmp/jakarta-migration.git] /
1 /**
2  *  This document is a part of the source code and related artifacts
3  *  for CollectionSpace, an open source collections management system
4  *  for museums and related institutions:
5
6  *  http://www.collectionspace.org
7  *  http://wiki.collectionspace.org
8
9  *  Copyright 2009 University of California at Berkeley
10
11  *  Licensed under the Educational Community License (ECL), Version 2.0.
12  *  You may not use this file except in compliance with this License.
13
14  *  You may obtain a copy of the ECL 2.0 License at
15
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17
18  *  Unless required by applicable law or agreed to in writing, software
19  *  distributed under the License is distributed on an "AS IS" BASIS,
20  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  *  See the License for the specific language governing permissions and
22  *  limitations under the License.
23  */
24 /*
25  * To change this template, choose Tools | Templates
26  * and open the template in the editor.
27  */
28
29 package org.collectionspace.authentication.realm;
30
31 import java.util.Set;
32
33 import javax.security.auth.login.AccountException;
34
35 import org.collectionspace.authentication.CSpaceTenant;
36
37 /**
38  * Interface for the CollectionSpace realm.
39  */
40 public interface CSpaceRealm {
41
42         /**
43          * Retrieves the "salt" used to encrypt the user's password
44          * @param username
45          * @return
46          * @throws AccountException
47          */
48         public String getSalt(String username) throws AccountException;
49
50     /**
51      * Retrieves the hashed password used to authenticate a user.
52      *
53      * @param username
54      * @return the password
55      * @throws AccountNotFoundException if the user is not found
56      * @throws AccountException if the password could not be retrieved
57      */
58     public String getPassword(String username) throws AccountException;
59
60     /**
61      * Retrieves the roles for a user.
62      *
63      * @param username
64      * @return a collection of roles
65      * @throws AccountException if the roles could not be retrieved
66      */
67     public Set<String> getRoles(String username) throws AccountException;
68
69     /**
70      * Retrieves the enabled tenants associated with a user.
71      *
72      * @param username
73      * @return a collection of tenants
74      * @throws AccountException if the tenants could not be retrieved
75      */
76     public Set<CSpaceTenant> getTenants(String username) throws AccountException;
77
78     /**
79      * Retrieves the tenants associated with a user, optionally including disabled tenants.
80      *
81      * @param username
82      * @param includeDisabledTenants if true, include disabled tenants
83      * @return a collection of tenants
84      * @throws AccountException if the tenants could not be retrieved
85      */
86     public Set<CSpaceTenant> getTenants(String username, boolean includeDisabledTenants) throws AccountException;
87 }