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.portlet.social.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.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    import com.liferay.portal.service.BaseLocalService;
026    import com.liferay.portal.service.PersistedModelLocalService;
027    
028    /**
029     * Provides the local service interface for SocialRequest. Methods of this
030     * service will not have security checks based on the propagated JAAS
031     * credentials because this service can only be accessed from within the same
032     * VM.
033     *
034     * @author Brian Wing Shun Chan
035     * @see SocialRequestLocalServiceUtil
036     * @see com.liferay.portlet.social.service.base.SocialRequestLocalServiceBaseImpl
037     * @see com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl
038     * @generated
039     */
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface SocialRequestLocalService extends BaseLocalService,
044            PersistedModelLocalService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link SocialRequestLocalServiceUtil} to access the social request local service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialRequestLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050    
051            /**
052            * Adds a social request to the database.
053            *
054            * <p>
055            * In order to add a social request, both the requesting user and the
056            * receiving user must be from the same company and neither of them can be
057            * the default user.
058            * </p>
059            *
060            * @param userId the primary key of the requesting user
061            * @param groupId the primary key of the group
062            * @param className the class name of the asset that is the subject of the
063            request
064            * @param classPK the primary key of the asset that is the subject of the
065            request
066            * @param type the request's type
067            * @param extraData the extra data regarding the request
068            * @param receiverUserId the primary key of the user receiving the request
069            * @return the social request
070            * @throws PortalException if the users could not be found, if the users
071            were not from the same company, or if either of the users was the
072            default user
073            */
074            public com.liferay.portlet.social.model.SocialRequest addRequest(
075                    long userId, long groupId, java.lang.String className, long classPK,
076                    int type, java.lang.String extraData, long receiverUserId)
077                    throws PortalException;
078    
079            /**
080            * Adds the social request to the database. Also notifies the appropriate model listeners.
081            *
082            * @param socialRequest the social request
083            * @return the social request that was added
084            */
085            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
086            public com.liferay.portlet.social.model.SocialRequest addSocialRequest(
087                    com.liferay.portlet.social.model.SocialRequest socialRequest);
088    
089            /**
090            * Creates a new social request with the primary key. Does not add the social request to the database.
091            *
092            * @param requestId the primary key for the new social request
093            * @return the new social request
094            */
095            public com.liferay.portlet.social.model.SocialRequest createSocialRequest(
096                    long requestId);
097    
098            /**
099            * @throws PortalException
100            */
101            @Override
102            public com.liferay.portal.model.PersistedModel deletePersistedModel(
103                    com.liferay.portal.model.PersistedModel persistedModel)
104                    throws PortalException;
105    
106            /**
107            * Removes all the social requests for the receiving user.
108            *
109            * @param receiverUserId the primary key of the receiving user
110            */
111            public void deleteReceiverUserRequests(long receiverUserId);
112    
113            /**
114            * Removes the social request from the database.
115            *
116            * @param request the social request to be removed
117            */
118            public void deleteRequest(
119                    com.liferay.portlet.social.model.SocialRequest request);
120    
121            /**
122            * Removes the social request identified by its primary key from the
123            * database.
124            *
125            * @param requestId the primary key of the social request
126            * @throws PortalException if the social request could not be found
127            */
128            public void deleteRequest(long requestId) throws PortalException;
129    
130            public void deleteRequests(long className, long classPK);
131    
132            /**
133            * Deletes the social request with the primary key from the database. Also notifies the appropriate model listeners.
134            *
135            * @param requestId the primary key of the social request
136            * @return the social request that was removed
137            * @throws PortalException if a social request with the primary key could not be found
138            */
139            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
140            public com.liferay.portlet.social.model.SocialRequest deleteSocialRequest(
141                    long requestId) throws PortalException;
142    
143            /**
144            * Deletes the social request from the database. Also notifies the appropriate model listeners.
145            *
146            * @param socialRequest the social request
147            * @return the social request that was removed
148            */
149            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
150            public com.liferay.portlet.social.model.SocialRequest deleteSocialRequest(
151                    com.liferay.portlet.social.model.SocialRequest socialRequest);
152    
153            /**
154            * Removes all the social requests for the requesting user.
155            *
156            * @param userId the primary key of the requesting user
157            */
158            public void deleteUserRequests(long userId);
159    
160            public com.liferay.portal.kernel.dao.orm.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> java.util.List<T> dynamicQuery(
169                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
170    
171            /**
172            * Performs a dynamic query on the database and returns a range of the matching rows.
173            *
174            * <p>
175            * 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.portlet.social.model.impl.SocialRequestModelImpl}. 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.
176            * </p>
177            *
178            * @param dynamicQuery the dynamic query
179            * @param start the lower bound of the range of model instances
180            * @param end the upper bound of the range of model instances (not inclusive)
181            * @return the range of matching rows
182            */
183            public <T> java.util.List<T> dynamicQuery(
184                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
185                    int end);
186    
187            /**
188            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
189            *
190            * <p>
191            * 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.portlet.social.model.impl.SocialRequestModelImpl}. 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.
192            * </p>
193            *
194            * @param dynamicQuery the dynamic query
195            * @param start the lower bound of the range of model instances
196            * @param end the upper bound of the range of model instances (not inclusive)
197            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
198            * @return the ordered range of matching rows
199            */
200            public <T> java.util.List<T> dynamicQuery(
201                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
202                    int end,
203                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
204    
205            /**
206            * Returns the number of rows matching the dynamic query.
207            *
208            * @param dynamicQuery the dynamic query
209            * @return the number of rows matching the dynamic query
210            */
211            public long dynamicQueryCount(
212                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
213    
214            /**
215            * Returns the number of rows matching the dynamic query.
216            *
217            * @param dynamicQuery the dynamic query
218            * @param projection the projection to apply to the query
219            * @return the number of rows matching the dynamic query
220            */
221            public long dynamicQueryCount(
222                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
223                    com.liferay.portal.kernel.dao.orm.Projection projection);
224    
225            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
226            public com.liferay.portlet.social.model.SocialRequest fetchSocialRequest(
227                    long requestId);
228    
229            /**
230            * Returns the social request matching the UUID and group.
231            *
232            * @param uuid the social request's UUID
233            * @param groupId the primary key of the group
234            * @return the matching social request, or <code>null</code> if a matching social request could not be found
235            */
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public com.liferay.portlet.social.model.SocialRequest fetchSocialRequestByUuidAndGroupId(
238                    java.lang.String uuid, long groupId);
239    
240            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
242    
243            /**
244            * Returns the Spring bean ID for this bean.
245            *
246            * @return the Spring bean ID for this bean
247            */
248            public java.lang.String getBeanIdentifier();
249    
250            @Override
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public com.liferay.portal.model.PersistedModel getPersistedModel(
253                    java.io.Serializable primaryKeyObj) throws PortalException;
254    
255            /**
256            * Returns a range of all the social requests for the receiving user.
257            *
258            * <p>
259            * Useful when paginating results. Returns a maximum of <code>end -
260            * start</code> instances. <code>start</code> and <code>end</code> are not
261            * primary keys, they are indexes in the result set. Thus, <code>0</code>
262            * refers to the first result in the set. Setting both <code>start</code>
263            * and <code>end</code> to {@link
264            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
265            * result set.
266            * </p>
267            *
268            * @param receiverUserId the primary key of the receiving user
269            * @param start the lower bound of the range of results
270            * @param end the upper bound of the range of results (not inclusive)
271            * @return the range of matching social requests
272            */
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests(
275                    long receiverUserId, int start, int end);
276    
277            /**
278            * Returns a range of all the social requests with the given status for the
279            * receiving user.
280            *
281            * <p>
282            * Useful when paginating results. Returns a maximum of <code>end -
283            * start</code> instances. <code>start</code> and <code>end</code> are not
284            * primary keys, they are indexes in the result set. Thus, <code>0</code>
285            * refers to the first result in the set. Setting both <code>start</code>
286            * and <code>end</code> to {@link
287            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
288            * result set.
289            * </p>
290            *
291            * @param receiverUserId the primary key of the receiving user
292            * @param status the social request's status
293            * @param start the lower bound of the range of results
294            * @param end the upper bound of the range of results (not inclusive)
295            * @return the range of matching social requests
296            */
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests(
299                    long receiverUserId, int status, int start, int end);
300    
301            /**
302            * Returns the number of social requests for the receiving user.
303            *
304            * @param receiverUserId the primary key of the receiving user
305            * @return the number of matching social requests
306            */
307            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
308            public int getReceiverUserRequestsCount(long receiverUserId);
309    
310            /**
311            * Returns the number of social requests with the given status for the
312            * receiving user.
313            *
314            * @param receiverUserId the primary key of the receiving user
315            * @param status the social request's status
316            * @return the number of matching social requests
317            */
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public int getReceiverUserRequestsCount(long receiverUserId, int status);
320    
321            /**
322            * Returns the social request with the primary key.
323            *
324            * @param requestId the primary key of the social request
325            * @return the social request
326            * @throws PortalException if a social request with the primary key could not be found
327            */
328            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
329            public com.liferay.portlet.social.model.SocialRequest getSocialRequest(
330                    long requestId) throws PortalException;
331    
332            /**
333            * Returns the social request matching the UUID and group.
334            *
335            * @param uuid the social request's UUID
336            * @param groupId the primary key of the group
337            * @return the matching social request
338            * @throws PortalException if a matching social request could not be found
339            */
340            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
341            public com.liferay.portlet.social.model.SocialRequest getSocialRequestByUuidAndGroupId(
342                    java.lang.String uuid, long groupId) throws PortalException;
343    
344            /**
345            * Returns a range of all the social requests.
346            *
347            * <p>
348            * 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.portlet.social.model.impl.SocialRequestModelImpl}. 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.
349            * </p>
350            *
351            * @param start the lower bound of the range of social requests
352            * @param end the upper bound of the range of social requests (not inclusive)
353            * @return the range of social requests
354            */
355            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
356            public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequests(
357                    int start, int end);
358    
359            /**
360            * Returns all the social requests matching the UUID and company.
361            *
362            * @param uuid the UUID of the social requests
363            * @param companyId the primary key of the company
364            * @return the matching social requests, or an empty list if no matches were found
365            */
366            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
367            public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId(
368                    java.lang.String uuid, long companyId);
369    
370            /**
371            * Returns a range of social requests matching the UUID and company.
372            *
373            * @param uuid the UUID of the social requests
374            * @param companyId the primary key of the company
375            * @param start the lower bound of the range of social requests
376            * @param end the upper bound of the range of social requests (not inclusive)
377            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
378            * @return the range of matching social requests, or an empty list if no matches were found
379            */
380            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
381            public java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId(
382                    java.lang.String uuid, long companyId, int start, int end,
383                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.social.model.SocialRequest> orderByComparator);
384    
385            /**
386            * Returns the number of social requests.
387            *
388            * @return the number of social requests
389            */
390            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391            public int getSocialRequestsCount();
392    
393            /**
394            * Returns a range of all the social requests for the requesting user.
395            *
396            * <p>
397            * Useful when paginating results. Returns a maximum of <code>end -
398            * start</code> instances. <code>start</code> and <code>end</code> are not
399            * primary keys, they are indexes in the result set. Thus, <code>0</code>
400            * refers to the first result in the set. Setting both <code>start</code>
401            * and <code>end</code> to {@link
402            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
403            * result set.
404            * </p>
405            *
406            * @param userId the primary key of the requesting user
407            * @param start the lower bound of the range of results
408            * @param end the upper bound of the range of results (not inclusive)
409            * @return the range of matching social requests
410            */
411            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
412            public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests(
413                    long userId, int start, int end);
414    
415            /**
416            * Returns a range of all the social requests with the given status for the
417            * requesting user.
418            *
419            * <p>
420            * Useful when paginating results. Returns a maximum of <code>end -
421            * start</code> instances. <code>start</code> and <code>end</code> are not
422            * primary keys, they are indexes in the result set. Thus, <code>0</code>
423            * refers to the first result in the set. Setting both <code>start</code>
424            * and <code>end</code> to {@link
425            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
426            * result set.
427            * </p>
428            *
429            * @param userId the primary key of the requesting user
430            * @param status the social request's status
431            * @param start the lower bound of the range of results
432            * @param end the upper bound of the range of results (not inclusive)
433            * @return the range of matching social requests
434            */
435            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
436            public java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests(
437                    long userId, int status, int start, int end);
438    
439            /**
440            * Returns the number of social requests for the requesting user.
441            *
442            * @param userId the primary key of the requesting user
443            * @return the number of matching social requests
444            */
445            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
446            public int getUserRequestsCount(long userId);
447    
448            /**
449            * Returns the number of social requests with the given status for the
450            * requesting user.
451            *
452            * @param userId the primary key of the requesting user
453            * @param status the social request's status
454            * @return the number of matching social request
455            */
456            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
457            public int getUserRequestsCount(long userId, int status);
458    
459            /**
460            * Returns <code>true</code> if a matching social request exists in the
461            * database.
462            *
463            * @param userId the primary key of the requesting user
464            * @param className the class name of the asset that is the subject of the
465            request
466            * @param classPK the primary key of the asset that is the subject of the
467            request
468            * @param type the request's type
469            * @param receiverUserId the primary key of the receiving user
470            * @param status the social request's status
471            * @return <code>true</code> if the social request exists;
472            <code>false</code> otherwise
473            */
474            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
475            public boolean hasRequest(long userId, java.lang.String className,
476                    long classPK, int type, long receiverUserId, int status);
477    
478            /**
479            * Returns <code>true</code> if a matching social requests exists in the
480            * database.
481            *
482            * @param userId the primary key of the requesting user
483            * @param className the class name of the asset that is the subject of the
484            request
485            * @param classPK the primary key of the asset that is the subject of the
486            request
487            * @param type the request's type
488            * @param status the social request's status
489            * @return <code>true</code> if the request exists; <code>false</code>
490            otherwise
491            */
492            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
493            public boolean hasRequest(long userId, java.lang.String className,
494                    long classPK, int type, int status);
495    
496            /**
497            * Sets the Spring bean ID for this bean.
498            *
499            * @param beanIdentifier the Spring bean ID for this bean
500            */
501            public void setBeanIdentifier(java.lang.String beanIdentifier);
502    
503            /**
504            * Updates the social request replacing its status.
505            *
506            * <p>
507            * If the status is updated to {@link
508            * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_CONFIRM}
509            * then {@link
510            * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation(
511            * SocialRequest, ThemeDisplay)} is called. If the status is updated to
512            * {@link
513            * com.liferay.portlet.social.model.SocialRequestConstants#STATUS_IGNORE}
514            * then {@link
515            * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection(
516            * SocialRequest, ThemeDisplay)} is called.
517            * </p>
518            *
519            * @param requestId the primary key of the social request
520            * @param status the new status
521            * @param themeDisplay the theme display
522            * @return the updated social request
523            * @throws PortalException if the social request could not be found
524            */
525            public com.liferay.portlet.social.model.SocialRequest updateRequest(
526                    long requestId, int status,
527                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
528                    throws PortalException;
529    
530            /**
531            * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
532            *
533            * @param socialRequest the social request
534            * @return the social request that was updated
535            */
536            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
537            public com.liferay.portlet.social.model.SocialRequest updateSocialRequest(
538                    com.liferay.portlet.social.model.SocialRequest socialRequest);
539    }