2 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 package com.liferay.portal.service;
17 import com.liferay.portal.kernel.exception.PortalException;
18 import com.liferay.portal.kernel.exception.SystemException;
19 import com.liferay.portal.kernel.transaction.Isolation;
20 import com.liferay.portal.kernel.transaction.Propagation;
21 import com.liferay.portal.kernel.transaction.Transactional;
24 * The interface for the membership request local service.
27 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
30 * @author Brian Wing Shun Chan
31 * @see MembershipRequestLocalServiceUtil
32 * @see com.liferay.portal.service.base.MembershipRequestLocalServiceBaseImpl
33 * @see com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl
36 @Transactional(isolation = Isolation.PORTAL, rollbackFor = {
37 PortalException.class, SystemException.class})
38 public interface MembershipRequestLocalService extends BaseLocalService,
39 PersistedModelLocalService {
41 * NOTE FOR DEVELOPERS:
43 * Never modify or reference this interface directly. Always use {@link MembershipRequestLocalServiceUtil} to access the membership request local service. Add custom service methods to {@link com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
47 * Adds the membership request to the database. Also notifies the appropriate model listeners.
49 * @param membershipRequest the membership request
50 * @return the membership request that was added
51 * @throws SystemException if a system exception occurred
53 public com.liferay.portal.model.MembershipRequest addMembershipRequest(
54 com.liferay.portal.model.MembershipRequest membershipRequest)
55 throws com.liferay.portal.kernel.exception.SystemException;
58 * Creates a new membership request with the primary key. Does not add the membership request to the database.
60 * @param membershipRequestId the primary key for the new membership request
61 * @return the new membership request
63 public com.liferay.portal.model.MembershipRequest createMembershipRequest(
64 long membershipRequestId);
67 * Deletes the membership request with the primary key from the database. Also notifies the appropriate model listeners.
69 * @param membershipRequestId the primary key of the membership request
70 * @return the membership request that was removed
71 * @throws PortalException if a membership request with the primary key could not be found
72 * @throws SystemException if a system exception occurred
74 public com.liferay.portal.model.MembershipRequest deleteMembershipRequest(
75 long membershipRequestId)
76 throws com.liferay.portal.kernel.exception.PortalException,
77 com.liferay.portal.kernel.exception.SystemException;
80 * Deletes the membership request from the database. Also notifies the appropriate model listeners.
82 * @param membershipRequest the membership request
83 * @return the membership request that was removed
84 * @throws SystemException if a system exception occurred
86 public com.liferay.portal.model.MembershipRequest deleteMembershipRequest(
87 com.liferay.portal.model.MembershipRequest membershipRequest)
88 throws com.liferay.portal.kernel.exception.SystemException;
90 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
93 * Performs a dynamic query on the database and returns the matching rows.
95 * @param dynamicQuery the dynamic query
96 * @return the matching rows
97 * @throws SystemException if a system exception occurred
99 @SuppressWarnings("rawtypes")
100 public java.util.List dynamicQuery(
101 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102 throws com.liferay.portal.kernel.exception.SystemException;
105 * Performs a dynamic query on the database and returns a range of the matching rows.
108 * 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.
111 * @param dynamicQuery the dynamic query
112 * @param start the lower bound of the range of model instances
113 * @param end the upper bound of the range of model instances (not inclusive)
114 * @return the range of matching rows
115 * @throws SystemException if a system exception occurred
117 @SuppressWarnings("rawtypes")
118 public java.util.List dynamicQuery(
119 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120 int end) throws com.liferay.portal.kernel.exception.SystemException;
123 * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126 * 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.
129 * @param dynamicQuery the dynamic query
130 * @param start the lower bound of the range of model instances
131 * @param end the upper bound of the range of model instances (not inclusive)
132 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133 * @return the ordered range of matching rows
134 * @throws SystemException if a system exception occurred
136 @SuppressWarnings("rawtypes")
137 public java.util.List dynamicQuery(
138 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
140 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141 throws com.liferay.portal.kernel.exception.SystemException;
144 * Returns the number of rows that match the dynamic query.
146 * @param dynamicQuery the dynamic query
147 * @return the number of rows that match the dynamic query
148 * @throws SystemException if a system exception occurred
150 public long dynamicQueryCount(
151 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152 throws com.liferay.portal.kernel.exception.SystemException;
154 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155 public com.liferay.portal.model.MembershipRequest fetchMembershipRequest(
156 long membershipRequestId)
157 throws com.liferay.portal.kernel.exception.SystemException;
160 * Returns the membership request with the primary key.
162 * @param membershipRequestId the primary key of the membership request
163 * @return the membership request
164 * @throws PortalException if a membership request with the primary key could not be found
165 * @throws SystemException if a system exception occurred
167 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
168 public com.liferay.portal.model.MembershipRequest getMembershipRequest(
169 long membershipRequestId)
170 throws com.liferay.portal.kernel.exception.PortalException,
171 com.liferay.portal.kernel.exception.SystemException;
173 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174 public java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequestByUserId(
176 throws com.liferay.portal.kernel.exception.SystemException,
177 com.liferay.portal.kernel.exception.PortalException;
179 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
180 public com.liferay.portal.model.PersistedModel getPersistedModel(
181 java.io.Serializable primaryKeyObj)
182 throws com.liferay.portal.kernel.exception.PortalException,
183 com.liferay.portal.kernel.exception.SystemException;
186 * Returns a range of all the membership requests.
189 * 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.
192 * @param start the lower bound of the range of membership requests
193 * @param end the upper bound of the range of membership requests (not inclusive)
194 * @return the range of membership requests
195 * @throws SystemException if a system exception occurred
197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
198 public java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequests(
200 throws com.liferay.portal.kernel.exception.SystemException;
203 * Returns the number of membership requests.
205 * @return the number of membership requests
206 * @throws SystemException if a system exception occurred
208 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209 public int getMembershipRequestsCount()
210 throws com.liferay.portal.kernel.exception.SystemException;
213 * Updates the membership request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
215 * @param membershipRequest the membership request
216 * @return the membership request that was updated
217 * @throws SystemException if a system exception occurred
219 public com.liferay.portal.model.MembershipRequest updateMembershipRequest(
220 com.liferay.portal.model.MembershipRequest membershipRequest)
221 throws com.liferay.portal.kernel.exception.SystemException;
224 * Updates the membership request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
226 * @param membershipRequest the membership request
227 * @param merge whether to merge the membership request with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
228 * @return the membership request that was updated
229 * @throws SystemException if a system exception occurred
231 public com.liferay.portal.model.MembershipRequest updateMembershipRequest(
232 com.liferay.portal.model.MembershipRequest membershipRequest,
234 throws com.liferay.portal.kernel.exception.SystemException;
237 * Returns the Spring bean ID for this bean.
239 * @return the Spring bean ID for this bean
241 public java.lang.String getBeanIdentifier();
244 * Sets the Spring bean ID for this bean.
246 * @param beanIdentifier the Spring bean ID for this bean
248 public void setBeanIdentifier(java.lang.String beanIdentifier);
250 public com.liferay.portal.model.MembershipRequest addMembershipRequest(
251 long userId, long groupId, java.lang.String comments,
252 com.liferay.portal.service.ServiceContext serviceContext)
253 throws com.liferay.portal.kernel.exception.PortalException,
254 com.liferay.portal.kernel.exception.SystemException;
256 public void deleteMembershipRequests(long groupId)
257 throws com.liferay.portal.kernel.exception.SystemException;
259 public void deleteMembershipRequests(long groupId, int statusId)
260 throws com.liferay.portal.kernel.exception.SystemException;
262 public void deleteMembershipRequestsByUserId(long userId)
263 throws com.liferay.portal.kernel.exception.SystemException;
265 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266 public java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequests(
267 long userId, long groupId, int statusId)
268 throws com.liferay.portal.kernel.exception.SystemException;
270 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271 public boolean hasMembershipRequest(long userId, long groupId, int statusId)
272 throws com.liferay.portal.kernel.exception.SystemException;
274 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
275 public java.util.List<com.liferay.portal.model.MembershipRequest> search(
276 long groupId, int status, int start, int end)
277 throws com.liferay.portal.kernel.exception.SystemException;
279 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
280 public int searchCount(long groupId, int status)
281 throws com.liferay.portal.kernel.exception.SystemException;
283 public void updateStatus(long replierUserId, long membershipRequestId,
284 java.lang.String replyComments, int statusId, boolean addUserToGroup,
285 com.liferay.portal.service.ServiceContext serviceContext)
286 throws com.liferay.portal.kernel.exception.PortalException,
287 com.liferay.portal.kernel.exception.SystemException;