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.announcements.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.announcements.kernel.model.AnnouncementsFlag;
020    
021    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
024    import com.liferay.portal.kernel.dao.orm.Projection;
025    import com.liferay.portal.kernel.exception.PortalException;
026    import com.liferay.portal.kernel.exception.SystemException;
027    import com.liferay.portal.kernel.model.PersistedModel;
028    import com.liferay.portal.kernel.search.Indexable;
029    import com.liferay.portal.kernel.search.IndexableType;
030    import com.liferay.portal.kernel.service.BaseLocalService;
031    import com.liferay.portal.kernel.service.PersistedModelLocalService;
032    import com.liferay.portal.kernel.transaction.Isolation;
033    import com.liferay.portal.kernel.transaction.Propagation;
034    import com.liferay.portal.kernel.transaction.Transactional;
035    import com.liferay.portal.kernel.util.OrderByComparator;
036    
037    import java.io.Serializable;
038    
039    import java.util.List;
040    
041    /**
042     * Provides the local service interface for AnnouncementsFlag. Methods of this
043     * service will not have security checks based on the propagated JAAS
044     * credentials because this service can only be accessed from within the same
045     * VM.
046     *
047     * @author Brian Wing Shun Chan
048     * @see AnnouncementsFlagLocalServiceUtil
049     * @see com.liferay.portlet.announcements.service.base.AnnouncementsFlagLocalServiceBaseImpl
050     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsFlagLocalServiceImpl
051     * @generated
052     */
053    @ProviderType
054    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
055            PortalException.class, SystemException.class})
056    public interface AnnouncementsFlagLocalService extends BaseLocalService,
057            PersistedModelLocalService {
058            /*
059             * NOTE FOR DEVELOPERS:
060             *
061             * Never modify or reference this interface directly. Always use {@link AnnouncementsFlagLocalServiceUtil} to access the announcements flag local service. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsFlagLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
062             */
063    
064            /**
065            * Adds the announcements flag to the database. Also notifies the appropriate model listeners.
066            *
067            * @param announcementsFlag the announcements flag
068            * @return the announcements flag that was added
069            */
070            @Indexable(type = IndexableType.REINDEX)
071            public AnnouncementsFlag addAnnouncementsFlag(
072                    AnnouncementsFlag announcementsFlag);
073    
074            public AnnouncementsFlag addFlag(long userId, long entryId, int value);
075    
076            /**
077            * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database.
078            *
079            * @param flagId the primary key for the new announcements flag
080            * @return the new announcements flag
081            */
082            public AnnouncementsFlag createAnnouncementsFlag(long flagId);
083    
084            /**
085            * Deletes the announcements flag from the database. Also notifies the appropriate model listeners.
086            *
087            * @param announcementsFlag the announcements flag
088            * @return the announcements flag that was removed
089            */
090            @Indexable(type = IndexableType.DELETE)
091            public AnnouncementsFlag deleteAnnouncementsFlag(
092                    AnnouncementsFlag announcementsFlag);
093    
094            /**
095            * Deletes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners.
096            *
097            * @param flagId the primary key of the announcements flag
098            * @return the announcements flag that was removed
099            * @throws PortalException if a announcements flag with the primary key could not be found
100            */
101            @Indexable(type = IndexableType.DELETE)
102            public AnnouncementsFlag deleteAnnouncementsFlag(long flagId)
103                    throws PortalException;
104    
105            public void deleteFlag(AnnouncementsFlag flag);
106    
107            public void deleteFlag(long flagId) throws PortalException;
108    
109            public void deleteFlags(long entryId);
110    
111            /**
112            * @throws PortalException
113            */
114            @Override
115            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
116                    throws PortalException;
117    
118            public DynamicQuery dynamicQuery();
119    
120            /**
121            * Performs a dynamic query on the database and returns the matching rows.
122            *
123            * @param dynamicQuery the dynamic query
124            * @return the matching rows
125            */
126            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
127    
128            /**
129            * Performs a dynamic query on the database and returns a range of the matching rows.
130            *
131            * <p>
132            * 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.announcements.model.impl.AnnouncementsFlagModelImpl}. 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.
133            * </p>
134            *
135            * @param dynamicQuery the dynamic query
136            * @param start the lower bound of the range of model instances
137            * @param end the upper bound of the range of model instances (not inclusive)
138            * @return the range of matching rows
139            */
140            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
141                    int end);
142    
143            /**
144            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
145            *
146            * <p>
147            * 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.announcements.model.impl.AnnouncementsFlagModelImpl}. 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.
148            * </p>
149            *
150            * @param dynamicQuery the dynamic query
151            * @param start the lower bound of the range of model instances
152            * @param end the upper bound of the range of model instances (not inclusive)
153            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
154            * @return the ordered range of matching rows
155            */
156            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
157                    int end, 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(DynamicQuery dynamicQuery);
166    
167            /**
168            * Returns the number of rows matching the dynamic query.
169            *
170            * @param dynamicQuery the dynamic query
171            * @param projection the projection to apply to the query
172            * @return the number of rows matching the dynamic query
173            */
174            public long dynamicQueryCount(DynamicQuery dynamicQuery,
175                    Projection projection);
176    
177            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178            public AnnouncementsFlag fetchAnnouncementsFlag(long flagId);
179    
180            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181            public ActionableDynamicQuery getActionableDynamicQuery();
182    
183            /**
184            * Returns the announcements flag with the primary key.
185            *
186            * @param flagId the primary key of the announcements flag
187            * @return the announcements flag
188            * @throws PortalException if a announcements flag with the primary key could not be found
189            */
190            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191            public AnnouncementsFlag getAnnouncementsFlag(long flagId)
192                    throws PortalException;
193    
194            /**
195            * Returns a range of all the announcements flags.
196            *
197            * <p>
198            * 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.announcements.model.impl.AnnouncementsFlagModelImpl}. 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.
199            * </p>
200            *
201            * @param start the lower bound of the range of announcements flags
202            * @param end the upper bound of the range of announcements flags (not inclusive)
203            * @return the range of announcements flags
204            */
205            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
206            public List<AnnouncementsFlag> getAnnouncementsFlags(int start, int end);
207    
208            /**
209            * Returns the number of announcements flags.
210            *
211            * @return the number of announcements flags
212            */
213            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214            public int getAnnouncementsFlagsCount();
215    
216            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217            public AnnouncementsFlag getFlag(long userId, long entryId, int value)
218                    throws PortalException;
219    
220            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
222    
223            /**
224            * Returns the OSGi service identifier.
225            *
226            * @return the OSGi service identifier
227            */
228            public java.lang.String getOSGiServiceIdentifier();
229    
230            @Override
231            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
232            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
233                    throws PortalException;
234    
235            /**
236            * Updates the announcements flag in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
237            *
238            * @param announcementsFlag the announcements flag
239            * @return the announcements flag that was updated
240            */
241            @Indexable(type = IndexableType.REINDEX)
242            public AnnouncementsFlag updateAnnouncementsFlag(
243                    AnnouncementsFlag announcementsFlag);
244    }