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 /* $Id: RoleManager.java 43240 2004-08-16 16:21:22Z andreas $ */ 19 20 package org.apache.lenya.ac; 21 22 /** 23 * Role manager. 24 * @version $Id: RoleManager.java 43240 2004-08-16 16:21:22Z andreas $ 25 */ 26 public interface RoleManager extends ItemManager { 27 28 /** 29 * Get the role for the given ID. 30 * 31 * @param roleId The name of the role requested. 32 * @return a <code>Role</code> or null if no role with the given name found 33 */ 34 Role getRole(String roleId); 35 36 /** 37 * Get all roles 38 * 39 * @return an array of roles 40 */ 41 Role[] getRoles(); 42 43 /** 44 * Add a role 45 * 46 * @param role Role to add 47 * @throws AccessControlException when the role is already contained. 48 */ 49 void add(Role role) throws AccessControlException; 50 51 /** 52 * Remove a role 53 * 54 * @param role Role to remove 55 * @throws AccessControlException when the role is not contained. 56 */ 57 void remove(Role role) throws AccessControlException; 58 59 }