tom | cbff939 | 2014-09-10 00:45:23 -0700 | [diff] [blame] | 1 | package org.onlab.onos.event; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | /** |
| 6 | * Abstraction of an accumulator capable of collecting events and at some |
| 7 | * point in time triggers processing of all previously accumulated events. |
| 8 | */ |
| 9 | public interface EventAccumulator { |
| 10 | |
| 11 | /** |
| 12 | * Adds an event to the current batch. This operation may, or may not |
| 13 | * trigger processing of the current batch of events. |
| 14 | * |
| 15 | * @param event event to be added to the current batch |
| 16 | */ |
| 17 | void add(Event event); |
| 18 | |
| 19 | /** |
| 20 | * Processes the specified list of accumulated events. |
| 21 | * |
| 22 | * @param events list of accumulated events |
| 23 | */ |
| 24 | void processEvents(List<Event> events); |
| 25 | |
| 26 | } |