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