Security/ Package Name changes
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / service / UserNotificationService.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
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
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
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
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
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.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.onap.portalapp.portal.service;
39
40 import java.util.List;
41
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;
47
48 public interface UserNotificationService {
49
50         /**
51          * Gets the specified notifications with userId from ep_notification
52          * 
53          * @param userId
54          * 
55          * @return the notifications with the specified userId
56          */
57
58         List<EpNotificationItem> getNotifications(Long userId);
59
60         /**
61          * Gets the specified roles from ep_role_notification
62          * 
63          * @param notificationId
64          * 
65          * @return the roles for a specified notification
66          */
67
68         List<EpRoleNotificationItem> getNotificationRoles(Long notificationId);
69
70         /**
71          * Get all app role list from the fn_app and fn_role table
72          * 
73          * @return list of all roles associated with the applications
74          */
75         List<EcompAppRole> getAppRoleList();
76
77         /**
78          * Marks the notification as viewed by the specified user.
79          * 
80          * @param notificationId
81          * @param userId
82          */
83         void setNotificationRead(Long notificationId, int userId);
84
85         /**
86          * Saves the specified notification to the table ep_notification
87          * 
88          * @param notificationItem
89          * @throws Exception
90          */
91
92         String saveNotification(EpNotificationItem notificationItem) throws Exception;
93
94         /**
95          * Gets the specified notification with the userId for view all recent
96          * notifications
97          * 
98          * @param userId
99          * 
100          * @return the notification list
101          */
102
103         List<EpNotificationItemVO> getNotificationHistoryVO(Long userId);
104
105         /**
106          * Gets the notifications with the userId for user notifications
107          * 
108          * @param userId
109          * 
110          * @return the notification list
111          */
112
113         List<EpNotificationItemVO> getAdminNotificationVOS(Long userId);
114
115         /**
116          * Gets the user list from fn_user
117          * 
118          * @param OrgIds
119          * 
120          * @return the users list
121          */
122
123         List<EPUser> getUsersByOrgIds(List<String> OrgIds);
124
125         /**
126          * Gets the received recipient to whom the notification is delivered from
127          * external system
128          * 
129          * @param notificationId
130          * 
131          * @return the active users
132          */
133
134         List<String> getMessageRecipients(Long notificationId);
135
136         /**
137          * delete the records from ep_notification table when the endtime is more
138          * than 3 months
139          * 
140          */
141
142         void deleteNotificationsFromEpNotificationTable();
143
144         /**
145          * delete the records from ep_user_notification table when the endtime is
146          * more than 3 months
147          * 
148          */
149         void deleteNotificationsFromEpUserNotificationTable();
150
151         /**
152          * delete the records from ep_role_notification table when the endtime is
153          * more than 3 months
154          * 
155          */
156         void deleteNotificationsFromEpRoleNotificationTable();
157
158 }