2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
8 * Unless otherwise specified, all software contained herein is licensed
9 * under the Apache License, Version 2.0 (the "License");
10 * you may not use this software except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * Unless otherwise specified, all documentation contained herein is licensed
22 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23 * you may not use this documentation except in compliance with the License.
24 * You may obtain a copy of the License at
26 * https://creativecommons.org/licenses/by/4.0/
28 * Unless required by applicable law or agreed to in writing, documentation
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 * ============LICENSE_END============================================
38 package org.onap.portalapp.portal.service;
40 import java.util.List;
42 import org.onap.portalapp.portal.domain.EPUser;
43 import org.onap.portalapp.portal.domain.EcompAppRole;
44 import org.onap.portalapp.portal.transport.EpNotificationItem;
45 import org.onap.portalapp.portal.transport.EpNotificationItemVO;
46 import org.onap.portalapp.portal.transport.EpRoleNotificationItem;
48 public interface UserNotificationService {
51 * Gets the specified notifications with userId from ep_notification
55 * @return the notifications with the specified userId
58 List<EpNotificationItem> getNotifications(Long userId);
61 * Gets the specified roles from ep_role_notification
63 * @param notificationId
65 * @return the roles for a specified notification
68 List<EpRoleNotificationItem> getNotificationRoles(Long notificationId);
71 * Get all app role list from the fn_app and fn_role table
73 * @return list of all roles associated with the applications
75 List<EcompAppRole> getAppRoleList();
78 * Marks the notification as viewed by the specified user.
80 * @param notificationId
83 void setNotificationRead(Long notificationId, int userId);
86 * Saves the specified notification to the table ep_notification
88 * @param notificationItem
92 String saveNotification(EpNotificationItem notificationItem) throws Exception;
95 * Gets the specified notification with the userId for view all recent
100 * @return the notification list
103 List<EpNotificationItemVO> getNotificationHistoryVO(Long userId);
106 * Gets the notifications with the userId for user notifications
110 * @return the notification list
113 List<EpNotificationItemVO> getAdminNotificationVOS(Long userId);
116 * Gets the user list from fn_user
120 * @return the users list
123 List<EPUser> getUsersByOrgIds(List<String> OrgIds);
126 * Gets the received recipient to whom the notification is delivered from
129 * @param notificationId
131 * @return the active users
134 List<String> getMessageRecipients(Long notificationId);
137 * delete the records from ep_notification table when the endtime is more
142 void deleteNotificationsFromEpNotificationTable();
145 * delete the records from ep_user_notification table when the endtime is
149 void deleteNotificationsFromEpUserNotificationTable();
152 * delete the records from ep_role_notification table when the endtime is
156 void deleteNotificationsFromEpRoleNotificationTable();