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            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
071            public boolean hasThreadFlag(long userId, MBThread thread)
072                    throws PortalException;
073    
074            /**
075            * Adds the message boards thread flag to the database. Also notifies the appropriate model listeners.
076            *
077            * @param mbThreadFlag the message boards thread flag
078            * @return the message boards thread flag that was added
079            */
080            @Indexable(type = IndexableType.REINDEX)
081            public MBThreadFlag addMBThreadFlag(MBThreadFlag mbThreadFlag);
082    
083            public MBThreadFlag addThreadFlag(long userId, MBThread thread,
084                    ServiceContext serviceContext) throws PortalException;
085    
086            /**
087            * Creates a new message boards thread flag with the primary key. Does not add the message boards thread flag to the database.
088            *
089            * @param threadFlagId the primary key for the new message boards thread flag
090            * @return the new message boards thread flag
091            */
092            public MBThreadFlag createMBThreadFlag(long threadFlagId);
093    
094            /**
095            * Deletes the message boards thread flag from the database. Also notifies the appropriate model listeners.
096            *
097            * @param mbThreadFlag the message boards thread flag
098            * @return the message boards thread flag that was removed
099            */
100            @Indexable(type = IndexableType.DELETE)
101            public MBThreadFlag deleteMBThreadFlag(MBThreadFlag mbThreadFlag);
102    
103            /**
104            * Deletes the message boards thread flag with the primary key from the database. Also notifies the appropriate model listeners.
105            *
106            * @param threadFlagId the primary key of the message boards thread flag
107            * @return the message boards thread flag that was removed
108            * @throws PortalException if a message boards thread flag with the primary key could not be found
109            */
110            @Indexable(type = IndexableType.DELETE)
111            public MBThreadFlag deleteMBThreadFlag(long threadFlagId)
112                    throws PortalException;
113    
114            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
115            public MBThreadFlag fetchMBThreadFlag(long threadFlagId);
116    
117            /**
118            * Returns the message boards thread flag matching the UUID and group.
119            *
120            * @param uuid the message boards thread flag's UUID
121            * @param groupId the primary key of the group
122            * @return the matching message boards thread flag, or <code>null</code> if a matching message boards thread flag could not be found
123            */
124            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125            public MBThreadFlag fetchMBThreadFlagByUuidAndGroupId(
126                    java.lang.String uuid, long groupId);
127    
128            /**
129            * Returns the message boards thread flag with the primary key.
130            *
131            * @param threadFlagId the primary key of the message boards thread flag
132            * @return the message boards thread flag
133            * @throws PortalException if a message boards thread flag with the primary key could not be found
134            */
135            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
136            public MBThreadFlag getMBThreadFlag(long threadFlagId)
137                    throws PortalException;
138    
139            /**
140            * Returns the message boards thread flag matching the UUID and group.
141            *
142            * @param uuid the message boards thread flag's UUID
143            * @param groupId the primary key of the group
144            * @return the matching message boards thread flag
145            * @throws PortalException if a matching message boards thread flag could not be found
146            */
147            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148            public MBThreadFlag getMBThreadFlagByUuidAndGroupId(java.lang.String uuid,
149                    long groupId) throws PortalException;
150    
151            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
152            public MBThreadFlag getThreadFlag(long userId, MBThread thread)
153                    throws PortalException;
154    
155            /**
156            * Updates the message boards thread flag in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
157            *
158            * @param mbThreadFlag the message boards thread flag
159            * @return the message boards thread flag that was updated
160            */
161            @Indexable(type = IndexableType.REINDEX)
162            public MBThreadFlag updateMBThreadFlag(MBThreadFlag mbThreadFlag);
163    
164            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165            public ActionableDynamicQuery getActionableDynamicQuery();
166    
167            public DynamicQuery dynamicQuery();
168    
169            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
171                    PortletDataContext portletDataContext);
172    
173            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
175    
176            /**
177            * @throws PortalException
178            */
179            @Override
180            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
181                    throws PortalException;
182    
183            @Override
184            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
185            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
186                    throws PortalException;
187    
188            /**
189            * Returns the number of message boards thread flags.
190            *
191            * @return the number of message boards thread flags
192            */
193            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
194            public int getMBThreadFlagsCount();
195    
196            /**
197            * Returns the OSGi service identifier.
198            *
199            * @return the OSGi service identifier
200            */
201            public java.lang.String getOSGiServiceIdentifier();
202    
203            /**
204            * Performs a dynamic query on the database and returns the matching rows.
205            *
206            * @param dynamicQuery the dynamic query
207            * @return the matching rows
208            */
209            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
210    
211            /**
212            * Performs a dynamic query on the database and returns a range of the matching rows.
213            *
214            * <p>
215            * 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.
216            * </p>
217            *
218            * @param dynamicQuery the dynamic query
219            * @param start the lower bound of the range of model instances
220            * @param end the upper bound of the range of model instances (not inclusive)
221            * @return the range of matching rows
222            */
223            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
224                    int end);
225    
226            /**
227            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
228            *
229            * <p>
230            * 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.
231            * </p>
232            *
233            * @param dynamicQuery the dynamic query
234            * @param start the lower bound of the range of model instances
235            * @param end the upper bound of the range of model instances (not inclusive)
236            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
237            * @return the ordered range of matching rows
238            */
239            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
240                    int end, OrderByComparator<T> orderByComparator);
241    
242            /**
243            * Returns a range of all the message boards thread flags.
244            *
245            * <p>
246            * 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.
247            * </p>
248            *
249            * @param start the lower bound of the range of message boards thread flags
250            * @param end the upper bound of the range of message boards thread flags (not inclusive)
251            * @return the range of message boards thread flags
252            */
253            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254            public List<MBThreadFlag> getMBThreadFlags(int start, int end);
255    
256            /**
257            * Returns all the message boards thread flags matching the UUID and company.
258            *
259            * @param uuid the UUID of the message boards thread flags
260            * @param companyId the primary key of the company
261            * @return the matching message boards thread flags, or an empty list if no matches were found
262            */
263            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
264            public List<MBThreadFlag> getMBThreadFlagsByUuidAndCompanyId(
265                    java.lang.String uuid, long companyId);
266    
267            /**
268            * Returns a range of message boards thread flags matching the UUID and company.
269            *
270            * @param uuid the UUID of the message boards thread flags
271            * @param companyId the primary key of the company
272            * @param start the lower bound of the range of message boards thread flags
273            * @param end the upper bound of the range of message boards thread flags (not inclusive)
274            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
275            * @return the range of matching message boards thread flags, or an empty list if no matches were found
276            */
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public List<MBThreadFlag> getMBThreadFlagsByUuidAndCompanyId(
279                    java.lang.String uuid, long companyId, int start, int end,
280                    OrderByComparator<MBThreadFlag> orderByComparator);
281    
282            /**
283            * Returns the number of rows matching the dynamic query.
284            *
285            * @param dynamicQuery the dynamic query
286            * @return the number of rows matching the dynamic query
287            */
288            public long dynamicQueryCount(DynamicQuery dynamicQuery);
289    
290            /**
291            * Returns the number of rows matching the dynamic query.
292            *
293            * @param dynamicQuery the dynamic query
294            * @param projection the projection to apply to the query
295            * @return the number of rows matching the dynamic query
296            */
297            public long dynamicQueryCount(DynamicQuery dynamicQuery,
298                    Projection projection);
299    
300            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
301            public void deleteThreadFlag(MBThreadFlag threadFlag);
302    
303            public void deleteThreadFlag(long threadFlagId) throws PortalException;
304    
305            public void deleteThreadFlagsByThreadId(long threadId);
306    
307            public void deleteThreadFlagsByUserId(long userId);
308    }