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.kernel.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 public static boolean hasMembershipRequest(long userId, long groupId, 044 long statusId) { 045 return getService().hasMembershipRequest(userId, groupId, statusId); 046 } 047 048 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 049 return getService().getActionableDynamicQuery(); 050 } 051 052 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 053 return getService().dynamicQuery(); 054 } 055 056 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 057 return getService().getIndexableActionableDynamicQuery(); 058 } 059 060 /** 061 * Adds the membership request to the database. Also notifies the appropriate model listeners. 062 * 063 * @param membershipRequest the membership request 064 * @return the membership request that was added 065 */ 066 public static com.liferay.portal.kernel.model.MembershipRequest addMembershipRequest( 067 com.liferay.portal.kernel.model.MembershipRequest membershipRequest) { 068 return getService().addMembershipRequest(membershipRequest); 069 } 070 071 public static com.liferay.portal.kernel.model.MembershipRequest addMembershipRequest( 072 long userId, long groupId, java.lang.String comments, 073 ServiceContext serviceContext) 074 throws com.liferay.portal.kernel.exception.PortalException { 075 return getService() 076 .addMembershipRequest(userId, groupId, comments, 077 serviceContext); 078 } 079 080 /** 081 * Creates a new membership request with the primary key. Does not add the membership request to the database. 082 * 083 * @param membershipRequestId the primary key for the new membership request 084 * @return the new membership request 085 */ 086 public static com.liferay.portal.kernel.model.MembershipRequest createMembershipRequest( 087 long membershipRequestId) { 088 return getService().createMembershipRequest(membershipRequestId); 089 } 090 091 /** 092 * Deletes the membership request from the database. Also notifies the appropriate model listeners. 093 * 094 * @param membershipRequest the membership request 095 * @return the membership request that was removed 096 */ 097 public static com.liferay.portal.kernel.model.MembershipRequest deleteMembershipRequest( 098 com.liferay.portal.kernel.model.MembershipRequest membershipRequest) { 099 return getService().deleteMembershipRequest(membershipRequest); 100 } 101 102 /** 103 * Deletes the membership request with the primary key from the database. Also notifies the appropriate model listeners. 104 * 105 * @param membershipRequestId the primary key of the membership request 106 * @return the membership request that was removed 107 * @throws PortalException if a membership request with the primary key could not be found 108 */ 109 public static com.liferay.portal.kernel.model.MembershipRequest deleteMembershipRequest( 110 long membershipRequestId) 111 throws com.liferay.portal.kernel.exception.PortalException { 112 return getService().deleteMembershipRequest(membershipRequestId); 113 } 114 115 public static com.liferay.portal.kernel.model.MembershipRequest fetchMembershipRequest( 116 long membershipRequestId) { 117 return getService().fetchMembershipRequest(membershipRequestId); 118 } 119 120 /** 121 * Returns the membership request with the primary key. 122 * 123 * @param membershipRequestId the primary key of the membership request 124 * @return the membership request 125 * @throws PortalException if a membership request with the primary key could not be found 126 */ 127 public static com.liferay.portal.kernel.model.MembershipRequest getMembershipRequest( 128 long membershipRequestId) 129 throws com.liferay.portal.kernel.exception.PortalException { 130 return getService().getMembershipRequest(membershipRequestId); 131 } 132 133 /** 134 * Updates the membership request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 135 * 136 * @param membershipRequest the membership request 137 * @return the membership request that was updated 138 */ 139 public static com.liferay.portal.kernel.model.MembershipRequest updateMembershipRequest( 140 com.liferay.portal.kernel.model.MembershipRequest membershipRequest) { 141 return getService().updateMembershipRequest(membershipRequest); 142 } 143 144 /** 145 * @throws PortalException 146 */ 147 public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( 148 com.liferay.portal.kernel.model.PersistedModel persistedModel) 149 throws com.liferay.portal.kernel.exception.PortalException { 150 return getService().deletePersistedModel(persistedModel); 151 } 152 153 public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel( 154 java.io.Serializable primaryKeyObj) 155 throws com.liferay.portal.kernel.exception.PortalException { 156 return getService().getPersistedModel(primaryKeyObj); 157 } 158 159 /** 160 * Returns the number of membership requests. 161 * 162 * @return the number of membership requests 163 */ 164 public static int getMembershipRequestsCount() { 165 return getService().getMembershipRequestsCount(); 166 } 167 168 public static int searchCount(long groupId, int status) { 169 return getService().searchCount(groupId, status); 170 } 171 172 /** 173 * Returns the OSGi service identifier. 174 * 175 * @return the OSGi service identifier 176 */ 177 public static java.lang.String getOSGiServiceIdentifier() { 178 return getService().getOSGiServiceIdentifier(); 179 } 180 181 /** 182 * Performs a dynamic query on the database and returns the matching rows. 183 * 184 * @param dynamicQuery the dynamic query 185 * @return the matching rows 186 */ 187 public static <T> java.util.List<T> dynamicQuery( 188 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 189 return getService().dynamicQuery(dynamicQuery); 190 } 191 192 /** 193 * Performs a dynamic query on the database and returns a range of the matching rows. 194 * 195 * <p> 196 * 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. 197 * </p> 198 * 199 * @param dynamicQuery the dynamic query 200 * @param start the lower bound of the range of model instances 201 * @param end the upper bound of the range of model instances (not inclusive) 202 * @return the range of matching rows 203 */ 204 public static <T> java.util.List<T> dynamicQuery( 205 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 206 int end) { 207 return getService().dynamicQuery(dynamicQuery, start, end); 208 } 209 210 /** 211 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 212 * 213 * <p> 214 * 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. 215 * </p> 216 * 217 * @param dynamicQuery the dynamic query 218 * @param start the lower bound of the range of model instances 219 * @param end the upper bound of the range of model instances (not inclusive) 220 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 221 * @return the ordered range of matching rows 222 */ 223 public static <T> java.util.List<T> dynamicQuery( 224 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 225 int end, 226 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 227 return getService() 228 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 229 } 230 231 /** 232 * Returns a range of all the membership requests. 233 * 234 * <p> 235 * 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. 236 * </p> 237 * 238 * @param start the lower bound of the range of membership requests 239 * @param end the upper bound of the range of membership requests (not inclusive) 240 * @return the range of membership requests 241 */ 242 public static java.util.List<com.liferay.portal.kernel.model.MembershipRequest> getMembershipRequests( 243 int start, int end) { 244 return getService().getMembershipRequests(start, end); 245 } 246 247 public static java.util.List<com.liferay.portal.kernel.model.MembershipRequest> getMembershipRequests( 248 long userId, long groupId, long statusId) { 249 return getService().getMembershipRequests(userId, groupId, statusId); 250 } 251 252 public static java.util.List<com.liferay.portal.kernel.model.MembershipRequest> search( 253 long groupId, int status, int start, int end) { 254 return getService().search(groupId, status, start, end); 255 } 256 257 public static java.util.List<com.liferay.portal.kernel.model.MembershipRequest> search( 258 long groupId, int status, int start, int end, 259 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.MembershipRequest> obc) { 260 return getService().search(groupId, status, start, end, obc); 261 } 262 263 /** 264 * Returns the number of rows matching the dynamic query. 265 * 266 * @param dynamicQuery the dynamic query 267 * @return the number of rows matching the dynamic query 268 */ 269 public static long dynamicQueryCount( 270 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 271 return getService().dynamicQueryCount(dynamicQuery); 272 } 273 274 /** 275 * Returns the number of rows matching the dynamic query. 276 * 277 * @param dynamicQuery the dynamic query 278 * @param projection the projection to apply to the query 279 * @return the number of rows matching the dynamic query 280 */ 281 public static long dynamicQueryCount( 282 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 283 com.liferay.portal.kernel.dao.orm.Projection projection) { 284 return getService().dynamicQueryCount(dynamicQuery, projection); 285 } 286 287 public static void deleteMembershipRequests(long groupId) { 288 getService().deleteMembershipRequests(groupId); 289 } 290 291 public static void deleteMembershipRequests(long groupId, long statusId) { 292 getService().deleteMembershipRequests(groupId, statusId); 293 } 294 295 public static void deleteMembershipRequestsByUserId(long userId) { 296 getService().deleteMembershipRequestsByUserId(userId); 297 } 298 299 public static void updateStatus(long replierUserId, 300 long membershipRequestId, java.lang.String replyComments, 301 long statusId, boolean addUserToGroup, ServiceContext serviceContext) 302 throws com.liferay.portal.kernel.exception.PortalException { 303 getService() 304 .updateStatus(replierUserId, membershipRequestId, replyComments, 305 statusId, addUserToGroup, serviceContext); 306 } 307 308 public static MembershipRequestLocalService getService() { 309 if (_service == null) { 310 _service = (MembershipRequestLocalService)PortalBeanLocatorUtil.locate(MembershipRequestLocalService.class.getName()); 311 312 ReferenceRegistry.registerReference(MembershipRequestLocalServiceUtil.class, 313 "_service"); 314 } 315 316 return _service; 317 } 318 319 private static MembershipRequestLocalService _service; 320 }