001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
022    import com.liferay.portal.kernel.security.access.control.AccessControlled;
023    import com.liferay.portal.kernel.transaction.Isolation;
024    import com.liferay.portal.kernel.transaction.Propagation;
025    import com.liferay.portal.kernel.transaction.Transactional;
026    import com.liferay.portal.model.UserGroup;
027    
028    import java.util.List;
029    
030    /**
031     * Provides the remote service interface for UserGroup. Methods of this
032     * service are expected to have security checks based on the propagated JAAS
033     * credentials because this service can be accessed remotely.
034     *
035     * @author Brian Wing Shun Chan
036     * @see UserGroupServiceUtil
037     * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl
038     * @see com.liferay.portal.service.impl.UserGroupServiceImpl
039     * @generated
040     */
041    @AccessControlled
042    @JSONWebService
043    @ProviderType
044    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
045            PortalException.class, SystemException.class})
046    public interface UserGroupService extends BaseService {
047            /*
048             * NOTE FOR DEVELOPERS:
049             *
050             * Never modify or reference this interface directly. Always use {@link UserGroupServiceUtil} to access the user group remote service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
051             */
052    
053            /**
054            * Adds the user groups to the group.
055            *
056            * @param groupId the primary key of the group
057            * @param userGroupIds the primary keys of the user groups
058            */
059            public void addGroupUserGroups(long groupId, long[] userGroupIds)
060                    throws PortalException;
061    
062            /**
063            * Adds the user groups to the team
064            *
065            * @param teamId the primary key of the team
066            * @param userGroupIds the primary keys of the user groups
067            */
068            public void addTeamUserGroups(long teamId, long[] userGroupIds)
069                    throws PortalException;
070    
071            /**
072            * Adds a user group.
073            *
074            * <p>
075            * This method handles the creation and bookkeeping of the user group,
076            * including its resources, metadata, and internal data structures.
077            * </p>
078            *
079            * @param name the user group's name
080            * @param description the user group's description
081            * @return the user group
082            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String,
083            ServiceContext)}
084            */
085            @java.lang.Deprecated
086            public UserGroup addUserGroup(java.lang.String name,
087                    java.lang.String description) throws PortalException;
088    
089            /**
090            * Adds a user group.
091            *
092            * <p>
093            * This method handles the creation and bookkeeping of the user group,
094            * including its resources, metadata, and internal data structures.
095            * </p>
096            *
097            * @param name the user group's name
098            * @param description the user group's description
099            * @param serviceContext the service context to be applied (optionally
100            <code>null</code>). Can set expando bridge attributes for the
101            user group.
102            * @return the user group
103            */
104            public UserGroup addUserGroup(java.lang.String name,
105                    java.lang.String description,
106                    com.liferay.portal.service.ServiceContext serviceContext)
107                    throws PortalException;
108    
109            /**
110            * Deletes the user group.
111            *
112            * @param userGroupId the primary key of the user group
113            */
114            public void deleteUserGroup(long userGroupId) throws PortalException;
115    
116            /**
117            * Fetches the user group with the primary key.
118            *
119            * @param userGroupId the primary key of the user group
120            * @return the user group with the primary key
121            */
122            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123            public UserGroup fetchUserGroup(long userGroupId) throws PortalException;
124    
125            /**
126            * Returns the OSGi service identifier.
127            *
128            * @return the OSGi service identifier
129            */
130            public java.lang.String getOSGiServiceIdentifier();
131    
132            /**
133            * Returns the user group with the name.
134            *
135            * @param name the user group's name
136            * @return the user group with the name
137            */
138            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
139            public UserGroup getUserGroup(java.lang.String name)
140                    throws PortalException;
141    
142            /**
143            * Returns the user group with the primary key.
144            *
145            * @param userGroupId the primary key of the user group
146            * @return the user group with the primary key
147            */
148            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
149            public UserGroup getUserGroup(long userGroupId) throws PortalException;
150    
151            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
152            public List<UserGroup> getUserGroups(long companyId)
153                    throws PortalException;
154    
155            /**
156            * Returns all the user groups to which the user belongs.
157            *
158            * @param userId the primary key of the user
159            * @return the user groups to which the user belongs
160            */
161            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162            public List<UserGroup> getUserUserGroups(long userId)
163                    throws PortalException;
164    
165            /**
166            * Removes the user groups from the group.
167            *
168            * @param groupId the primary key of the group
169            * @param userGroupIds the primary keys of the user groups
170            */
171            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
172                    throws PortalException;
173    
174            /**
175            * Removes the user groups from the team.
176            *
177            * @param teamId the primary key of the team
178            * @param userGroupIds the primary keys of the user groups
179            */
180            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
181                    throws PortalException;
182    
183            /**
184            * Updates the user group.
185            *
186            * @param userGroupId the primary key of the user group
187            * @param name the user group's name
188            * @param description the the user group's description
189            * @return the user group
190            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long,
191            String, String, ServiceContext)}
192            */
193            @java.lang.Deprecated
194            public UserGroup updateUserGroup(long userGroupId, java.lang.String name,
195                    java.lang.String description) throws PortalException;
196    
197            /**
198            * Updates the user group.
199            *
200            * @param userGroupId the primary key of the user group
201            * @param name the user group's name
202            * @param description the the user group's description
203            * @param serviceContext the service context to be applied (optionally
204            <code>null</code>). Can set expando bridge attributes for the
205            user group.
206            * @return the user group
207            */
208            public UserGroup updateUserGroup(long userGroupId, java.lang.String name,
209                    java.lang.String description,
210                    com.liferay.portal.service.ServiceContext serviceContext)
211                    throws PortalException;
212    }