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.messageboards.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.systemevent.SystemEvent;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.OrderByComparator;
033    import com.liferay.portal.model.PersistedModel;
034    import com.liferay.portal.model.SystemEventConstants;
035    import com.liferay.portal.service.BaseLocalService;
036    import com.liferay.portal.service.PersistedModelLocalService;
037    import com.liferay.portal.service.ServiceContext;
038    
039    import com.liferay.portlet.exportimport.lar.PortletDataContext;
040    import com.liferay.portlet.messageboards.model.MBBan;
041    
042    import java.io.Serializable;
043    
044    import java.util.List;
045    
046    /**
047     * Provides the local service interface for MBBan. Methods of this
048     * service will not have security checks based on the propagated JAAS
049     * credentials because this service can only be accessed from within the same
050     * VM.
051     *
052     * @author Brian Wing Shun Chan
053     * @see MBBanLocalServiceUtil
054     * @see com.liferay.portlet.messageboards.service.base.MBBanLocalServiceBaseImpl
055     * @see com.liferay.portlet.messageboards.service.impl.MBBanLocalServiceImpl
056     * @generated
057     */
058    @ProviderType
059    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
060            PortalException.class, SystemException.class})
061    public interface MBBanLocalService extends BaseLocalService,
062            PersistedModelLocalService {
063            /*
064             * NOTE FOR DEVELOPERS:
065             *
066             * Never modify or reference this interface directly. Always use {@link MBBanLocalServiceUtil} to access the message boards ban local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBBanLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
067             */
068            public MBBan addBan(long userId, long banUserId,
069                    ServiceContext serviceContext) throws PortalException;
070    
071            /**
072            * Adds the message boards ban to the database. Also notifies the appropriate model listeners.
073            *
074            * @param mbBan the message boards ban
075            * @return the message boards ban that was added
076            */
077            @Indexable(type = IndexableType.REINDEX)
078            public MBBan addMBBan(MBBan mbBan);
079    
080            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
081            public void checkBan(long groupId, long banUserId)
082                    throws PortalException;
083    
084            /**
085            * Creates a new message boards ban with the primary key. Does not add the message boards ban to the database.
086            *
087            * @param banId the primary key for the new message boards ban
088            * @return the new message boards ban
089            */
090            public MBBan createMBBan(long banId);
091    
092            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
093            public void deleteBan(MBBan ban);
094    
095            public void deleteBan(long banId) throws PortalException;
096    
097            public void deleteBan(long banUserId, ServiceContext serviceContext);
098    
099            public void deleteBansByBanUserId(long banUserId);
100    
101            public void deleteBansByGroupId(long groupId);
102    
103            /**
104            * Deletes the message boards ban with the primary key from the database. Also notifies the appropriate model listeners.
105            *
106            * @param banId the primary key of the message boards ban
107            * @return the message boards ban that was removed
108            * @throws PortalException if a message boards ban with the primary key could not be found
109            */
110            @Indexable(type = IndexableType.DELETE)
111            public MBBan deleteMBBan(long banId) throws PortalException;
112    
113            /**
114            * Deletes the message boards ban from the database. Also notifies the appropriate model listeners.
115            *
116            * @param mbBan the message boards ban
117            * @return the message boards ban that was removed
118            */
119            @Indexable(type = IndexableType.DELETE)
120            public MBBan deleteMBBan(MBBan mbBan);
121    
122            /**
123            * @throws PortalException
124            */
125            @Override
126            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
127                    throws PortalException;
128    
129            public DynamicQuery dynamicQuery();
130    
131            /**
132            * Performs a dynamic query on the database and returns the matching rows.
133            *
134            * @param dynamicQuery the dynamic query
135            * @return the matching rows
136            */
137            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
138    
139            /**
140            * Performs a dynamic query on the database and returns a range of the matching rows.
141            *
142            * <p>
143            * 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.messageboards.model.impl.MBBanModelImpl}. 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.
144            * </p>
145            *
146            * @param dynamicQuery the dynamic query
147            * @param start the lower bound of the range of model instances
148            * @param end the upper bound of the range of model instances (not inclusive)
149            * @return the range of matching rows
150            */
151            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
152                    int end);
153    
154            /**
155            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
156            *
157            * <p>
158            * 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.messageboards.model.impl.MBBanModelImpl}. 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.
159            * </p>
160            *
161            * @param dynamicQuery the dynamic query
162            * @param start the lower bound of the range of model instances
163            * @param end the upper bound of the range of model instances (not inclusive)
164            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
165            * @return the ordered range of matching rows
166            */
167            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
168                    int end, OrderByComparator<T> orderByComparator);
169    
170            /**
171            * Returns the number of rows matching the dynamic query.
172            *
173            * @param dynamicQuery the dynamic query
174            * @return the number of rows matching the dynamic query
175            */
176            public long dynamicQueryCount(DynamicQuery dynamicQuery);
177    
178            /**
179            * Returns the number of rows matching the dynamic query.
180            *
181            * @param dynamicQuery the dynamic query
182            * @param projection the projection to apply to the query
183            * @return the number of rows matching the dynamic query
184            */
185            public long dynamicQueryCount(DynamicQuery dynamicQuery,
186                    Projection projection);
187    
188            public void expireBans();
189    
190            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191            public MBBan fetchMBBan(long banId);
192    
193            /**
194            * Returns the message boards ban matching the UUID and group.
195            *
196            * @param uuid the message boards ban's UUID
197            * @param groupId the primary key of the group
198            * @return the matching message boards ban, or <code>null</code> if a matching message boards ban could not be found
199            */
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public MBBan fetchMBBanByUuidAndGroupId(java.lang.String uuid, long groupId);
202    
203            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204            public ActionableDynamicQuery getActionableDynamicQuery();
205    
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public List<MBBan> getBans(long groupId, int start, int end);
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public int getBansCount(long groupId);
211    
212            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
214                    PortletDataContext portletDataContext);
215    
216            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
218    
219            /**
220            * Returns the message boards ban with the primary key.
221            *
222            * @param banId the primary key of the message boards ban
223            * @return the message boards ban
224            * @throws PortalException if a message boards ban with the primary key could not be found
225            */
226            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227            public MBBan getMBBan(long banId) throws PortalException;
228    
229            /**
230            * Returns the message boards ban matching the UUID and group.
231            *
232            * @param uuid the message boards ban's UUID
233            * @param groupId the primary key of the group
234            * @return the matching message boards ban
235            * @throws PortalException if a matching message boards ban could not be found
236            */
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public MBBan getMBBanByUuidAndGroupId(java.lang.String uuid, long groupId)
239                    throws PortalException;
240    
241            /**
242            * Returns a range of all the message boards bans.
243            *
244            * <p>
245            * 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.messageboards.model.impl.MBBanModelImpl}. 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.
246            * </p>
247            *
248            * @param start the lower bound of the range of message boards bans
249            * @param end the upper bound of the range of message boards bans (not inclusive)
250            * @return the range of message boards bans
251            */
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public List<MBBan> getMBBans(int start, int end);
254    
255            /**
256            * Returns all the message boards bans matching the UUID and company.
257            *
258            * @param uuid the UUID of the message boards bans
259            * @param companyId the primary key of the company
260            * @return the matching message boards bans, or an empty list if no matches were found
261            */
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public List<MBBan> getMBBansByUuidAndCompanyId(java.lang.String uuid,
264                    long companyId);
265    
266            /**
267            * Returns a range of message boards bans matching the UUID and company.
268            *
269            * @param uuid the UUID of the message boards bans
270            * @param companyId the primary key of the company
271            * @param start the lower bound of the range of message boards bans
272            * @param end the upper bound of the range of message boards bans (not inclusive)
273            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
274            * @return the range of matching message boards bans, or an empty list if no matches were found
275            */
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public List<MBBan> getMBBansByUuidAndCompanyId(java.lang.String uuid,
278                    long companyId, int start, int end,
279                    OrderByComparator<MBBan> orderByComparator);
280    
281            /**
282            * Returns the number of message boards bans.
283            *
284            * @return the number of message boards bans
285            */
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public int getMBBansCount();
288    
289            /**
290            * Returns the OSGi service identifier.
291            *
292            * @return the OSGi service identifier
293            */
294            public java.lang.String getOSGiServiceIdentifier();
295    
296            @Override
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
299                    throws PortalException;
300    
301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302            public boolean hasBan(long groupId, long banUserId);
303    
304            /**
305            * Updates the message boards ban in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
306            *
307            * @param mbBan the message boards ban
308            * @return the message boards ban that was updated
309            */
310            @Indexable(type = IndexableType.REINDEX)
311            public MBBan updateMBBan(MBBan mbBan);
312    }