Added notion of a general Store abstraction and wired it up in ClusterStore.
diff --git a/core/api/src/main/java/org/onlab/onos/store/AbstractStore.java b/core/api/src/main/java/org/onlab/onos/store/AbstractStore.java
new file mode 100644
index 0000000..efd0d03
--- /dev/null
+++ b/core/api/src/main/java/org/onlab/onos/store/AbstractStore.java
@@ -0,0 +1,33 @@
+package org.onlab.onos.store;
+
+import org.onlab.onos.event.Event;
+
+/**
+ * Base implementation of a store.
+ */
+public class AbstractStore<E extends Event, D extends StoreDelegate<E>>
+ implements Store<E, D> {
+
+ protected D delegate;
+
+ @Override
+ public void setDelegate(D delegate) {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public D getDelegate() {
+ return delegate;
+ }
+
+ /**
+ * Notifies the delegate with the specified event.
+ *
+ * @param event event to delegate
+ */
+ protected void notifyDelegate(E event) {
+ if (delegate != null) {
+ delegate.notify(event);
+ }
+ }
+}