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