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