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