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