@Test public void removeAllTest() { String eventId = "event1"; OadrEvent createOadrEvent = createOadrEvent(eventId, 0L); oadr20bVENEiEventService.saveOadrEvent(VTN_SOURCE, createOadrEvent); eventId = "event2"; createOadrEvent = createOadrEvent(eventId, 0L); oadr20bVENEiEventService.saveOadrEvent(VTN_SOURCE, createOadrEvent); eventId = "event3"; createOadrEvent = createOadrEvent(eventId, 0L); oadr20bVENEiEventService.saveOadrEvent(VTN_SOURCE, createOadrEvent); String[] eventIdList = { "event2", "event3" }; oadr20bVENEiEventService.removeAll(VTN_SOURCE, Arrays.asList(eventIdList)); assertEquals(1, oadr20bVENEiEventService.getOadrEvents(VTN_SOURCE).size()); assertNotNull(oadr20bVENEiEventService.getOadrEvents(VTN_SOURCE).get("event1")); oadr20bVENEiEventService.clearOadrEvents(); }
public void removeAll(VtnSessionConfiguration vtnConfiguration, List<String> eventIdList) { eventIdList.forEach(key -> { OadrEvent oadrEvent = oadrEvents.get(vtnConfiguration.getVtnId()).get(key); if (oadrEvent != null) { if (listeners != null) { listeners.forEach(listener -> listener.onDeleteEvent(vtnConfiguration, oadrEvent)); } oadrEvents.get(vtnConfiguration.getVtnId()).remove(key); } }); }
Oadr20bVENEiEventService { public void removeAll(VtnSessionConfiguration vtnConfiguration, List<String> eventIdList) { eventIdList.forEach(key -> { OadrEvent oadrEvent = oadrEvents.get(vtnConfiguration.getVtnId()).get(key); if (oadrEvent != null) { if (listeners != null) { listeners.forEach(listener -> listener.onDeleteEvent(vtnConfiguration, oadrEvent)); } oadrEvents.get(vtnConfiguration.getVtnId()).remove(key); } }); } }
Oadr20bVENEiEventService { public void removeAll(VtnSessionConfiguration vtnConfiguration, List<String> eventIdList) { eventIdList.forEach(key -> { OadrEvent oadrEvent = oadrEvents.get(vtnConfiguration.getVtnId()).get(key); if (oadrEvent != null) { if (listeners != null) { listeners.forEach(listener -> listener.onDeleteEvent(vtnConfiguration, oadrEvent)); } oadrEvents.get(vtnConfiguration.getVtnId()).remove(key); } }); }  }
Oadr20bVENEiEventService { public void removeAll(VtnSessionConfiguration vtnConfiguration, List<String> eventIdList) { eventIdList.forEach(key -> { OadrEvent oadrEvent = oadrEvents.get(vtnConfiguration.getVtnId()).get(key); if (oadrEvent != null) { if (listeners != null) { listeners.forEach(listener -> listener.onDeleteEvent(vtnConfiguration, oadrEvent)); } oadrEvents.get(vtnConfiguration.getVtnId()).remove(key); } }); }  OadrResponseType oadrDistributeEvent(VtnSessionConfiguration vtnConfiguration, OadrDistributeEventType event); boolean isKnownEvent(VtnSessionConfiguration vtnConfiguration, OadrEvent event); boolean isUpdatedEvent(VtnSessionConfiguration vtnConfiguration, String requestId, OadrEvent event); void saveOadrEvent(VtnSessionConfiguration vtnConfiguration, OadrEvent event); void removeAll(VtnSessionConfiguration vtnConfiguration, List<String> eventIdList); Map<String, OadrEvent> getOadrEvents(VtnSessionConfiguration vtnConfiguration); void putOadrEvents(VtnSessionConfiguration vtnConfiguration, OadrEvent event); List<ScheduledFuture<?>> getScheduledTask(VtnSessionConfiguration vtnConfiguration, String eventId); void addScheduledTask(VtnSessionConfiguration vtnConfiguration, String eventId, ScheduledFuture<?> task); List<String> findMissingEventID(VtnSessionConfiguration vtnConfiguration, List<String> retrievedIdList); void clearOadrEvents(); void addListener(Oadr20bVENEiEventServiceListener listener); Object handle(VtnSessionConfiguration multiConfig, String raw, OadrPayload oadrPayload); String request(String username, String payload); }
Oadr20bVENEiEventService { public void removeAll(VtnSessionConfiguration vtnConfiguration, List<String> eventIdList) { eventIdList.forEach(key -> { OadrEvent oadrEvent = oadrEvents.get(vtnConfiguration.getVtnId()).get(key); if (oadrEvent != null) { if (listeners != null) { listeners.forEach(listener -> listener.onDeleteEvent(vtnConfiguration, oadrEvent)); } oadrEvents.get(vtnConfiguration.getVtnId()).remove(key); } }); }  OadrResponseType oadrDistributeEvent(VtnSessionConfiguration vtnConfiguration, OadrDistributeEventType event); boolean isKnownEvent(VtnSessionConfiguration vtnConfiguration, OadrEvent event); boolean isUpdatedEvent(VtnSessionConfiguration vtnConfiguration, String requestId, OadrEvent event); void saveOadrEvent(VtnSessionConfiguration vtnConfiguration, OadrEvent event); void removeAll(VtnSessionConfiguration vtnConfiguration, List<String> eventIdList); Map<String, OadrEvent> getOadrEvents(VtnSessionConfiguration vtnConfiguration); void putOadrEvents(VtnSessionConfiguration vtnConfiguration, OadrEvent event); List<ScheduledFuture<?>> getScheduledTask(VtnSessionConfiguration vtnConfiguration, String eventId); void addScheduledTask(VtnSessionConfiguration vtnConfiguration, String eventId, ScheduledFuture<?> task); List<String> findMissingEventID(VtnSessionConfiguration vtnConfiguration, List<String> retrievedIdList); void clearOadrEvents(); void addListener(Oadr20bVENEiEventServiceListener listener); Object handle(VtnSessionConfiguration multiConfig, String raw, OadrPayload oadrPayload); String request(String username, String payload);  }