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.kernel.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.model.UserGroup;
023    import com.liferay.portal.kernel.security.access.control.AccessControlled;
024    import com.liferay.portal.kernel.transaction.Isolation;
025    import com.liferay.portal.kernel.transaction.Propagation;
026    import com.liferay.portal.kernel.transaction.Transactional;
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 a user group.
055            *
056            * <p>
057            * This method handles the creation and bookkeeping of the user group,
058            * including its resources, metadata, and internal data structures.
059            * </p>
060            *
061            * @param name the user group's name
062            * @param description the user group's description
063            * @return the user group
064            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String,
065            ServiceContext)}
066            */
067            @java.lang.Deprecated
068            public UserGroup addUserGroup(java.lang.String name,
069                    java.lang.String description) 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            * @param serviceContext the service context to be applied (optionally
082            <code>null</code>). Can set expando bridge attributes for the
083            user group.
084            * @return the user group
085            */
086            public UserGroup addUserGroup(java.lang.String name,
087                    java.lang.String description, ServiceContext serviceContext)
088                    throws PortalException;
089    
090            /**
091            * Fetches the user group with the primary key.
092            *
093            * @param userGroupId the primary key of the user group
094            * @return the user group with the primary key
095            */
096            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
097            public UserGroup fetchUserGroup(long userGroupId) throws PortalException;
098    
099            /**
100            * Returns the user group with the name.
101            *
102            * @param name the user group's name
103            * @return the user group with the name
104            */
105            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
106            public UserGroup getUserGroup(java.lang.String name)
107                    throws PortalException;
108    
109            /**
110            * Returns the user group with the primary key.
111            *
112            * @param userGroupId the primary key of the user group
113            * @return the user group with the primary key
114            */
115            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116            public UserGroup getUserGroup(long userGroupId) throws PortalException;
117    
118            /**
119            * Updates the user group.
120            *
121            * @param userGroupId the primary key of the user group
122            * @param name the user group's name
123            * @param description the the user group's description
124            * @return the user group
125            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long,
126            String, String, ServiceContext)}
127            */
128            @java.lang.Deprecated
129            public UserGroup updateUserGroup(long userGroupId, java.lang.String name,
130                    java.lang.String description) throws PortalException;
131    
132            /**
133            * Updates the user group.
134            *
135            * @param userGroupId the primary key of the user group
136            * @param name the user group's name
137            * @param description the the user group's description
138            * @param serviceContext the service context to be applied (optionally
139            <code>null</code>). Can set expando bridge attributes for the
140            user group.
141            * @return the user group
142            */
143            public UserGroup updateUserGroup(long userGroupId, java.lang.String name,
144                    java.lang.String description, ServiceContext serviceContext)
145                    throws PortalException;
146    
147            /**
148            * Returns the OSGi service identifier.
149            *
150            * @return the OSGi service identifier
151            */
152            public java.lang.String getOSGiServiceIdentifier();
153    
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public List<UserGroup> getUserGroups(long companyId)
156                    throws PortalException;
157    
158            /**
159            * Returns all the user groups to which the user belongs.
160            *
161            * @param userId the primary key of the user
162            * @return the user groups to which the user belongs
163            */
164            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165            public List<UserGroup> getUserUserGroups(long userId)
166                    throws PortalException;
167    
168            /**
169            * Adds the user groups to the group.
170            *
171            * @param groupId the primary key of the group
172            * @param userGroupIds the primary keys of the user groups
173            */
174            public void addGroupUserGroups(long groupId, long[] userGroupIds)
175                    throws PortalException;
176    
177            /**
178            * Adds the user groups to the team
179            *
180            * @param teamId the primary key of the team
181            * @param userGroupIds the primary keys of the user groups
182            */
183            public void addTeamUserGroups(long teamId, long[] userGroupIds)
184                    throws PortalException;
185    
186            /**
187            * Deletes the user group.
188            *
189            * @param userGroupId the primary key of the user group
190            */
191            public void deleteUserGroup(long userGroupId) throws PortalException;
192    
193            /**
194            * Removes the user groups from the group.
195            *
196            * @param groupId the primary key of the group
197            * @param userGroupIds the primary keys of the user groups
198            */
199            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
200                    throws PortalException;
201    
202            /**
203            * Removes the user groups from the team.
204            *
205            * @param teamId the primary key of the team
206            * @param userGroupIds the primary keys of the user groups
207            */
208            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
209                    throws PortalException;
210    }