
com.payneteasy.superfly.service.impl.NotificationServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of superfly-service Show documentation
Show all versions of superfly-service Show documentation
Service layer classes, including DAO layer too
package com.payneteasy.superfly.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;
import com.payneteasy.superfly.dao.SubsystemDao;
import com.payneteasy.superfly.model.SubsystemToNotify;
import com.payneteasy.superfly.notification.Notifier;
import com.payneteasy.superfly.notification.UsersChangedNotification;
import com.payneteasy.superfly.service.NotificationService;
@Transactional
public class NotificationServiceImpl implements NotificationService {
private Notifier notifier;
private SubsystemDao subsystemDao;
@Required
public void setNotifier(Notifier notifier) {
this.notifier = notifier;
}
@Required
public void setSubsystemDao(SubsystemDao subsystemDao) {
this.subsystemDao = subsystemDao;
}
public void notifyAboutUsersChanged() {
List subsystems = subsystemDao.getSubsystemsAllowingToListUsers();
List notifications = new ArrayList<>(subsystems.size());
for (SubsystemToNotify subsystem : subsystems) {
if (subsystem.isSendCallbacks()) {
UsersChangedNotification notification = new UsersChangedNotification();
notification.setCallbackUri(subsystem.getCallbackInformation());
notifications.add(notification);
}
}
notifier.notifyAboutUsersChanged(notifications);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy