001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.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 MembershipRequest. This utility wraps
024     * {@link com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl} 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 MembershipRequestLocalService
032     * @see com.liferay.portal.service.base.MembershipRequestLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class MembershipRequestLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the membership request to the database. Also notifies the appropriate model listeners.
046            *
047            * @param membershipRequest the membership request
048            * @return the membership request that was added
049            */
050            public static com.liferay.portal.model.MembershipRequest addMembershipRequest(
051                    com.liferay.portal.model.MembershipRequest membershipRequest) {
052                    return getService().addMembershipRequest(membershipRequest);
053            }
054    
055            public static com.liferay.portal.model.MembershipRequest addMembershipRequest(
056                    long userId, long groupId, java.lang.String comments,
057                    com.liferay.portal.service.ServiceContext serviceContext)
058                    throws com.liferay.portal.kernel.exception.PortalException {
059                    return getService()
060                                       .addMembershipRequest(userId, groupId, comments,
061                            serviceContext);
062            }
063    
064            /**
065            * Creates a new membership request with the primary key. Does not add the membership request to the database.
066            *
067            * @param membershipRequestId the primary key for the new membership request
068            * @return the new membership request
069            */
070            public static com.liferay.portal.model.MembershipRequest createMembershipRequest(
071                    long membershipRequestId) {
072                    return getService().createMembershipRequest(membershipRequestId);
073            }
074    
075            /**
076            * Deletes the membership request from the database. Also notifies the appropriate model listeners.
077            *
078            * @param membershipRequest the membership request
079            * @return the membership request that was removed
080            */
081            public static com.liferay.portal.model.MembershipRequest deleteMembershipRequest(
082                    com.liferay.portal.model.MembershipRequest membershipRequest) {
083                    return getService().deleteMembershipRequest(membershipRequest);
084            }
085    
086            /**
087            * Deletes the membership request with the primary key from the database. Also notifies the appropriate model listeners.
088            *
089            * @param membershipRequestId the primary key of the membership request
090            * @return the membership request that was removed
091            * @throws PortalException if a membership request with the primary key could not be found
092            */
093            public static com.liferay.portal.model.MembershipRequest deleteMembershipRequest(
094                    long membershipRequestId)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    return getService().deleteMembershipRequest(membershipRequestId);
097            }
098    
099            public static void deleteMembershipRequests(long groupId) {
100                    getService().deleteMembershipRequests(groupId);
101            }
102    
103            public static void deleteMembershipRequests(long groupId, long statusId) {
104                    getService().deleteMembershipRequests(groupId, statusId);
105            }
106    
107            public static void deleteMembershipRequestsByUserId(long userId) {
108                    getService().deleteMembershipRequestsByUserId(userId);
109            }
110    
111            /**
112            * @throws PortalException
113            */
114            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
115                    com.liferay.portal.model.PersistedModel persistedModel)
116                    throws com.liferay.portal.kernel.exception.PortalException {
117                    return getService().deletePersistedModel(persistedModel);
118            }
119    
120            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
121                    return getService().dynamicQuery();
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns the matching rows.
126            *
127            * @param dynamicQuery the dynamic query
128            * @return the matching rows
129            */
130            public static <T> java.util.List<T> dynamicQuery(
131                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
132                    return getService().dynamicQuery(dynamicQuery);
133            }
134    
135            /**
136            * Performs a dynamic query on the database and returns a range of the matching rows.
137            *
138            * <p>
139            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.MembershipRequestModelImpl}. 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.
140            * </p>
141            *
142            * @param dynamicQuery the dynamic query
143            * @param start the lower bound of the range of model instances
144            * @param end the upper bound of the range of model instances (not inclusive)
145            * @return the range of matching rows
146            */
147            public static <T> java.util.List<T> dynamicQuery(
148                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
149                    int end) {
150                    return getService().dynamicQuery(dynamicQuery, start, end);
151            }
152    
153            /**
154            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
155            *
156            * <p>
157            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.MembershipRequestModelImpl}. 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.
158            * </p>
159            *
160            * @param dynamicQuery the dynamic query
161            * @param start the lower bound of the range of model instances
162            * @param end the upper bound of the range of model instances (not inclusive)
163            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
164            * @return the ordered range of matching rows
165            */
166            public static <T> java.util.List<T> dynamicQuery(
167                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
168                    int end,
169                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
170                    return getService()
171                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
172            }
173    
174            /**
175            * Returns the number of rows matching the dynamic query.
176            *
177            * @param dynamicQuery the dynamic query
178            * @return the number of rows matching the dynamic query
179            */
180            public static long dynamicQueryCount(
181                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
182                    return getService().dynamicQueryCount(dynamicQuery);
183            }
184    
185            /**
186            * Returns the number of rows matching the dynamic query.
187            *
188            * @param dynamicQuery the dynamic query
189            * @param projection the projection to apply to the query
190            * @return the number of rows matching the dynamic query
191            */
192            public static long dynamicQueryCount(
193                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
194                    com.liferay.portal.kernel.dao.orm.Projection projection) {
195                    return getService().dynamicQueryCount(dynamicQuery, projection);
196            }
197    
198            public static com.liferay.portal.model.MembershipRequest fetchMembershipRequest(
199                    long membershipRequestId) {
200                    return getService().fetchMembershipRequest(membershipRequestId);
201            }
202    
203            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
204                    return getService().getActionableDynamicQuery();
205            }
206    
207            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
208                    return getService().getIndexableActionableDynamicQuery();
209            }
210    
211            /**
212            * Returns the membership request with the primary key.
213            *
214            * @param membershipRequestId the primary key of the membership request
215            * @return the membership request
216            * @throws PortalException if a membership request with the primary key could not be found
217            */
218            public static com.liferay.portal.model.MembershipRequest getMembershipRequest(
219                    long membershipRequestId)
220                    throws com.liferay.portal.kernel.exception.PortalException {
221                    return getService().getMembershipRequest(membershipRequestId);
222            }
223    
224            /**
225            * Returns a range of all the membership requests.
226            *
227            * <p>
228            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.MembershipRequestModelImpl}. 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.
229            * </p>
230            *
231            * @param start the lower bound of the range of membership requests
232            * @param end the upper bound of the range of membership requests (not inclusive)
233            * @return the range of membership requests
234            */
235            public static java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequests(
236                    int start, int end) {
237                    return getService().getMembershipRequests(start, end);
238            }
239    
240            public static java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequests(
241                    long userId, long groupId, long statusId) {
242                    return getService().getMembershipRequests(userId, groupId, statusId);
243            }
244    
245            /**
246            * Returns the number of membership requests.
247            *
248            * @return the number of membership requests
249            */
250            public static int getMembershipRequestsCount() {
251                    return getService().getMembershipRequestsCount();
252            }
253    
254            /**
255            * Returns the OSGi service identifier.
256            *
257            * @return the OSGi service identifier
258            */
259            public static java.lang.String getOSGiServiceIdentifier() {
260                    return getService().getOSGiServiceIdentifier();
261            }
262    
263            public static com.liferay.portal.model.PersistedModel getPersistedModel(
264                    java.io.Serializable primaryKeyObj)
265                    throws com.liferay.portal.kernel.exception.PortalException {
266                    return getService().getPersistedModel(primaryKeyObj);
267            }
268    
269            public static boolean hasMembershipRequest(long userId, long groupId,
270                    long statusId) {
271                    return getService().hasMembershipRequest(userId, groupId, statusId);
272            }
273    
274            public static java.util.List<com.liferay.portal.model.MembershipRequest> search(
275                    long groupId, int status, int start, int end) {
276                    return getService().search(groupId, status, start, end);
277            }
278    
279            public static int searchCount(long groupId, int status) {
280                    return getService().searchCount(groupId, status);
281            }
282    
283            /**
284            * Updates the membership request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
285            *
286            * @param membershipRequest the membership request
287            * @return the membership request that was updated
288            */
289            public static com.liferay.portal.model.MembershipRequest updateMembershipRequest(
290                    com.liferay.portal.model.MembershipRequest membershipRequest) {
291                    return getService().updateMembershipRequest(membershipRequest);
292            }
293    
294            public static void updateStatus(long replierUserId,
295                    long membershipRequestId, java.lang.String replyComments,
296                    long statusId, boolean addUserToGroup,
297                    com.liferay.portal.service.ServiceContext serviceContext)
298                    throws com.liferay.portal.kernel.exception.PortalException {
299                    getService()
300                            .updateStatus(replierUserId, membershipRequestId, replyComments,
301                            statusId, addUserToGroup, serviceContext);
302            }
303    
304            public static MembershipRequestLocalService getService() {
305                    if (_service == null) {
306                            _service = (MembershipRequestLocalService)PortalBeanLocatorUtil.locate(MembershipRequestLocalService.class.getName());
307    
308                            ReferenceRegistry.registerReference(MembershipRequestLocalServiceUtil.class,
309                                    "_service");
310                    }
311    
312                    return _service;
313            }
314    
315            private static MembershipRequestLocalService _service;
316    }