Added support for a distributed set implementation that is backed by Consistent Map
Change-Id: Ic393d305d31abcdf1dd4c9afc3b9234f8d50da2d
diff --git a/core/api/src/main/java/org/onosproject/store/service/SetBuilder.java b/core/api/src/main/java/org/onosproject/store/service/SetBuilder.java
new file mode 100644
index 0000000..cd2e060
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/store/service/SetBuilder.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.store.service;
+
+import java.util.Set;
+
+/**
+ * Builder for distributed set.
+ *
+ * @param <E> type set elements.
+ */
+public interface SetBuilder<E> {
+
+ /**
+ * Sets the name of the set.
+ * <p>
+ * Each set is identified by a unique name.
+ * </p>
+ * <p>
+ * Note: This is a mandatory parameter.
+ * </p>
+ *
+ * @param name name of the set
+ * @return this SetBuilder
+ */
+ public SetBuilder<E> withName(String name);
+
+ /**
+ * Sets a serializer that can be used to serialize
+ * the elements add to the set. The serializer
+ * builder should be pre-populated with any classes that will be
+ * put into the set.
+ * <p>
+ * Note: This is a mandatory parameter.
+ * </p>
+ *
+ * @param serializer serializer
+ * @return this SetBuilder
+ */
+ public SetBuilder<E> withSerializer(Serializer serializer);
+
+ /**
+ * Builds an set based on the configuration options
+ * supplied to this builder.
+ *
+ * @return new set
+ * @throws java.lang.RuntimeException if a mandatory parameter is missing
+ */
+ public Set<E> build();
+}
\ No newline at end of file
diff --git a/core/api/src/main/java/org/onosproject/store/service/StorageService.java b/core/api/src/main/java/org/onosproject/store/service/StorageService.java
index c8a394d..e165a95 100644
--- a/core/api/src/main/java/org/onosproject/store/service/StorageService.java
+++ b/core/api/src/main/java/org/onosproject/store/service/StorageService.java
@@ -52,4 +52,12 @@
* @return builder for an eventually consistent map
*/
<K, V> ConsistentMapBuilder<K, V> consistentMapBuilder();
+
+ /**
+ * Creates a new distributed set builder.
+ *
+ * @param <E> set element type
+ * @return builder for an distributed set
+ */
+ <E> SetBuilder<E> setBuilder();
}
\ No newline at end of file