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.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for AnnouncementsDelivery. This utility wraps
024     * {@link com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryLocalServiceImpl} 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 AnnouncementsDeliveryLocalService
032     * @see com.liferay.portlet.announcements.service.base.AnnouncementsDeliveryLocalServiceBaseImpl
033     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class AnnouncementsDeliveryLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsDeliveryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the announcements delivery to the database. Also notifies the appropriate model listeners.
046            *
047            * @param announcementsDelivery the announcements delivery
048            * @return the announcements delivery that was added
049            */
050            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery addAnnouncementsDelivery(
051                    com.liferay.announcements.kernel.model.AnnouncementsDelivery announcementsDelivery) {
052                    return getService().addAnnouncementsDelivery(announcementsDelivery);
053            }
054    
055            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery addUserDelivery(
056                    long userId, java.lang.String type)
057                    throws com.liferay.portal.kernel.exception.PortalException {
058                    return getService().addUserDelivery(userId, type);
059            }
060    
061            /**
062            * Creates a new announcements delivery with the primary key. Does not add the announcements delivery to the database.
063            *
064            * @param deliveryId the primary key for the new announcements delivery
065            * @return the new announcements delivery
066            */
067            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery createAnnouncementsDelivery(
068                    long deliveryId) {
069                    return getService().createAnnouncementsDelivery(deliveryId);
070            }
071    
072            /**
073            * Deletes the announcements delivery from the database. Also notifies the appropriate model listeners.
074            *
075            * @param announcementsDelivery the announcements delivery
076            * @return the announcements delivery that was removed
077            */
078            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery deleteAnnouncementsDelivery(
079                    com.liferay.announcements.kernel.model.AnnouncementsDelivery announcementsDelivery) {
080                    return getService().deleteAnnouncementsDelivery(announcementsDelivery);
081            }
082    
083            /**
084            * Deletes the announcements delivery with the primary key from the database. Also notifies the appropriate model listeners.
085            *
086            * @param deliveryId the primary key of the announcements delivery
087            * @return the announcements delivery that was removed
088            * @throws PortalException if a announcements delivery with the primary key could not be found
089            */
090            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery deleteAnnouncementsDelivery(
091                    long deliveryId)
092                    throws com.liferay.portal.kernel.exception.PortalException {
093                    return getService().deleteAnnouncementsDelivery(deliveryId);
094            }
095    
096            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery fetchAnnouncementsDelivery(
097                    long deliveryId) {
098                    return getService().fetchAnnouncementsDelivery(deliveryId);
099            }
100    
101            /**
102            * Returns the announcements delivery with the primary key.
103            *
104            * @param deliveryId the primary key of the announcements delivery
105            * @return the announcements delivery
106            * @throws PortalException if a announcements delivery with the primary key could not be found
107            */
108            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery getAnnouncementsDelivery(
109                    long deliveryId)
110                    throws com.liferay.portal.kernel.exception.PortalException {
111                    return getService().getAnnouncementsDelivery(deliveryId);
112            }
113    
114            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery getDelivery(
115                    long deliveryId)
116                    throws com.liferay.portal.kernel.exception.PortalException {
117                    return getService().getDelivery(deliveryId);
118            }
119    
120            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery getUserDelivery(
121                    long userId, java.lang.String type)
122                    throws com.liferay.portal.kernel.exception.PortalException {
123                    return getService().getUserDelivery(userId, type);
124            }
125    
126            /**
127            * Updates the announcements delivery in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
128            *
129            * @param announcementsDelivery the announcements delivery
130            * @return the announcements delivery that was updated
131            */
132            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery updateAnnouncementsDelivery(
133                    com.liferay.announcements.kernel.model.AnnouncementsDelivery announcementsDelivery) {
134                    return getService().updateAnnouncementsDelivery(announcementsDelivery);
135            }
136    
137            public static com.liferay.announcements.kernel.model.AnnouncementsDelivery updateDelivery(
138                    long userId, java.lang.String type, boolean email, boolean sms,
139                    boolean website)
140                    throws com.liferay.portal.kernel.exception.PortalException {
141                    return getService().updateDelivery(userId, type, email, sms, website);
142            }
143    
144            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
145                    return getService().getActionableDynamicQuery();
146            }
147    
148            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
149                    return getService().dynamicQuery();
150            }
151    
152            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
153                    return getService().getIndexableActionableDynamicQuery();
154            }
155    
156            /**
157            * @throws PortalException
158            */
159            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
160                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
161                    throws com.liferay.portal.kernel.exception.PortalException {
162                    return getService().deletePersistedModel(persistedModel);
163            }
164    
165            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
166                    java.io.Serializable primaryKeyObj)
167                    throws com.liferay.portal.kernel.exception.PortalException {
168                    return getService().getPersistedModel(primaryKeyObj);
169            }
170    
171            /**
172            * Returns the number of announcements deliveries.
173            *
174            * @return the number of announcements deliveries
175            */
176            public static int getAnnouncementsDeliveriesCount() {
177                    return getService().getAnnouncementsDeliveriesCount();
178            }
179    
180            /**
181            * Returns the OSGi service identifier.
182            *
183            * @return the OSGi service identifier
184            */
185            public static java.lang.String getOSGiServiceIdentifier() {
186                    return getService().getOSGiServiceIdentifier();
187            }
188    
189            /**
190            * Performs a dynamic query on the database and returns the matching rows.
191            *
192            * @param dynamicQuery the dynamic query
193            * @return the matching rows
194            */
195            public static <T> java.util.List<T> dynamicQuery(
196                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
197                    return getService().dynamicQuery(dynamicQuery);
198            }
199    
200            /**
201            * Performs a dynamic query on the database and returns a range of the matching rows.
202            *
203            * <p>
204            * 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.AnnouncementsDeliveryModelImpl}. 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.
205            * </p>
206            *
207            * @param dynamicQuery the dynamic query
208            * @param start the lower bound of the range of model instances
209            * @param end the upper bound of the range of model instances (not inclusive)
210            * @return the range of matching rows
211            */
212            public static <T> java.util.List<T> dynamicQuery(
213                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
214                    int end) {
215                    return getService().dynamicQuery(dynamicQuery, start, end);
216            }
217    
218            /**
219            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
220            *
221            * <p>
222            * 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.AnnouncementsDeliveryModelImpl}. 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.
223            * </p>
224            *
225            * @param dynamicQuery the dynamic query
226            * @param start the lower bound of the range of model instances
227            * @param end the upper bound of the range of model instances (not inclusive)
228            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
229            * @return the ordered range of matching rows
230            */
231            public static <T> java.util.List<T> dynamicQuery(
232                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
233                    int end,
234                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
235                    return getService()
236                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
237            }
238    
239            /**
240            * Returns a range of all the announcements deliveries.
241            *
242            * <p>
243            * 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.AnnouncementsDeliveryModelImpl}. 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.
244            * </p>
245            *
246            * @param start the lower bound of the range of announcements deliveries
247            * @param end the upper bound of the range of announcements deliveries (not inclusive)
248            * @return the range of announcements deliveries
249            */
250            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> getAnnouncementsDeliveries(
251                    int start, int end) {
252                    return getService().getAnnouncementsDeliveries(start, end);
253            }
254    
255            public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsDelivery> getUserDeliveries(
256                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
257                    return getService().getUserDeliveries(userId);
258            }
259    
260            /**
261            * Returns the number of rows matching the dynamic query.
262            *
263            * @param dynamicQuery the dynamic query
264            * @return the number of rows matching the dynamic query
265            */
266            public static long dynamicQueryCount(
267                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
268                    return getService().dynamicQueryCount(dynamicQuery);
269            }
270    
271            /**
272            * Returns the number of rows matching the dynamic query.
273            *
274            * @param dynamicQuery the dynamic query
275            * @param projection the projection to apply to the query
276            * @return the number of rows matching the dynamic query
277            */
278            public static long dynamicQueryCount(
279                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
280                    com.liferay.portal.kernel.dao.orm.Projection projection) {
281                    return getService().dynamicQueryCount(dynamicQuery, projection);
282            }
283    
284            public static void deleteDeliveries(long userId) {
285                    getService().deleteDeliveries(userId);
286            }
287    
288            public static void deleteDelivery(
289                    com.liferay.announcements.kernel.model.AnnouncementsDelivery delivery) {
290                    getService().deleteDelivery(delivery);
291            }
292    
293            public static void deleteDelivery(long deliveryId)
294                    throws com.liferay.portal.kernel.exception.PortalException {
295                    getService().deleteDelivery(deliveryId);
296            }
297    
298            public static void deleteDelivery(long userId, java.lang.String type) {
299                    getService().deleteDelivery(userId, type);
300            }
301    
302            public static AnnouncementsDeliveryLocalService getService() {
303                    if (_service == null) {
304                            _service = (AnnouncementsDeliveryLocalService)PortalBeanLocatorUtil.locate(AnnouncementsDeliveryLocalService.class.getName());
305    
306                            ReferenceRegistry.registerReference(AnnouncementsDeliveryLocalServiceUtil.class,
307                                    "_service");
308                    }
309    
310                    return _service;
311            }
312    
313            private static AnnouncementsDeliveryLocalService _service;
314    }