2  * ================================================================================
 
   4  * ================================================================================
 
   5  * Copyright (C) 2017 AT&T Intellectual Property
 
   6  * ================================================================================
 
   7  * Licensed under the Apache License, Version 2.0 (the "License");
 
   8  * you may not use this file except in compliance with the License.
 
   9  * You may obtain a copy of the License at
 
  11  *      http://www.apache.org/licenses/LICENSE-2.0
 
  13  * Unless required by applicable law or agreed to in writing, software
 
  14  * distributed under the License is distributed on an "AS IS" BASIS,
 
  15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  16  * See the License for the specific language governing permissions and
 
  17  * limitations under the License.
 
  18  * ================================================================================
 
  20 package org.openecomp.portalapp.portal.service;
 
  22 import java.util.List;
 
  24 import org.openecomp.portalapp.portal.domain.EPUser;
 
  25 import org.openecomp.portalapp.portal.domain.EcompAppRole;
 
  26 import org.openecomp.portalapp.portal.transport.EpNotificationItem;
 
  27 import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
 
  28 import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
 
  30 public interface UserNotificationService {
 
  33          * Gets the specified notifications with userId from ep_notification
 
  37          * @return the notifications with the specified userId
 
  40         List<EpNotificationItem> getNotifications(Long userId);
 
  43          * Gets the specified roles from ep_role_notification
 
  45          * @param notificationId
 
  47          * @return the roles for a specified notification
 
  50         List<EpRoleNotificationItem> getNotificationRoles(Long notificationId);
 
  53          * Get all app role list from the fn_app and fn_role table
 
  55          * @return list of all roles associated with the applications
 
  57         List<EcompAppRole> getAppRoleList();
 
  60          * Marks the notification as viewed by the specified user.
 
  62          * @param notificationId
 
  65         void setNotificationRead(Long notificationId, int userId);
 
  68          * Saves the specified notification to the table ep_notification
 
  70          * @param notificationItem
 
  74         String saveNotification(EpNotificationItem notificationItem) throws Exception;
 
  77          * Gets the specified notification with the userId for view all recent
 
  82          * @return the notification list
 
  85         List<EpNotificationItemVO> getNotificationHistoryVO(Long userId);
 
  88          * Gets the notifications with the userId for user notifications
 
  92          * @return the notification list
 
  95         List<EpNotificationItemVO> getAdminNotificationVOS(Long userId);
 
  98          * Gets the user list from fn_user
 
 102          * @return the users list
 
 105         List<EPUser> getUsersByOrgIds(List<String> OrgIds);
 
 108          * Gets the received recipient to whom the notification is delivered from
 
 111          * @param notificationId
 
 113          * @return the active users
 
 116         List<String> getMessageRecipients(Long notificationId);
 
 119          * delete the records from ep_notification table when the endtime is more
 
 124         void deleteNotificationsFromEpNotificationTable();
 
 127          * delete the records from ep_user_notification table when the endtime is
 
 131         void deleteNotificationsFromEpUserNotificationTable();
 
 134          * delete the records from ep_role_notification table when the endtime is
 
 138         void deleteNotificationsFromEpRoleNotificationTable();