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.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.transaction.Isolation;
029    import com.liferay.portal.kernel.transaction.Propagation;
030    import com.liferay.portal.kernel.transaction.Transactional;
031    import com.liferay.portal.kernel.util.OrderByComparator;
032    import com.liferay.portal.model.PersistedModel;
033    import com.liferay.portal.model.Team;
034    
035    import com.liferay.portlet.exportimport.lar.PortletDataContext;
036    
037    import java.io.Serializable;
038    
039    import java.util.LinkedHashMap;
040    import java.util.List;
041    
042    /**
043     * Provides the local service interface for Team. Methods of this
044     * service will not have security checks based on the propagated JAAS
045     * credentials because this service can only be accessed from within the same
046     * VM.
047     *
048     * @author Brian Wing Shun Chan
049     * @see TeamLocalServiceUtil
050     * @see com.liferay.portal.service.base.TeamLocalServiceBaseImpl
051     * @see com.liferay.portal.service.impl.TeamLocalServiceImpl
052     * @generated
053     */
054    @ProviderType
055    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
056            PortalException.class, SystemException.class})
057    public interface TeamLocalService extends BaseLocalService,
058            PersistedModelLocalService {
059            /*
060             * NOTE FOR DEVELOPERS:
061             *
062             * Never modify or reference this interface directly. Always use {@link TeamLocalServiceUtil} to access the team local service. Add custom service methods to {@link com.liferay.portal.service.impl.TeamLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
063             */
064    
065            /**
066            * Adds the team to the database. Also notifies the appropriate model listeners.
067            *
068            * @param team the team
069            * @return the team that was added
070            */
071            @Indexable(type = IndexableType.REINDEX)
072            public Team addTeam(Team team);
073    
074            /**
075            * @deprecated As of 7.0.0, replaced by {@link #addTeam(long, long, String,
076            String, ServiceContext)}
077            */
078            @java.lang.Deprecated
079            public Team addTeam(long userId, long groupId, java.lang.String name,
080                    java.lang.String description) throws PortalException;
081    
082            public Team addTeam(long userId, long groupId, java.lang.String name,
083                    java.lang.String description,
084                    com.liferay.portal.service.ServiceContext serviceContext)
085                    throws PortalException;
086    
087            public void addUserGroupTeam(long userGroupId, Team team);
088    
089            public void addUserGroupTeam(long userGroupId, long teamId);
090    
091            public void addUserGroupTeams(long userGroupId, List<Team> Teams);
092    
093            public void addUserGroupTeams(long userGroupId, long[] teamIds);
094    
095            public void addUserTeam(long userId, Team team);
096    
097            public void addUserTeam(long userId, long teamId);
098    
099            public void addUserTeams(long userId, List<Team> Teams);
100    
101            public void addUserTeams(long userId, long[] teamIds);
102    
103            public void clearUserGroupTeams(long userGroupId);
104    
105            public void clearUserTeams(long userId);
106    
107            /**
108            * Creates a new team with the primary key. Does not add the team to the database.
109            *
110            * @param teamId the primary key for the new team
111            * @return the new team
112            */
113            public Team createTeam(long teamId);
114    
115            /**
116            * @throws PortalException
117            */
118            @Override
119            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
120                    throws PortalException;
121    
122            /**
123            * Deletes the team from the database. Also notifies the appropriate model listeners.
124            *
125            * @param team the team
126            * @return the team that was removed
127            * @throws PortalException
128            */
129            @Indexable(type = IndexableType.DELETE)
130            public Team deleteTeam(Team team) throws PortalException;
131    
132            /**
133            * Deletes the team with the primary key from the database. Also notifies the appropriate model listeners.
134            *
135            * @param teamId the primary key of the team
136            * @return the team that was removed
137            * @throws PortalException if a team with the primary key could not be found
138            */
139            @Indexable(type = IndexableType.DELETE)
140            public Team deleteTeam(long teamId) throws PortalException;
141    
142            public void deleteTeams(long groupId) throws PortalException;
143    
144            public void deleteUserGroupTeam(long userGroupId, Team team);
145    
146            public void deleteUserGroupTeam(long userGroupId, long teamId);
147    
148            public void deleteUserGroupTeams(long userGroupId, List<Team> Teams);
149    
150            public void deleteUserGroupTeams(long userGroupId, long[] teamIds);
151    
152            public void deleteUserTeam(long userId, Team team);
153    
154            public void deleteUserTeam(long userId, long teamId);
155    
156            public void deleteUserTeams(long userId, List<Team> Teams);
157    
158            public void deleteUserTeams(long userId, long[] teamIds);
159    
160            public DynamicQuery dynamicQuery();
161    
162            /**
163            * Performs a dynamic query on the database and returns the matching rows.
164            *
165            * @param dynamicQuery the dynamic query
166            * @return the matching rows
167            */
168            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
169    
170            /**
171            * Performs a dynamic query on the database and returns a range of the matching rows.
172            *
173            * <p>
174            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TeamModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
175            * </p>
176            *
177            * @param dynamicQuery the dynamic query
178            * @param start the lower bound of the range of model instances
179            * @param end the upper bound of the range of model instances (not inclusive)
180            * @return the range of matching rows
181            */
182            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
183                    int end);
184    
185            /**
186            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
187            *
188            * <p>
189            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TeamModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
190            * </p>
191            *
192            * @param dynamicQuery the dynamic query
193            * @param start the lower bound of the range of model instances
194            * @param end the upper bound of the range of model instances (not inclusive)
195            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
196            * @return the ordered range of matching rows
197            */
198            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
199                    int end, OrderByComparator<T> orderByComparator);
200    
201            /**
202            * Returns the number of rows matching the dynamic query.
203            *
204            * @param dynamicQuery the dynamic query
205            * @return the number of rows matching the dynamic query
206            */
207            public long dynamicQueryCount(DynamicQuery dynamicQuery);
208    
209            /**
210            * Returns the number of rows matching the dynamic query.
211            *
212            * @param dynamicQuery the dynamic query
213            * @param projection the projection to apply to the query
214            * @return the number of rows matching the dynamic query
215            */
216            public long dynamicQueryCount(DynamicQuery dynamicQuery,
217                    Projection projection);
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public Team fetchTeam(long groupId, java.lang.String name);
221    
222            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
223            public Team fetchTeam(long teamId);
224    
225            /**
226            * Returns the team matching the UUID and group.
227            *
228            * @param uuid the team's UUID
229            * @param groupId the primary key of the group
230            * @return the matching team, or <code>null</code> if a matching team could not be found
231            */
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public Team fetchTeamByUuidAndGroupId(java.lang.String uuid, long groupId);
234    
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public ActionableDynamicQuery getActionableDynamicQuery();
237    
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
240                    PortletDataContext portletDataContext);
241    
242            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
243            public List<Team> getGroupTeams(long groupId);
244    
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
247    
248            /**
249            * Returns the OSGi service identifier.
250            *
251            * @return the OSGi service identifier
252            */
253            public java.lang.String getOSGiServiceIdentifier();
254    
255            @Override
256            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
257            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
258                    throws PortalException;
259    
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public Team getTeam(long groupId, java.lang.String name)
262                    throws PortalException;
263    
264            /**
265            * Returns the team with the primary key.
266            *
267            * @param teamId the primary key of the team
268            * @return the team
269            * @throws PortalException if a team with the primary key could not be found
270            */
271            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272            public Team getTeam(long teamId) throws PortalException;
273    
274            /**
275            * Returns the team matching the UUID and group.
276            *
277            * @param uuid the team's UUID
278            * @param groupId the primary key of the group
279            * @return the matching team
280            * @throws PortalException if a matching team could not be found
281            */
282            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
283            public Team getTeamByUuidAndGroupId(java.lang.String uuid, long groupId)
284                    throws PortalException;
285    
286            /**
287            * Returns a range of all the teams.
288            *
289            * <p>
290            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.TeamModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
291            * </p>
292            *
293            * @param start the lower bound of the range of teams
294            * @param end the upper bound of the range of teams (not inclusive)
295            * @return the range of teams
296            */
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public List<Team> getTeams(int start, int end);
299    
300            /**
301            * Returns all the teams matching the UUID and company.
302            *
303            * @param uuid the UUID of the teams
304            * @param companyId the primary key of the company
305            * @return the matching teams, or an empty list if no matches were found
306            */
307            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
308            public List<Team> getTeamsByUuidAndCompanyId(java.lang.String uuid,
309                    long companyId);
310    
311            /**
312            * Returns a range of teams matching the UUID and company.
313            *
314            * @param uuid the UUID of the teams
315            * @param companyId the primary key of the company
316            * @param start the lower bound of the range of teams
317            * @param end the upper bound of the range of teams (not inclusive)
318            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
319            * @return the range of matching teams, or an empty list if no matches were found
320            */
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public List<Team> getTeamsByUuidAndCompanyId(java.lang.String uuid,
323                    long companyId, int start, int end,
324                    OrderByComparator<Team> orderByComparator);
325    
326            /**
327            * Returns the number of teams.
328            *
329            * @return the number of teams
330            */
331            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
332            public int getTeamsCount();
333    
334            /**
335            * Returns the userGroupIds of the user groups associated with the team.
336            *
337            * @param teamId the teamId of the team
338            * @return long[] the userGroupIds of user groups associated with the team
339            */
340            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
341            public long[] getUserGroupPrimaryKeys(long teamId);
342    
343            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
344            public List<Team> getUserGroupTeams(long userGroupId);
345    
346            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
347            public List<Team> getUserGroupTeams(long userGroupId, int start, int end);
348    
349            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
350            public List<Team> getUserGroupTeams(long userGroupId, int start, int end,
351                    OrderByComparator<Team> orderByComparator);
352    
353            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
354            public int getUserGroupTeamsCount(long userGroupId);
355    
356            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357            public List<Team> getUserOrUserGroupTeams(long groupId, long userId);
358    
359            /**
360            * Returns the userIds of the users associated with the team.
361            *
362            * @param teamId the teamId of the team
363            * @return long[] the userIds of users associated with the team
364            */
365            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
366            public long[] getUserPrimaryKeys(long teamId);
367    
368            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
369            public List<Team> getUserTeams(long userId);
370    
371            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
372            public List<Team> getUserTeams(long userId, long groupId);
373    
374            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
375            public List<Team> getUserTeams(long userId, int start, int end);
376    
377            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
378            public List<Team> getUserTeams(long userId, int start, int end,
379                    OrderByComparator<Team> orderByComparator);
380    
381            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
382            public int getUserTeamsCount(long userId);
383    
384            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
385            public boolean hasUserGroupTeam(long userGroupId, long teamId);
386    
387            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
388            public boolean hasUserGroupTeams(long userGroupId);
389    
390            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391            public boolean hasUserTeam(long userId, long teamId);
392    
393            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
394            public boolean hasUserTeams(long userId);
395    
396            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
397            public List<Team> search(long groupId, java.lang.String name,
398                    java.lang.String description,
399                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
400                    int end, OrderByComparator<Team> obc);
401    
402            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
403            public int searchCount(long groupId, java.lang.String name,
404                    java.lang.String description,
405                    LinkedHashMap<java.lang.String, java.lang.Object> params);
406    
407            public void setUserGroupTeams(long userGroupId, long[] teamIds);
408    
409            public void setUserTeams(long userId, long[] teamIds);
410    
411            /**
412            * Updates the team in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
413            *
414            * @param team the team
415            * @return the team that was updated
416            */
417            @Indexable(type = IndexableType.REINDEX)
418            public Team updateTeam(Team team);
419    
420            public Team updateTeam(long teamId, java.lang.String name,
421                    java.lang.String description) throws PortalException;
422    }