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