Search in sources :

Example 11 with ClientApplicationStatusChangedEvent

use of de.codecentric.boot.admin.event.ClientApplicationStatusChangedEvent in project spring-boot-admin by codecentric.

the class AbstractStatusChangeNotifier method shouldNotify.

@Override
protected boolean shouldNotify(ClientApplicationEvent event) {
    if (event instanceof ClientApplicationStatusChangedEvent) {
        ClientApplicationStatusChangedEvent statusChange = (ClientApplicationStatusChangedEvent) event;
        String from = statusChange.getFrom().getStatus();
        String to = statusChange.getTo().getStatus();
        return Arrays.binarySearch(ignoreChanges, from + ":" + to) < 0 && Arrays.binarySearch(ignoreChanges, "*:" + to) < 0 && Arrays.binarySearch(ignoreChanges, from + ":*") < 0;
    }
    return false;
}
Also used : ClientApplicationStatusChangedEvent(de.codecentric.boot.admin.event.ClientApplicationStatusChangedEvent)

Aggregations

ClientApplicationStatusChangedEvent (de.codecentric.boot.admin.event.ClientApplicationStatusChangedEvent)11 Test (org.junit.Test)9 StatusInfo (de.codecentric.boot.admin.model.StatusInfo)5 HashMap (java.util.HashMap)2 HttpEntity (org.springframework.http.HttpEntity)2 ClientApplicationEvent (de.codecentric.boot.admin.event.ClientApplicationEvent)1 Application (de.codecentric.boot.admin.model.Application)1 SimpleMailMessage (org.springframework.mail.SimpleMailMessage)1