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