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.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.search.Indexable;
027    import com.liferay.portal.kernel.search.IndexableType;
028    import com.liferay.portal.kernel.systemevent.SystemEvent;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.OrderByComparator;
033    import com.liferay.portal.model.PersistedModel;
034    import com.liferay.portal.model.SystemEventConstants;
035    import com.liferay.portal.service.BaseLocalService;
036    import com.liferay.portal.service.PersistedModelLocalService;
037    import com.liferay.portal.service.ServiceContext;
038    
039    import com.liferay.portlet.exportimport.lar.PortletDataContext;
040    import com.liferay.portlet.messageboards.model.MBThread;
041    import com.liferay.portlet.messageboards.model.MBThreadFlag;
042    
043    import java.io.Serializable;
044    
045    import java.util.List;
046    
047    /**
048     * Provides the local service interface for MBThreadFlag. 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 MBThreadFlagLocalServiceUtil
055     * @see com.liferay.portlet.messageboards.service.base.MBThreadFlagLocalServiceBaseImpl
056     * @see com.liferay.portlet.messageboards.service.impl.MBThreadFlagLocalServiceImpl
057     * @generated
058     */
059    @ProviderType
060    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
061            PortalException.class, SystemException.class})
062    public interface MBThreadFlagLocalService extends BaseLocalService,
063            PersistedModelLocalService {
064            /*
065             * NOTE FOR DEVELOPERS:
066             *
067             * Never modify or reference this interface directly. Always use {@link MBThreadFlagLocalServiceUtil} to access the message boards thread flag local service. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBThreadFlagLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
068             */
069    
070            /**
071            * Adds the message boards thread flag to the database. Also notifies the appropriate model listeners.
072            *
073            * @param mbThreadFlag the message boards thread flag
074            * @return the message boards thread flag that was added
075            */
076            @Indexable(type = IndexableType.REINDEX)
077            public MBThreadFlag addMBThreadFlag(MBThreadFlag mbThreadFlag);
078    
079            public MBThreadFlag addThreadFlag(long userId, MBThread thread,
080                    ServiceContext serviceContext) throws PortalException;
081    
082            /**
083            * Creates a new message boards thread flag with the primary key. Does not add the message boards thread flag to the database.
084            *
085            * @param threadFlagId the primary key for the new message boards thread flag
086            * @return the new message boards thread flag
087            */
088            public MBThreadFlag createMBThreadFlag(long threadFlagId);
089    
090            /**
091            * Deletes the message boards thread flag from the database. Also notifies the appropriate model listeners.
092            *
093            * @param mbThreadFlag the message boards thread flag
094            * @return the message boards thread flag that was removed
095            */
096            @Indexable(type = IndexableType.DELETE)
097            public MBThreadFlag deleteMBThreadFlag(MBThreadFlag mbThreadFlag);
098    
099            /**
100            * Deletes the message boards thread flag with the primary key from the database. Also notifies the appropriate model listeners.
101            *
102            * @param threadFlagId the primary key of the message boards thread flag
103            * @return the message boards thread flag that was removed
104            * @throws PortalException if a message boards thread flag with the primary key could not be found
105            */
106            @Indexable(type = IndexableType.DELETE)
107            public MBThreadFlag deleteMBThreadFlag(long threadFlagId)
108                    throws PortalException;
109    
110            /**
111            * @throws PortalException
112            */
113            @Override
114            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
115                    throws PortalException;
116    
117            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
118            public void deleteThreadFlag(MBThreadFlag threadFlag);
119    
120            public void deleteThreadFlag(long threadFlagId) throws PortalException;
121    
122            public void deleteThreadFlagsByThreadId(long threadId);
123    
124            public void deleteThreadFlagsByUserId(long userId);
125    
126            public DynamicQuery dynamicQuery();
127    
128            /**
129            * Performs a dynamic query on the database and returns the matching rows.
130            *
131            * @param dynamicQuery the dynamic query
132            * @return the matching rows
133            */
134            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
135    
136            /**
137            * Performs a dynamic query on the database and returns a range of the matching rows.
138            *
139            * <p>
140            * 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.MBThreadFlagModelImpl}. 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.
141            * </p>
142            *
143            * @param dynamicQuery the dynamic query
144            * @param start the lower bound of the range of model instances
145            * @param end the upper bound of the range of model instances (not inclusive)
146            * @return the range of matching rows
147            */
148            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
149                    int end);
150    
151            /**
152            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
153            *
154            * <p>
155            * 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.MBThreadFlagModelImpl}. 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.
156            * </p>
157            *
158            * @param dynamicQuery the dynamic query
159            * @param start the lower bound of the range of model instances
160            * @param end the upper bound of the range of model instances (not inclusive)
161            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
162            * @return the ordered range of matching rows
163            */
164            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
165                    int end, OrderByComparator<T> orderByComparator);
166    
167            /**
168            * Returns the number of rows matching the dynamic query.
169            *
170            * @param dynamicQuery the dynamic query
171            * @return the number of rows matching the dynamic query
172            */
173            public long dynamicQueryCount(DynamicQuery dynamicQuery);
174    
175            /**
176            * Returns the number of rows matching the dynamic query.
177            *
178            * @param dynamicQuery the dynamic query
179            * @param projection the projection to apply to the query
180            * @return the number of rows matching the dynamic query
181            */
182            public long dynamicQueryCount(DynamicQuery dynamicQuery,
183                    Projection projection);
184    
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public MBThreadFlag fetchMBThreadFlag(long threadFlagId);
187    
188            /**
189            * Returns the message boards thread flag matching the UUID and group.
190            *
191            * @param uuid the message boards thread flag's UUID
192            * @param groupId the primary key of the group
193            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
194            */
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public MBThreadFlag fetchMBThreadFlagByUuidAndGroupId(
197                    java.lang.String uuid, long groupId);
198    
199            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200            public ActionableDynamicQuery getActionableDynamicQuery();
201    
202            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
203            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
204                    PortletDataContext portletDataContext);
205    
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
208    
209            /**
210            * Returns the message boards thread flag with the primary key.
211            *
212            * @param threadFlagId the primary key of the message boards thread flag
213            * @return the message boards thread flag
214            * @throws PortalException if a message boards thread flag with the primary key could not be found
215            */
216            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217            public MBThreadFlag getMBThreadFlag(long threadFlagId)
218                    throws PortalException;
219    
220            /**
221            * Returns the message boards thread flag matching the UUID and group.
222            *
223            * @param uuid the message boards thread flag's UUID
224            * @param groupId the primary key of the group
225            * @return the matching message boards thread flag
226            * @throws PortalException if a matching message boards thread flag could not be found
227            */
228            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
229            public MBThreadFlag getMBThreadFlagByUuidAndGroupId(java.lang.String uuid,
230                    long groupId) throws PortalException;
231    
232            /**
233            * Returns a range of all the message boards thread flags.
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.MBThreadFlagModelImpl}. 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 start the lower bound of the range of message boards thread flags
240            * @param end the upper bound of the range of message boards thread flags (not inclusive)
241            * @return the range of message boards thread flags
242            */
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public List<MBThreadFlag> getMBThreadFlags(int start, int end);
245    
246            /**
247            * Returns all the message boards thread flags matching the UUID and company.
248            *
249            * @param uuid the UUID of the message boards thread flags
250            * @param companyId the primary key of the company
251            * @return the matching message boards thread flags, or an empty list if no matches were found
252            */
253            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254            public List<MBThreadFlag> getMBThreadFlagsByUuidAndCompanyId(
255                    java.lang.String uuid, long companyId);
256    
257            /**
258            * Returns a range of message boards thread flags matching the UUID and company.
259            *
260            * @param uuid the UUID of the message boards thread flags
261            * @param companyId the primary key of the company
262            * @param start the lower bound of the range of message boards thread flags
263            * @param end the upper bound of the range of message boards thread flags (not inclusive)
264            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
265            * @return the range of matching message boards thread flags, or an empty list if no matches were found
266            */
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public List<MBThreadFlag> getMBThreadFlagsByUuidAndCompanyId(
269                    java.lang.String uuid, long companyId, int start, int end,
270                    OrderByComparator<MBThreadFlag> orderByComparator);
271    
272            /**
273            * Returns the number of message boards thread flags.
274            *
275            * @return the number of message boards thread flags
276            */
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public int getMBThreadFlagsCount();
279    
280            /**
281            * Returns the OSGi service identifier.
282            *
283            * @return the OSGi service identifier
284            */
285            public java.lang.String getOSGiServiceIdentifier();
286    
287            @Override
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
290                    throws PortalException;
291    
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public MBThreadFlag getThreadFlag(long userId, MBThread thread)
294                    throws PortalException;
295    
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public boolean hasThreadFlag(long userId, MBThread thread)
298                    throws PortalException;
299    
300            /**
301            * Updates the message boards thread flag in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
302            *
303            * @param mbThreadFlag the message boards thread flag
304            * @return the message boards thread flag that was updated
305            */
306            @Indexable(type = IndexableType.REINDEX)
307            public MBThreadFlag updateMBThreadFlag(MBThreadFlag mbThreadFlag);
308    }