001/*
002 *  Copyright 2017 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.core.group;
017
018import java.util.Set;
019
020import org.ametys.core.group.directory.GroupDirectory;
021import org.ametys.core.user.UserIdentity;
022
023/**
024 * A user group is a set of {@link UserIdentity}, representing a group of users.<br>
025 * A group contains any number of users, and a single user may belong to any number of groups.
026 */
027public interface Group
028{
029    /**
030     * Returns the identity of this group
031     * @return the identity of this group
032     */
033    public GroupIdentity getIdentity();
034    
035    /**
036     * Returns the label of this group
037     * @return the label of this group
038     */
039    public String getLabel();
040    
041    /**
042     * Returns the group directory this group belongs to
043     * @return the group directory this group belongs to
044     */
045    public GroupDirectory getGroupDirectory();
046    
047    /**
048     * Returns all users of this group.
049     * @return Users as a Set of {@link UserIdentity}
050     */
051    public Set<UserIdentity> getUsers();
052}