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