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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 070 public boolean hasBan(long groupId, long banUserId); 071 072 public MBBan addBan(long userId, long banUserId, 073 ServiceContext serviceContext) throws PortalException; 074 075 /** 076 * Adds the message boards ban to the database. Also notifies the appropriate model listeners. 077 * 078 * @param mbBan the message boards ban 079 * @return the message boards ban that was added 080 */ 081 @Indexable(type = IndexableType.REINDEX) 082 public MBBan addMBBan(MBBan mbBan); 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 /** 093 * Deletes the message boards ban from the database. Also notifies the appropriate model listeners. 094 * 095 * @param mbBan the message boards ban 096 * @return the message boards ban that was removed 097 */ 098 @Indexable(type = IndexableType.DELETE) 099 public MBBan deleteMBBan(MBBan mbBan); 100 101 /** 102 * Deletes the message boards ban with the primary key from the database. Also notifies the appropriate model listeners. 103 * 104 * @param banId the primary key of the message boards ban 105 * @return the message boards ban that was removed 106 * @throws PortalException if a message boards ban with the primary key could not be found 107 */ 108 @Indexable(type = IndexableType.DELETE) 109 public MBBan deleteMBBan(long banId) throws PortalException; 110 111 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 112 public MBBan fetchMBBan(long banId); 113 114 /** 115 * Returns the message boards ban matching the UUID and group. 116 * 117 * @param uuid the message boards ban's UUID 118 * @param groupId the primary key of the group 119 * @return the matching message boards ban, or <code>null</code> if a matching message boards ban could not be found 120 */ 121 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 122 public MBBan fetchMBBanByUuidAndGroupId(java.lang.String uuid, long groupId); 123 124 /** 125 * Returns the message boards ban with the primary key. 126 * 127 * @param banId the primary key of the message boards ban 128 * @return the message boards ban 129 * @throws PortalException if a message boards ban with the primary key could not be found 130 */ 131 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 132 public MBBan getMBBan(long banId) throws PortalException; 133 134 /** 135 * Returns the message boards ban matching the UUID and group. 136 * 137 * @param uuid the message boards ban's UUID 138 * @param groupId the primary key of the group 139 * @return the matching message boards ban 140 * @throws PortalException if a matching message boards ban could not be found 141 */ 142 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 143 public MBBan getMBBanByUuidAndGroupId(java.lang.String uuid, long groupId) 144 throws PortalException; 145 146 /** 147 * Updates the message boards ban in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 148 * 149 * @param mbBan the message boards ban 150 * @return the message boards ban that was updated 151 */ 152 @Indexable(type = IndexableType.REINDEX) 153 public MBBan updateMBBan(MBBan mbBan); 154 155 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 156 public ActionableDynamicQuery getActionableDynamicQuery(); 157 158 public DynamicQuery dynamicQuery(); 159 160 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 161 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 162 PortletDataContext portletDataContext); 163 164 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 165 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 166 167 /** 168 * @throws PortalException 169 */ 170 @Override 171 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 172 throws PortalException; 173 174 @Override 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 177 throws PortalException; 178 179 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 180 public int getBansCount(long groupId); 181 182 /** 183 * Returns the number of message boards bans. 184 * 185 * @return the number of message boards bans 186 */ 187 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 188 public int getMBBansCount(); 189 190 /** 191 * Returns the OSGi service identifier. 192 * 193 * @return the OSGi service identifier 194 */ 195 public java.lang.String getOSGiServiceIdentifier(); 196 197 /** 198 * Performs a dynamic query on the database and returns the matching rows. 199 * 200 * @param dynamicQuery the dynamic query 201 * @return the matching rows 202 */ 203 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 204 205 /** 206 * Performs a dynamic query on the database and returns a range of the matching rows. 207 * 208 * <p> 209 * 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. 210 * </p> 211 * 212 * @param dynamicQuery the dynamic query 213 * @param start the lower bound of the range of model instances 214 * @param end the upper bound of the range of model instances (not inclusive) 215 * @return the range of matching rows 216 */ 217 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 218 int end); 219 220 /** 221 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 222 * 223 * <p> 224 * 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. 225 * </p> 226 * 227 * @param dynamicQuery the dynamic query 228 * @param start the lower bound of the range of model instances 229 * @param end the upper bound of the range of model instances (not inclusive) 230 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 231 * @return the ordered range of matching rows 232 */ 233 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 234 int end, OrderByComparator<T> orderByComparator); 235 236 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 237 public List<MBBan> getBans(long groupId, int start, int end); 238 239 /** 240 * Returns a range of all the message boards bans. 241 * 242 * <p> 243 * 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. 244 * </p> 245 * 246 * @param start the lower bound of the range of message boards bans 247 * @param end the upper bound of the range of message boards bans (not inclusive) 248 * @return the range of message boards bans 249 */ 250 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 251 public List<MBBan> getMBBans(int start, int end); 252 253 /** 254 * Returns all the message boards bans matching the UUID and company. 255 * 256 * @param uuid the UUID of the message boards bans 257 * @param companyId the primary key of the company 258 * @return the matching message boards bans, or an empty list if no matches were found 259 */ 260 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 261 public List<MBBan> getMBBansByUuidAndCompanyId(java.lang.String uuid, 262 long companyId); 263 264 /** 265 * Returns a range of message boards bans matching the UUID and company. 266 * 267 * @param uuid the UUID of the message boards bans 268 * @param companyId the primary key of the company 269 * @param start the lower bound of the range of message boards bans 270 * @param end the upper bound of the range of message boards bans (not inclusive) 271 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 272 * @return the range of matching message boards bans, or an empty list if no matches were found 273 */ 274 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 275 public List<MBBan> getMBBansByUuidAndCompanyId(java.lang.String uuid, 276 long companyId, int start, int end, 277 OrderByComparator<MBBan> orderByComparator); 278 279 /** 280 * Returns the number of rows matching the dynamic query. 281 * 282 * @param dynamicQuery the dynamic query 283 * @return the number of rows matching the dynamic query 284 */ 285 public long dynamicQueryCount(DynamicQuery dynamicQuery); 286 287 /** 288 * Returns the number of rows matching the dynamic query. 289 * 290 * @param dynamicQuery the dynamic query 291 * @param projection the projection to apply to the query 292 * @return the number of rows matching the dynamic query 293 */ 294 public long dynamicQueryCount(DynamicQuery dynamicQuery, 295 Projection projection); 296 297 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 298 public void checkBan(long groupId, long banUserId) 299 throws PortalException; 300 301 @SystemEvent(type = SystemEventConstants.TYPE_DELETE) 302 public void deleteBan(MBBan ban); 303 304 public void deleteBan(long banId) throws PortalException; 305 306 public void deleteBan(long banUserId, ServiceContext serviceContext); 307 308 public void deleteBansByBanUserId(long banUserId); 309 310 public void deleteBansByGroupId(long groupId); 311 312 public void expireBans(); 313 }