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            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
271                    return getService().getIndexableActionableDynamicQuery();
272            }
273    
274            /**
275            * Returns the OSGi service identifier.
276            *
277            * @return the OSGi service identifier
278            */
279            public static java.lang.String getOSGiServiceIdentifier() {
280                    return getService().getOSGiServiceIdentifier();
281            }
282    
283            public static com.liferay.portal.model.PersistedModel getPersistedModel(
284                    java.io.Serializable primaryKeyObj)
285                    throws com.liferay.portal.kernel.exception.PortalException {
286                    return getService().getPersistedModel(primaryKeyObj);
287            }
288    
289            /**
290            * Returns a range of all the social requests for the receiving user.
291            *
292            * <p>
293            * Useful when paginating results. Returns a maximum of <code>end -
294            * start</code> instances. <code>start</code> and <code>end</code> are not
295            * primary keys, they are indexes in the result set. Thus, <code>0</code>
296            * refers to the first result in the set. Setting both <code>start</code>
297            * and <code>end</code> to {@link
298            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
299            * result set.
300            * </p>
301            *
302            * @param receiverUserId the primary key of the receiving user
303            * @param start the lower bound of the range of results
304            * @param end the upper bound of the range of results (not inclusive)
305            * @return the range of matching social requests
306            */
307            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests(
308                    long receiverUserId, int start, int end) {
309                    return getService().getReceiverUserRequests(receiverUserId, start, end);
310            }
311    
312            /**
313            * Returns a range of all the social requests with the given status for the
314            * receiving user.
315            *
316            * <p>
317            * Useful when paginating results. Returns a maximum of <code>end -
318            * start</code> instances. <code>start</code> and <code>end</code> are not
319            * primary keys, they are indexes in the result set. Thus, <code>0</code>
320            * refers to the first result in the set. Setting both <code>start</code>
321            * and <code>end</code> to {@link
322            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
323            * result set.
324            * </p>
325            *
326            * @param receiverUserId the primary key of the receiving user
327            * @param status the social request's status
328            * @param start the lower bound of the range of results
329            * @param end the upper bound of the range of results (not inclusive)
330            * @return the range of matching social requests
331            */
332            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getReceiverUserRequests(
333                    long receiverUserId, int status, int start, int end) {
334                    return getService()
335                                       .getReceiverUserRequests(receiverUserId, status, start, end);
336            }
337    
338            /**
339            * Returns the number of social requests for the receiving user.
340            *
341            * @param receiverUserId the primary key of the receiving user
342            * @return the number of matching social requests
343            */
344            public static int getReceiverUserRequestsCount(long receiverUserId) {
345                    return getService().getReceiverUserRequestsCount(receiverUserId);
346            }
347    
348            /**
349            * Returns the number of social requests with the given status for the
350            * receiving user.
351            *
352            * @param receiverUserId the primary key of the receiving user
353            * @param status the social request's status
354            * @return the number of matching social requests
355            */
356            public static int getReceiverUserRequestsCount(long receiverUserId,
357                    int status) {
358                    return getService().getReceiverUserRequestsCount(receiverUserId, status);
359            }
360    
361            /**
362            * Returns the social request with the primary key.
363            *
364            * @param requestId the primary key of the social request
365            * @return the social request
366            * @throws PortalException if a social request with the primary key could not be found
367            */
368            public static com.liferay.portlet.social.model.SocialRequest getSocialRequest(
369                    long requestId)
370                    throws com.liferay.portal.kernel.exception.PortalException {
371                    return getService().getSocialRequest(requestId);
372            }
373    
374            /**
375            * Returns the social request matching the UUID and group.
376            *
377            * @param uuid the social request's UUID
378            * @param groupId the primary key of the group
379            * @return the matching social request
380            * @throws PortalException if a matching social request could not be found
381            */
382            public static com.liferay.portlet.social.model.SocialRequest getSocialRequestByUuidAndGroupId(
383                    java.lang.String uuid, long groupId)
384                    throws com.liferay.portal.kernel.exception.PortalException {
385                    return getService().getSocialRequestByUuidAndGroupId(uuid, groupId);
386            }
387    
388            /**
389            * Returns a range of all the social requests.
390            *
391            * <p>
392            * 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.
393            * </p>
394            *
395            * @param start the lower bound of the range of social requests
396            * @param end the upper bound of the range of social requests (not inclusive)
397            * @return the range of social requests
398            */
399            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequests(
400                    int start, int end) {
401                    return getService().getSocialRequests(start, end);
402            }
403    
404            /**
405            * Returns all the social requests matching the UUID and company.
406            *
407            * @param uuid the UUID of the social requests
408            * @param companyId the primary key of the company
409            * @return the matching social requests, or an empty list if no matches were found
410            */
411            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId(
412                    java.lang.String uuid, long companyId) {
413                    return getService().getSocialRequestsByUuidAndCompanyId(uuid, companyId);
414            }
415    
416            /**
417            * Returns a range of social requests matching the UUID and company.
418            *
419            * @param uuid the UUID of the social requests
420            * @param companyId the primary key of the company
421            * @param start the lower bound of the range of social requests
422            * @param end the upper bound of the range of social requests (not inclusive)
423            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
424            * @return the range of matching social requests, or an empty list if no matches were found
425            */
426            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getSocialRequestsByUuidAndCompanyId(
427                    java.lang.String uuid, long companyId, int start, int end,
428                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.social.model.SocialRequest> orderByComparator) {
429                    return getService()
430                                       .getSocialRequestsByUuidAndCompanyId(uuid, companyId, start,
431                            end, orderByComparator);
432            }
433    
434            /**
435            * Returns the number of social requests.
436            *
437            * @return the number of social requests
438            */
439            public static int getSocialRequestsCount() {
440                    return getService().getSocialRequestsCount();
441            }
442    
443            /**
444            * Returns a range of all the social requests for the requesting user.
445            *
446            * <p>
447            * Useful when paginating results. Returns a maximum of <code>end -
448            * start</code> instances. <code>start</code> and <code>end</code> are not
449            * primary keys, they are indexes in the result set. Thus, <code>0</code>
450            * refers to the first result in the set. Setting both <code>start</code>
451            * and <code>end</code> to {@link
452            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
453            * result set.
454            * </p>
455            *
456            * @param userId the primary key of the requesting user
457            * @param start the lower bound of the range of results
458            * @param end the upper bound of the range of results (not inclusive)
459            * @return the range of matching social requests
460            */
461            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests(
462                    long userId, int start, int end) {
463                    return getService().getUserRequests(userId, start, end);
464            }
465    
466            /**
467            * Returns a range of all the social requests with the given status for the
468            * requesting user.
469            *
470            * <p>
471            * Useful when paginating results. Returns a maximum of <code>end -
472            * start</code> instances. <code>start</code> and <code>end</code> are not
473            * primary keys, they are indexes in the result set. Thus, <code>0</code>
474            * refers to the first result in the set. Setting both <code>start</code>
475            * and <code>end</code> to {@link
476            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
477            * result set.
478            * </p>
479            *
480            * @param userId the primary key of the requesting user
481            * @param status the social request's status
482            * @param start the lower bound of the range of results
483            * @param end the upper bound of the range of results (not inclusive)
484            * @return the range of matching social requests
485            */
486            public static java.util.List<com.liferay.portlet.social.model.SocialRequest> getUserRequests(
487                    long userId, int status, int start, int end) {
488                    return getService().getUserRequests(userId, status, start, end);
489            }
490    
491            /**
492            * Returns the number of social requests for the requesting user.
493            *
494            * @param userId the primary key of the requesting user
495            * @return the number of matching social requests
496            */
497            public static int getUserRequestsCount(long userId) {
498                    return getService().getUserRequestsCount(userId);
499            }
500    
501            /**
502            * Returns the number of social requests with the given status for the
503            * requesting user.
504            *
505            * @param userId the primary key of the requesting user
506            * @param status the social request's status
507            * @return the number of matching social request
508            */
509            public static int getUserRequestsCount(long userId, int status) {
510                    return getService().getUserRequestsCount(userId, status);
511            }
512    
513            /**
514            * Returns <code>true</code> if a matching social request exists in the
515            * database.
516            *
517            * @param userId the primary key of the requesting user
518            * @param className the class name of the asset that is the subject of the
519            request
520            * @param classPK the primary key of the asset that is the subject of the
521            request
522            * @param type the request's type
523            * @param receiverUserId the primary key of the receiving user
524            * @param status the social request's status
525            * @return <code>true</code> if the social request exists;
526            <code>false</code> otherwise
527            */
528            public static boolean hasRequest(long userId, java.lang.String className,
529                    long classPK, int type, long receiverUserId, int status) {
530                    return getService()
531                                       .hasRequest(userId, className, classPK, type,
532                            receiverUserId, status);
533            }
534    
535            /**
536            * Returns <code>true</code> if a matching social requests exists in the
537            * database.
538            *
539            * @param userId the primary key of the requesting user
540            * @param className the class name of the asset that is the subject of the
541            request
542            * @param classPK the primary key of the asset that is the subject of the
543            request
544            * @param type the request's type
545            * @param status the social request's status
546            * @return <code>true</code> if the request exists; <code>false</code>
547            otherwise
548            */
549            public static boolean hasRequest(long userId, java.lang.String className,
550                    long classPK, int type, int status) {
551                    return getService().hasRequest(userId, className, classPK, type, status);
552            }
553    
554            /**
555            * Updates the social request replacing its status.
556            *
557            * <p>
558            * If the status is updated to {@link SocialRequestConstants#STATUS_CONFIRM}
559            * then {@link
560            * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processConfirmation(
561            * SocialRequest, ThemeDisplay)} is called. If the status is updated to
562            * {@link SocialRequestConstants#STATUS_IGNORE} then {@link
563            * com.liferay.portlet.social.service.SocialRequestInterpreterLocalService#processRejection(
564            * SocialRequest, ThemeDisplay)} is called.
565            * </p>
566            *
567            * @param requestId the primary key of the social request
568            * @param status the new status
569            * @param themeDisplay the theme display
570            * @return the updated social request
571            */
572            public static com.liferay.portlet.social.model.SocialRequest updateRequest(
573                    long requestId, int status,
574                    com.liferay.portal.theme.ThemeDisplay themeDisplay)
575                    throws com.liferay.portal.kernel.exception.PortalException {
576                    return getService().updateRequest(requestId, status, themeDisplay);
577            }
578    
579            /**
580            * Updates the social request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
581            *
582            * @param socialRequest the social request
583            * @return the social request that was updated
584            */
585            public static com.liferay.portlet.social.model.SocialRequest updateSocialRequest(
586                    com.liferay.portlet.social.model.SocialRequest socialRequest) {
587                    return getService().updateSocialRequest(socialRequest);
588            }
589    
590            public static SocialRequestLocalService getService() {
591                    if (_service == null) {
592                            _service = (SocialRequestLocalService)PortalBeanLocatorUtil.locate(SocialRequestLocalService.class.getName());
593    
594                            ReferenceRegistry.registerReference(SocialRequestLocalServiceUtil.class,
595                                    "_service");
596                    }
597    
598                    return _service;
599            }
600    
601            private static SocialRequestLocalService _service;
602    }