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