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    
027    /**
028     * Provides the remote service interface for UserGroup. Methods of this
029     * service are expected to have security checks based on the propagated JAAS
030     * credentials because this service can be accessed remotely.
031     *
032     * @author Brian Wing Shun Chan
033     * @see UserGroupServiceUtil
034     * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl
035     * @see com.liferay.portal.service.impl.UserGroupServiceImpl
036     * @generated
037     */
038    @AccessControlled
039    @JSONWebService
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface UserGroupService extends BaseService {
044            /*
045             * NOTE FOR DEVELOPERS:
046             *
047             * 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.
048             */
049    
050            /**
051            * Adds the user groups to the group.
052            *
053            * @param groupId the primary key of the group
054            * @param userGroupIds the primary keys of the user groups
055            */
056            public void addGroupUserGroups(long groupId, long[] userGroupIds)
057                    throws PortalException;
058    
059            /**
060            * Adds the user groups to the team
061            *
062            * @param teamId the primary key of the team
063            * @param userGroupIds the primary keys of the user groups
064            */
065            public void addTeamUserGroups(long teamId, long[] userGroupIds)
066                    throws PortalException;
067    
068            /**
069            * Adds a user group.
070            *
071            * <p>
072            * This method handles the creation and bookkeeping of the user group,
073            * including its resources, metadata, and internal data structures.
074            * </p>
075            *
076            * @param name the user group's name
077            * @param description the user group's description
078            * @return the user group
079            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String,
080            ServiceContext)}
081            */
082            @java.lang.Deprecated
083            public com.liferay.portal.model.UserGroup addUserGroup(
084                    java.lang.String name, java.lang.String description)
085                    throws PortalException;
086    
087            /**
088            * Adds a user group.
089            *
090            * <p>
091            * This method handles the creation and bookkeeping of the user group,
092            * including its resources, metadata, and internal data structures.
093            * </p>
094            *
095            * @param name the user group's name
096            * @param description the user group's description
097            * @param serviceContext the service context to be applied (optionally
098            <code>null</code>). Can set expando bridge attributes for the
099            user group.
100            * @return the user group
101            */
102            public com.liferay.portal.model.UserGroup addUserGroup(
103                    java.lang.String name, java.lang.String description,
104                    com.liferay.portal.service.ServiceContext serviceContext)
105                    throws PortalException;
106    
107            /**
108            * Deletes the user group.
109            *
110            * @param userGroupId the primary key of the user group
111            */
112            public void deleteUserGroup(long userGroupId) throws PortalException;
113    
114            /**
115            * Fetches the user group with the primary key.
116            *
117            * @param userGroupId the primary key of the user group
118            * @return the user group with the primary key
119            */
120            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
121            public com.liferay.portal.model.UserGroup fetchUserGroup(long userGroupId)
122                    throws PortalException;
123    
124            /**
125            * Returns the OSGi service identifier.
126            *
127            * @return the OSGi service identifier
128            */
129            public java.lang.String getOSGiServiceIdentifier();
130    
131            /**
132            * Returns the user group with the name.
133            *
134            * @param name the user group's name
135            * @return the user group with the name
136            */
137            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138            public com.liferay.portal.model.UserGroup getUserGroup(
139                    java.lang.String name) throws PortalException;
140    
141            /**
142            * Returns the user group with the primary key.
143            *
144            * @param userGroupId the primary key of the user group
145            * @return the user group with the primary key
146            */
147            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
149                    throws PortalException;
150    
151            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
152            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
153                    long companyId) 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 java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
163                    long userId) 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 com.liferay.portal.model.UserGroup updateUserGroup(
195                    long userGroupId, java.lang.String name, java.lang.String description)
196                    throws PortalException;
197    
198            /**
199            * Updates the user group.
200            *
201            * @param userGroupId the primary key of the user group
202            * @param name the user group's name
203            * @param description the the user group's description
204            * @param serviceContext the service context to be applied (optionally
205            <code>null</code>). Can set expando bridge attributes for the
206            user group.
207            * @return the user group
208            */
209            public com.liferay.portal.model.UserGroup updateUserGroup(
210                    long userGroupId, java.lang.String name, java.lang.String description,
211                    com.liferay.portal.service.ServiceContext serviceContext)
212                    throws PortalException;
213    }