]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
0b55b88a06a3123f575553de1d7be31b6d2b9a4f
[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 hashed password used to authenticate a user.
44      * 
45      * @param username
46      * @return the password
47      * @throws AccountNotFoundException if the user is not found
48      * @throws AccountException if the password could not be retrieved
49      */
50     public String getPassword(String username) throws AccountException;
51
52     /**
53      * Retrieves the roles for a user.
54      * 
55      * @param username
56      * @return a collection of roles
57      * @throws AccountException if the roles could not be retrieved
58      */
59     public Set<String> getRoles(String username) throws AccountException;
60
61     /**
62      * Retrieves the enabled tenants associated with a user.
63      * 
64      * @param username
65      * @return a collection of tenants
66      * @throws AccountException if the tenants could not be retrieved
67      */
68     public Set<CSpaceTenant> getTenants(String username) throws AccountException;
69
70     /**
71      * Retrieves the tenants associated with a user, optionally including disabled tenants.
72      * 
73      * @param username
74      * @param includeDisabledTenants if true, include disabled tenants
75      * @return a collection of tenants
76      * @throws AccountException if the tenants could not be retrieved
77      */
78     public Set<CSpaceTenant> getTenants(String username, boolean includeDisabledTenants) throws AccountException;
79
80 }