001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.catalina;
019:
020: import java.security.Principal;
021: import java.util.Iterator;
022:
023: /**
024: * <p>Abstract representation of a group of {@link User}s in a
025: * {@link UserDatabase}. Each user that is a member of this group
026: * inherits the {@link Role}s assigned to the group.</p>
027: *
028: * @author Craig R. McClanahan
029: * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
030: * @since 4.1
031: */
032:
033: public interface Group extends Principal {
034:
035: // ------------------------------------------------------------- Properties
036:
037: /**
038: * Return the description of this group.
039: */
040: public String getDescription();
041:
042: /**
043: * Set the description of this group.
044: *
045: * @param description The new description
046: */
047: public void setDescription(String description);
048:
049: /**
050: * Return the group name of this group, which must be unique
051: * within the scope of a {@link UserDatabase}.
052: */
053: public String getGroupname();
054:
055: /**
056: * Set the group name of this group, which must be unique
057: * within the scope of a {@link UserDatabase}.
058: *
059: * @param groupname The new group name
060: */
061: public void setGroupname(String groupname);
062:
063: /**
064: * Return the set of {@link Role}s assigned specifically to this group.
065: */
066: public Iterator getRoles();
067:
068: /**
069: * Return the {@link UserDatabase} within which this Group is defined.
070: */
071: public UserDatabase getUserDatabase();
072:
073: /**
074: * Return the set of {@link User}s that are members of this group.
075: */
076: public Iterator getUsers();
077:
078: // --------------------------------------------------------- Public Methods
079:
080: /**
081: * Add a new {@link Role} to those assigned specifically to this group.
082: *
083: * @param role The new role
084: */
085: public void addRole(Role role);
086:
087: /**
088: * Is this group specifically assigned the specified {@link Role}?
089: *
090: * @param role The role to check
091: */
092: public boolean isInRole(Role role);
093:
094: /**
095: * Remove a {@link Role} from those assigned to this group.
096: *
097: * @param role The old role
098: */
099: public void removeRole(Role role);
100:
101: /**
102: * Remove all {@link Role}s from those assigned to this group.
103: */
104: public void removeRoles();
105:
106: }
|