1/*2 * Copyright 2000-2001,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 at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.security;
1819import java.util.Iterator;
2021import org.apache.jetspeed.om.security.Group;
22import org.apache.jetspeed.om.security.Permission;
23import org.apache.jetspeed.om.security.Role;
24import org.apache.turbine.services.Service;
2526/***27 * The Security Cache Service caches roles and permissions (ACLs)28 *29 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>30 * @version $Id: SecurityCacheService.java,v 1.8 2004/02/23 03:58:11 jford Exp $31 */323334publicinterfaceSecurityCacheServiceextends Service
35 {
36/*** The name of this service */37public String SERVICE_NAME = "SecurityCache";
3839/*40 * Loads the security cache for the given user.41 *42 * @param username the user to cache all role and permission information for.43 */44publicvoid load(String username)
45 throws JetspeedSecurityException;
4647/*48 * UnLoads the security cache for the given user.49 *50 * @param username the user to cache all role and permission information for.51 */52publicvoid unload(String username);
535455publicvoid loadRolePermissions();
5657/***58 * Retrieves a role from the cache for the given username.59 *60 * @param username The name key of the user.61 * @param roleName The name of the role.62 */63publicRole getRole(String username, String roleName);
6465publicRole getRole(String username, String roleName, String groupName);
6667/***68 * Retrieves a role from the cache for the given username.69 *70 */71publicvoid addRole(Role role);
7273publicvoid addRole(String username, Role role);
7475publicvoid addRole(String username, Role role, Group group);
7677publicboolean hasRole(String username, String roleName);
7879publicboolean hasRole(String username, String roleName, String groupName);
8081publicvoid removeRole(String username, String roleName);
8283publicvoid removeRole(String username, String roleName, String groupName);
8485public Iterator getRoles(String username);
8687publicCachedAcl getAcl(String username);
8889publicPermission getPermission(String roleName, String permissionName);
9091publicvoid addPermission(String roleName, Permission permission);
9293publicboolean hasPermission(String roleName, String permissionName);
9495publicvoid removePermission(String roleName, String permissionName);
9697public Iterator getPermissions(String roleName);
9899publicvoid removeAllRoles(String rolename);
100101publicvoid removeAllPermissions(String permissionName);
102103 }
104105106