001package org.apache.fulcrum.security.model.basic.entity; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import java.util.Set; 023 024import org.apache.fulcrum.security.entity.Group; 025import org.apache.fulcrum.security.entity.User; 026import org.apache.fulcrum.security.util.UserSet; 027 028/** 029 * Represents the "basic" model where users are part of groups, but nothing 030 * else. 031 * 032 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a> 033 * @version $Id$ 034 */ 035public interface BasicGroup extends Group 036{ 037 /** 038 * Get the users that are part of this group 039 * 040 * @return a set of users 041 */ 042 public UserSet getUsers(); 043 044 /** 045 * Set the users that are part of this group 046 * 047 * @param userSet 048 * a set of users 049 */ 050 public void setUsers(UserSet userSet); 051 052 /** 053 * Get the users that are part of this group as a Set 054 * 055 * @param <T> User type 056 * @return a set of users 057 */ 058 public <T extends User> Set<T> getUsersAsSet(); 059 060 /** 061 * Set the users that are part of this group as a Set 062 * 063 * @param <T> User type 064 * @param users 065 * a set of users 066 */ 067 public <T extends User> void setUsersAsSet(Set<T> users); 068 069 /** 070 * Add a user to this group 071 * 072 * @param user 073 * the user to add 074 */ 075 public void addUser(User user); 076 077 /** 078 * Remove a user from this group 079 * 080 * @param user 081 * the user to remove 082 */ 083 public void removeUser(User user); 084}