001    /**
002     * Copyright (c) 2000-2013 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.portal.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 UserNotificationEvent. This utility wraps
024     * {@link com.liferay.portal.service.impl.UserNotificationEventLocalServiceImpl} 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 UserNotificationEventLocalService
032     * @see com.liferay.portal.service.base.UserNotificationEventLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserNotificationEventLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class UserNotificationEventLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserNotificationEventLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the user notification event to the database. Also notifies the appropriate model listeners.
046            *
047            * @param userNotificationEvent the user notification event
048            * @return the user notification event that was added
049            * @throws SystemException if a system exception occurred
050            */
051            public static com.liferay.portal.model.UserNotificationEvent addUserNotificationEvent(
052                    com.liferay.portal.model.UserNotificationEvent userNotificationEvent)
053                    throws com.liferay.portal.kernel.exception.SystemException {
054                    return getService().addUserNotificationEvent(userNotificationEvent);
055            }
056    
057            /**
058            * Creates a new user notification event with the primary key. Does not add the user notification event to the database.
059            *
060            * @param userNotificationEventId the primary key for the new user notification event
061            * @return the new user notification event
062            */
063            public static com.liferay.portal.model.UserNotificationEvent createUserNotificationEvent(
064                    long userNotificationEventId) {
065                    return getService().createUserNotificationEvent(userNotificationEventId);
066            }
067    
068            /**
069            * Deletes the user notification event with the primary key from the database. Also notifies the appropriate model listeners.
070            *
071            * @param userNotificationEventId the primary key of the user notification event
072            * @return the user notification event that was removed
073            * @throws PortalException if a user notification event with the primary key could not be found
074            * @throws SystemException if a system exception occurred
075            */
076            public static com.liferay.portal.model.UserNotificationEvent deleteUserNotificationEvent(
077                    long userNotificationEventId)
078                    throws com.liferay.portal.kernel.exception.PortalException,
079                            com.liferay.portal.kernel.exception.SystemException {
080                    return getService().deleteUserNotificationEvent(userNotificationEventId);
081            }
082    
083            /**
084            * Deletes the user notification event from the database. Also notifies the appropriate model listeners.
085            *
086            * @param userNotificationEvent the user notification event
087            * @return the user notification event that was removed
088            * @throws SystemException if a system exception occurred
089            */
090            public static com.liferay.portal.model.UserNotificationEvent deleteUserNotificationEvent(
091                    com.liferay.portal.model.UserNotificationEvent userNotificationEvent)
092                    throws com.liferay.portal.kernel.exception.SystemException {
093                    return getService().deleteUserNotificationEvent(userNotificationEvent);
094            }
095    
096            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
097                    return getService().dynamicQuery();
098            }
099    
100            /**
101            * Performs a dynamic query on the database and returns the matching rows.
102            *
103            * @param dynamicQuery the dynamic query
104            * @return the matching rows
105            * @throws SystemException if a system exception occurred
106            */
107            @SuppressWarnings("rawtypes")
108            public static java.util.List dynamicQuery(
109                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
110                    throws com.liferay.portal.kernel.exception.SystemException {
111                    return getService().dynamicQuery(dynamicQuery);
112            }
113    
114            /**
115            * Performs a dynamic query on the database and returns a range of the matching rows.
116            *
117            * <p>
118            * 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.portal.model.impl.UserNotificationEventModelImpl}. 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.
119            * </p>
120            *
121            * @param dynamicQuery the dynamic query
122            * @param start the lower bound of the range of model instances
123            * @param end the upper bound of the range of model instances (not inclusive)
124            * @return the range of matching rows
125            * @throws SystemException if a system exception occurred
126            */
127            @SuppressWarnings("rawtypes")
128            public static java.util.List dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
130                    int end) throws com.liferay.portal.kernel.exception.SystemException {
131                    return getService().dynamicQuery(dynamicQuery, start, end);
132            }
133    
134            /**
135            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
136            *
137            * <p>
138            * 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.portal.model.impl.UserNotificationEventModelImpl}. 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
145            * @return the ordered range of matching rows
146            * @throws SystemException if a system exception occurred
147            */
148            @SuppressWarnings("rawtypes")
149            public static java.util.List dynamicQuery(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
151                    int end,
152                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return getService()
155                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
156            }
157    
158            /**
159            * Returns the number of rows that match the dynamic query.
160            *
161            * @param dynamicQuery the dynamic query
162            * @return the number of rows that match the dynamic query
163            * @throws SystemException if a system exception occurred
164            */
165            public static long dynamicQueryCount(
166                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167                    throws com.liferay.portal.kernel.exception.SystemException {
168                    return getService().dynamicQueryCount(dynamicQuery);
169            }
170    
171            /**
172            * Returns the number of rows that match the dynamic query.
173            *
174            * @param dynamicQuery the dynamic query
175            * @param projection the projection to apply to the query
176            * @return the number of rows that match the dynamic query
177            * @throws SystemException if a system exception occurred
178            */
179            public static long dynamicQueryCount(
180                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
181                    com.liferay.portal.kernel.dao.orm.Projection projection)
182                    throws com.liferay.portal.kernel.exception.SystemException {
183                    return getService().dynamicQueryCount(dynamicQuery, projection);
184            }
185    
186            public static com.liferay.portal.model.UserNotificationEvent fetchUserNotificationEvent(
187                    long userNotificationEventId)
188                    throws com.liferay.portal.kernel.exception.SystemException {
189                    return getService().fetchUserNotificationEvent(userNotificationEventId);
190            }
191    
192            /**
193            * Returns the user notification event with the matching UUID and company.
194            *
195            * @param uuid the user notification event's UUID
196            * @param companyId the primary key of the company
197            * @return the matching user notification event, or <code>null</code> if a matching user notification event could not be found
198            * @throws SystemException if a system exception occurred
199            */
200            public static com.liferay.portal.model.UserNotificationEvent fetchUserNotificationEventByUuidAndCompanyId(
201                    java.lang.String uuid, long companyId)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getService()
204                                       .fetchUserNotificationEventByUuidAndCompanyId(uuid, companyId);
205            }
206    
207            /**
208            * Returns the user notification event with the primary key.
209            *
210            * @param userNotificationEventId the primary key of the user notification event
211            * @return the user notification event
212            * @throws PortalException if a user notification event with the primary key could not be found
213            * @throws SystemException if a system exception occurred
214            */
215            public static com.liferay.portal.model.UserNotificationEvent getUserNotificationEvent(
216                    long userNotificationEventId)
217                    throws com.liferay.portal.kernel.exception.PortalException,
218                            com.liferay.portal.kernel.exception.SystemException {
219                    return getService().getUserNotificationEvent(userNotificationEventId);
220            }
221    
222            public static com.liferay.portal.model.PersistedModel getPersistedModel(
223                    java.io.Serializable primaryKeyObj)
224                    throws com.liferay.portal.kernel.exception.PortalException,
225                            com.liferay.portal.kernel.exception.SystemException {
226                    return getService().getPersistedModel(primaryKeyObj);
227            }
228    
229            /**
230            * Returns the user notification event with the matching UUID and company.
231            *
232            * @param uuid the user notification event's UUID
233            * @param companyId the primary key of the company
234            * @return the matching user notification event
235            * @throws PortalException if a matching user notification event could not be found
236            * @throws SystemException if a system exception occurred
237            */
238            public static com.liferay.portal.model.UserNotificationEvent getUserNotificationEventByUuidAndCompanyId(
239                    java.lang.String uuid, long companyId)
240                    throws com.liferay.portal.kernel.exception.PortalException,
241                            com.liferay.portal.kernel.exception.SystemException {
242                    return getService()
243                                       .getUserNotificationEventByUuidAndCompanyId(uuid, companyId);
244            }
245    
246            /**
247            * Returns a range of all the user notification events.
248            *
249            * <p>
250            * 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.portal.model.impl.UserNotificationEventModelImpl}. 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.
251            * </p>
252            *
253            * @param start the lower bound of the range of user notification events
254            * @param end the upper bound of the range of user notification events (not inclusive)
255            * @return the range of user notification events
256            * @throws SystemException if a system exception occurred
257            */
258            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getUserNotificationEvents(
259                    int start, int end)
260                    throws com.liferay.portal.kernel.exception.SystemException {
261                    return getService().getUserNotificationEvents(start, end);
262            }
263    
264            /**
265            * Returns the number of user notification events.
266            *
267            * @return the number of user notification events
268            * @throws SystemException if a system exception occurred
269            */
270            public static int getUserNotificationEventsCount()
271                    throws com.liferay.portal.kernel.exception.SystemException {
272                    return getService().getUserNotificationEventsCount();
273            }
274    
275            /**
276            * Updates the user notification event in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
277            *
278            * @param userNotificationEvent the user notification event
279            * @return the user notification event that was updated
280            * @throws SystemException if a system exception occurred
281            */
282            public static com.liferay.portal.model.UserNotificationEvent updateUserNotificationEvent(
283                    com.liferay.portal.model.UserNotificationEvent userNotificationEvent)
284                    throws com.liferay.portal.kernel.exception.SystemException {
285                    return getService().updateUserNotificationEvent(userNotificationEvent);
286            }
287    
288            /**
289            * Returns the Spring bean ID for this bean.
290            *
291            * @return the Spring bean ID for this bean
292            */
293            public static java.lang.String getBeanIdentifier() {
294                    return getService().getBeanIdentifier();
295            }
296    
297            /**
298            * Sets the Spring bean ID for this bean.
299            *
300            * @param beanIdentifier the Spring bean ID for this bean
301            */
302            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
303                    getService().setBeanIdentifier(beanIdentifier);
304            }
305    
306            public static com.liferay.portal.model.UserNotificationEvent addUserNotificationEvent(
307                    long userId,
308                    com.liferay.portal.kernel.notifications.NotificationEvent notificationEvent)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    return getService().addUserNotificationEvent(userId, notificationEvent);
312            }
313    
314            public static com.liferay.portal.model.UserNotificationEvent addUserNotificationEvent(
315                    long userId, java.lang.String type, long timestamp, long deliverBy,
316                    java.lang.String payload, boolean archived,
317                    com.liferay.portal.service.ServiceContext serviceContext)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    return getService()
321                                       .addUserNotificationEvent(userId, type, timestamp,
322                            deliverBy, payload, archived, serviceContext);
323            }
324    
325            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> addUserNotificationEvents(
326                    long userId,
327                    java.util.Collection<com.liferay.portal.kernel.notifications.NotificationEvent> notificationEvents)
328                    throws com.liferay.portal.kernel.exception.PortalException,
329                            com.liferay.portal.kernel.exception.SystemException {
330                    return getService().addUserNotificationEvents(userId, notificationEvents);
331            }
332    
333            public static void deleteUserNotificationEvent(java.lang.String uuid,
334                    long companyId)
335                    throws com.liferay.portal.kernel.exception.SystemException {
336                    getService().deleteUserNotificationEvent(uuid, companyId);
337            }
338    
339            public static void deleteUserNotificationEvents(
340                    java.util.Collection<java.lang.String> uuids, long companyId)
341                    throws com.liferay.portal.kernel.exception.SystemException {
342                    getService().deleteUserNotificationEvents(uuids, companyId);
343            }
344    
345            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getArchivedUserNotificationEvents(
346                    long userId, boolean archived)
347                    throws com.liferay.portal.kernel.exception.SystemException {
348                    return getService().getArchivedUserNotificationEvents(userId, archived);
349            }
350    
351            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getArchivedUserNotificationEvents(
352                    long userId, boolean archived, int start, int end)
353                    throws com.liferay.portal.kernel.exception.SystemException {
354                    return getService()
355                                       .getArchivedUserNotificationEvents(userId, archived, start,
356                            end);
357            }
358    
359            public static int getArchivedUserNotificationEventsCount(long userId,
360                    boolean archived)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getService()
363                                       .getArchivedUserNotificationEventsCount(userId, archived);
364            }
365    
366            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getDeliveredUserNotificationEvents(
367                    long userId, boolean delivered)
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    return getService().getDeliveredUserNotificationEvents(userId, delivered);
370            }
371    
372            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getDeliveredUserNotificationEvents(
373                    long userId, boolean delivered, int start, int end)
374                    throws com.liferay.portal.kernel.exception.SystemException {
375                    return getService()
376                                       .getDeliveredUserNotificationEvents(userId, delivered,
377                            start, end);
378            }
379    
380            public static int getDeliveredUserNotificationEventsCount(long userId,
381                    boolean delivered)
382                    throws com.liferay.portal.kernel.exception.SystemException {
383                    return getService()
384                                       .getDeliveredUserNotificationEventsCount(userId, delivered);
385            }
386    
387            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getUserNotificationEvents(
388                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
389                    return getService().getUserNotificationEvents(userId);
390            }
391    
392            /**
393            * @deprecated As of 6.2.0 {@link #getArchivedUserNotificationEvents(long,
394            boolean)}
395            */
396            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getUserNotificationEvents(
397                    long userId, boolean archived)
398                    throws com.liferay.portal.kernel.exception.SystemException {
399                    return getService().getUserNotificationEvents(userId, archived);
400            }
401    
402            /**
403            * @deprecated As of 6.2.0 {@link #getArchivedUserNotificationEvents(long,
404            boolean, int, int)}
405            */
406            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getUserNotificationEvents(
407                    long userId, boolean archived, int start, int end)
408                    throws com.liferay.portal.kernel.exception.SystemException {
409                    return getService()
410                                       .getUserNotificationEvents(userId, archived, start, end);
411            }
412    
413            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> getUserNotificationEvents(
414                    long userId, int start, int end)
415                    throws com.liferay.portal.kernel.exception.SystemException {
416                    return getService().getUserNotificationEvents(userId, start, end);
417            }
418    
419            public static int getUserNotificationEventsCount(long userId)
420                    throws com.liferay.portal.kernel.exception.SystemException {
421                    return getService().getUserNotificationEventsCount(userId);
422            }
423    
424            /**
425            * @deprecated As of 6.2.0 {@link
426            #getArchivedUserNotificationEventsCount(long, boolean)}
427            */
428            public static int getUserNotificationEventsCount(long userId,
429                    boolean archived)
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    return getService().getUserNotificationEventsCount(userId, archived);
432            }
433    
434            public static com.liferay.portal.model.UserNotificationEvent updateUserNotificationEvent(
435                    java.lang.String uuid, long companyId, boolean archive)
436                    throws com.liferay.portal.kernel.exception.SystemException {
437                    return getService().updateUserNotificationEvent(uuid, companyId, archive);
438            }
439    
440            public static java.util.List<com.liferay.portal.model.UserNotificationEvent> updateUserNotificationEvents(
441                    java.util.Collection<java.lang.String> uuids, long companyId,
442                    boolean archive)
443                    throws com.liferay.portal.kernel.exception.SystemException {
444                    return getService()
445                                       .updateUserNotificationEvents(uuids, companyId, archive);
446            }
447    
448            public static UserNotificationEventLocalService getService() {
449                    if (_service == null) {
450                            _service = (UserNotificationEventLocalService)PortalBeanLocatorUtil.locate(UserNotificationEventLocalService.class.getName());
451    
452                            ReferenceRegistry.registerReference(UserNotificationEventLocalServiceUtil.class,
453                                    "_service");
454                    }
455    
456                    return _service;
457            }
458    
459            /**
460             * @deprecated As of 6.2.0
461             */
462            public void setService(UserNotificationEventLocalService service) {
463            }
464    
465            private static UserNotificationEventLocalService _service;
466    }