001/*
002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others.
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 *
016 * Contributors:
017 *     Thierry Delprat
018 * *
019 */
020
021package org.nuxeo.ecm.platform.computedgroups;
022
023import java.io.Serializable;
024import java.util.List;
025import java.util.Map;
026import java.util.Set;
027
028import org.nuxeo.ecm.core.api.NuxeoGroup;
029import org.nuxeo.ecm.platform.usermanager.NuxeoPrincipalImpl;
030
031/**
032 * Interface for computed group service.
033 *
034 * @author tiry
035 */
036public interface ComputedGroupsService {
037
038    boolean activateComputedGroups();
039
040    /**
041     * Returns list of ids for users computed groups.
042     */
043    List<String> computeGroupsForUser(NuxeoPrincipalImpl nuxeoPrincipal);
044
045    /**
046     * Update the virtual groups of the user with the computed groups.
047     */
048    void updateGroupsForUser(NuxeoPrincipalImpl nuxeoPrincipal);
049
050    /**
051     * Resolves a computed group by it's name.
052     */
053    NuxeoGroup getComputedGroup(String groupName);
054
055    /**
056     * Defines if a computed group can override a physical group.
057     */
058    boolean allowGroupOverride();
059
060    /**
061     * Returns list of all computed groups (if this is available).
062     */
063    List<String> computeGroupIds();
064
065    /**
066     * Retrieves member users for a given computed group.
067     */
068    List<String> getComputedGroupMembers(String groupName);
069
070    /**
071     * Retrieves parent group for a given computed group.
072     */
073    List<String> getComputedGroupParent(String groupName);
074
075    /**
076     * Retrieves sub groups for a given computed group.
077     */
078    List<String> getComputedGroupSubGroups(String groupName);
079
080    /**
081     * Searches for a computed group.
082     */
083    List<String> searchComputedGroups(Map<String, Serializable> filter, Set<String> fulltext);
084
085}