improved check events subscribed in the config
This commit is contained in:
parent
0417e471ac
commit
62a4a78d4f
|
@ -275,6 +275,12 @@ public class CatalogueBindingPlugin extends AbstractPlugin implements EventListe
|
||||||
|
|
||||||
List<Event> listEvents = eventsSub.getListEventSubscribed();
|
List<Event> listEvents = eventsSub.getListEventSubscribed();
|
||||||
log.info("List events is {}", listEvents);
|
log.info("List events is {}", listEvents);
|
||||||
|
|
||||||
|
if(listEvents==null) {
|
||||||
|
log.info("no event subscribed, returing false");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (listEvents.contains(observerd.getEvent())) {
|
if (listEvents.contains(observerd.getEvent())) {
|
||||||
log.info("the event {} is subscribed from config ", observerd.getEvent());
|
log.info("the event {} is subscribed from config ", observerd.getEvent());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -201,8 +201,13 @@ public class NotificationsPlugin extends AbstractPlugin implements EventListener
|
||||||
|
|
||||||
List<SubscribeNotificationEvent> listEvents = eventsSub.getListNotificationEventSubscribed();
|
List<SubscribeNotificationEvent> listEvents = eventsSub.getListNotificationEventSubscribed();
|
||||||
log.info("List events is {}", listEvents);
|
log.info("List events is {}", listEvents);
|
||||||
if (listEvents != null
|
|
||||||
&& listEvents.stream().anyMatch(sne -> sne.getEvent().equals(observerd.getEvent()))) {
|
if(listEvents==null) {
|
||||||
|
log.info("no event subscribed, returning false");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listEvents.stream().anyMatch(sne -> sne.getEvent().equals(observerd.getEvent()))) {
|
||||||
log.info("the event {} is subscribed from config ", observerd.getEvent());
|
log.info("the event {} is subscribed from config ", observerd.getEvent());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue