001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Thierry Delprat
016 * *
017 */
018
019package org.nuxeo.ecm.platform.computedgroups;
020
021import java.io.Serializable;
022import java.util.List;
023import java.util.Map;
024import java.util.Set;
025
026import org.nuxeo.ecm.core.api.NuxeoGroup;
027import org.nuxeo.ecm.platform.usermanager.NuxeoPrincipalImpl;
028
029/**
030 * Interface for computed group service.
031 *
032 * @author tiry
033 */
034public interface ComputedGroupsService {
035
036    boolean activateComputedGroups();
037
038    /**
039     * Returns list of ids for users computed groups.
040     */
041    List<String> computeGroupsForUser(NuxeoPrincipalImpl nuxeoPrincipal);
042
043    /**
044     * Update the virtual groups of the user with the computed groups.
045     */
046    void updateGroupsForUser(NuxeoPrincipalImpl nuxeoPrincipal);
047
048    /**
049     * Resolves a computed group by it's name.
050     */
051    NuxeoGroup getComputedGroup(String groupName);
052
053    /**
054     * Defines if a computed group can override a physical group.
055     */
056    boolean allowGroupOverride();
057
058    /**
059     * Returns list of all computed groups (if this is available).
060     */
061    List<String> computeGroupIds();
062
063    /**
064     * Retrieves member users for a given computed group.
065     */
066    List<String> getComputedGroupMembers(String groupName);
067
068    /**
069     * Retrieves parent group for a given computed group.
070     */
071    List<String> getComputedGroupParent(String groupName);
072
073    /**
074     * Retrieves sub groups for a given computed group.
075     */
076    List<String> getComputedGroupSubGroups(String groupName);
077
078    /**
079     * Searches for a computed group.
080     */
081    List<String> searchComputedGroups(Map<String, Serializable> filter, Set<String> fulltext);
082
083}