Class ConnectionLimitNotificationService
java.lang.Object
energy.eddie.aiida.services.connectionlimit.ConnectionLimitNotificationService
Notifies users by email when a connection limit violation starts and when it ends.
Notifications are only sent when a mail server is configured (spring.mail.host) and the user has set a contact email.
Both conditions are evaluated per notification and can change at any time.
Failures are logged and never propagated, as they must not affect the detection of violations.
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionLimitNotificationService(UserSettingsService userSettingsService, org.springframework.beans.factory.ObjectProvider<org.springframework.mail.javamail.JavaMailSender> mailSenderProvider, String sender) -
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyViolationEnded(Permission permission, ConnectionLimitViolation violation, BigDecimal recoveredPowerKw) Notifies the user that the violation ended.voidnotifyViolationStarted(Permission permission, ConnectionLimitViolation violation)
-
Constructor Details
-
ConnectionLimitNotificationService
public ConnectionLimitNotificationService(UserSettingsService userSettingsService, org.springframework.beans.factory.ObjectProvider<org.springframework.mail.javamail.JavaMailSender> mailSenderProvider, @Value("${spring.mail.username:}") String sender)
-
-
Method Details
-
notifyViolationStarted
-
notifyViolationEnded
public void notifyViolationEnded(Permission permission, ConnectionLimitViolation violation, BigDecimal recoveredPowerKw) Notifies the user that the violation ended.- Parameters:
recoveredPowerKw- the measured power that is back within the limits.
-