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