@Override public void setUserNotificationSetting(String userId, List<String> selectedServicesId, List<Type> notificationTypes, boolean isEnable) { if (atLeastOneServiceIsUnknown(selectedServicesId)) throw new UnknownNotificationServiceException(selectedServicesId.toString()); List<String> eventTypeNames = notificationTypes.stream().map(Enum::name).collect(Collectors.toList()); if (selectedServicesId.isEmpty()) selectedServicesId = this.registeredServicesId; notificationSettingRepository.saveNotificationSetting(userId, selectedServicesId, eventTypeNames, isEnable); }
public NotificationCenterServiceImpl(List<NotificationService> fileEventHandlerServices, NotificationSettingRepository notificationSettingRepository, ServiceConfigurationRepository serviceConfigurationRepository) { this.fileEventHandlerServices = fileEventHandlerServices; this.notificationSettingRepository = notificationSettingRepository; this.serviceConfigurationRepository = serviceConfigurationRepository; this.registeredServicesId = getRegisteredServicesId(fileEventHandlerServices); }
@Override public void sendNotification(Type type, String userId, List<File> files, Map<String, Permission> sharedUsersIdWithPermission) { for (NotificationService fileEventHandlerService : fileEventHandlerServices) { String serviceId = fileEventHandlerService.getServiceId(); NotificationServiceConfiguration notificationServiceConfiguration = getServiceConfiguration(userId, serviceId); if (notificationIsEnable(userId, type, serviceId)) { fileEventHandlerService.sendNotification(notificationServiceConfiguration, type, userId, files, sharedUsersIdWithPermission); } } }
NotificationCenterService notificationCenterService = new NotificationCenterServiceImpl( Arrays.asList(mailNotificationService, ircNotificationService), notificationRepository,
NotificationCenterService notificationCenterService = new NotificationCenterServiceImpl( Arrays.asList(mailNotificationService, ircNotificationService), notificationRepository,