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