1 package org.apache.fulcrum.security.model.turbine.entity;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.util.Set;
23
24 import org.apache.fulcrum.security.util.DataBackendException;
25
26 /**
27 * Represents the "turbine" model where permissions are in a many to many
28 * relationship to roles, roles are related to groups are related to users, all
29 * in many to many relationships.
30 *
31 * @author <a href="mailto:epugh@upstate.com">Eric Pugh </a>
32 * @version $Id: TurbineRole.java 535465 2007-05-05 06:58:06Z tv $
33 */
34 public interface TurbineUserGroupRoleEntity {
35
36 /**
37 * Get the User/Group/Role set associated with this entity
38 *
39 * @param <T> TurbineUserGroupRole
40 * @return a set of User/Group/Role relations
41 * @throws DataBackendException generic exception
42 */
43 public <T extends TurbineUserGroupRole> Set<T> getUserGroupRoleSet() throws DataBackendException;
44
45 /**
46 * Set the User/Group/Role set associated with this entity
47 *
48 * @param userGroupRoleSet a set of User/Group/Role relations
49 * @param <T> TurbineUserGroupRole
50 */
51 public <T extends TurbineUserGroupRole> void setUserGroupRoleSet(Set<T> userGroupRoleSet);
52
53 /**
54 * Add a User/Group/Role relation to this entity
55 *
56 * @param userGroupRole a User/Group/Role relation to add
57 * @throws DataBackendException generic exception
58 */
59 public void addUserGroupRole(TurbineUserGroupRole userGroupRole) throws DataBackendException;
60
61 /**
62 * Remove a User/Group/Role relation from this entity
63 *
64 * @param userGroupRole a User/Group/Role relation to remove
65 * @throws DataBackendException generic exception
66 */
67 public void removeUserGroupRole(TurbineUserGroupRole userGroupRole) throws DataBackendException;
68 }