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:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
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.
25 * To change this template, choose Tools | Templates
26 * and open the template in the editor.
29 package org.collectionspace.authentication.realm;
33 import javax.security.auth.login.AccountException;
35 import org.collectionspace.authentication.CSpaceTenant;
38 * Interface for the CollectionSpace realm.
40 public interface CSpaceRealm {
43 * Retrieves the hashed password used to authenticate a user.
46 * @return the password
47 * @throws AccountNotFoundException if the user is not found
48 * @throws AccountException if the password could not be retrieved
50 public String getPassword(String username) throws AccountException;
53 * Retrieves the roles for a user.
56 * @return a collection of roles
57 * @throws AccountException if the roles could not be retrieved
59 public Set<String> getRoles(String username) throws AccountException;
62 * Retrieves the enabled tenants associated with a user.
65 * @return a collection of tenants
66 * @throws AccountException if the tenants could not be retrieved
68 public Set<CSpaceTenant> getTenants(String username) throws AccountException;
71 * Retrieves the tenants associated with a user, optionally including disabled tenants.
74 * @param includeDisabledTenants if true, include disabled tenants
75 * @return a collection of tenants
76 * @throws AccountException if the tenants could not be retrieved
78 public Set<CSpaceTenant> getTenants(String username, boolean includeDisabledTenants) throws AccountException;