Updates to Intent Manager and store interface
Change-Id: Ida612bf5d0f4abe7e81d2f307a80f989603015e7
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentAccumulator.java b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentAccumulator.java
index bc7a7f5..12369cc 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentAccumulator.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentAccumulator.java
@@ -17,6 +17,7 @@
import com.google.common.collect.Maps;
import org.onlab.util.AbstractAccumulator;
+import org.onosproject.net.intent.IntentBatchDelegate;
import org.onosproject.net.intent.IntentData;
import java.util.List;
@@ -37,16 +38,20 @@
// TODO: Convert to use HashedWheelTimer or produce a variant of that; then decide which we want to adopt
private static final Timer TIMER = new Timer("intent-op-batching");
+ private final IntentBatchDelegate delegate;
+
/**
* Creates an intent operation accumulator.
*/
- protected IntentAccumulator() {
+ protected IntentAccumulator(IntentBatchDelegate delegate) {
super(TIMER, DEFAULT_MAX_EVENTS, DEFAULT_MAX_BATCH_MS, DEFAULT_MAX_IDLE_MS);
+ this.delegate = delegate;
}
@Override
public void processEvents(List<IntentData> ops) {
Map<String, IntentData> opMap = reduce(ops);
+ delegate.execute(opMap.values());
// FIXME kick off the work
//for (IntentData data : opMap.values()) {}
}