Class ConnectionLimitNotificationService

java.lang.Object
energy.eddie.aiida.services.connectionlimit.ConnectionLimitNotificationService

@Service public class ConnectionLimitNotificationService extends Object
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 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

      public void notifyViolationStarted(Permission permission, ConnectionLimitViolation violation)
    • 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.