Introducing concept of a physical or logical region to facilitate
support of geographically distributed cluster and to lay ground
for multiple/filtered topology layouts.
Added implementation of manager and store; unit-tests included.
Change-Id: Ia01673a0b711b8785c0ea68768552c2f61d7ea6d
diff --git a/core/api/src/main/java/org/onosproject/cluster/NodeId.java b/core/api/src/main/java/org/onosproject/cluster/NodeId.java
index e5ab9dc..8b7d540 100644
--- a/core/api/src/main/java/org/onosproject/cluster/NodeId.java
+++ b/core/api/src/main/java/org/onosproject/cluster/NodeId.java
@@ -15,14 +15,19 @@
*/
package org.onosproject.cluster;
-import java.util.Objects;
+import org.onlab.util.Identifier;
/**
* Controller cluster identity.
*/
-public class NodeId implements Comparable<NodeId> {
+public final class NodeId extends Identifier<String> implements Comparable<NodeId> {
- private final String id;
+ /**
+ * Constructor for serialization.
+ */
+ private NodeId() {
+ super("");
+ }
/**
* Creates a new cluster node identifier from the specified string.
@@ -30,34 +35,22 @@
* @param id string identifier
*/
public NodeId(String id) {
- this.id = id;
+ super(id);
}
- @Override
- public int hashCode() {
- return id.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof NodeId) {
- final NodeId other = (NodeId) obj;
- return Objects.equals(this.id, other.id);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return id;
+ /**
+ * Creates a new cluster node identifier from the specified string.
+ *
+ * @param id string identifier
+ * @return node id
+ */
+ public static NodeId nodeId(String id) {
+ return new NodeId(id);
}
@Override
public int compareTo(NodeId that) {
- return this.id.compareTo(that.id);
+ return identifier.compareTo(that.identifier);
}
}
diff --git a/core/api/src/main/java/org/onosproject/net/key/DeviceKeyId.java b/core/api/src/main/java/org/onosproject/net/key/DeviceKeyId.java
index 12c1d95..d7cbdbe 100644
--- a/core/api/src/main/java/org/onosproject/net/key/DeviceKeyId.java
+++ b/core/api/src/main/java/org/onosproject/net/key/DeviceKeyId.java
@@ -16,21 +16,18 @@
package org.onosproject.net.key;
-import java.util.Objects;
-
-import static com.google.common.base.Preconditions.checkNotNull;
+import org.onlab.util.Identifier;
/**
- * Device key Id definition.
+ * Device key identifier backed by a string value.
*/
-public final class DeviceKeyId {
- private final String identifier;
+public final class DeviceKeyId extends Identifier<String> {
/**
* Constructor for serialization.
*/
private DeviceKeyId() {
- this.identifier = null;
+ super();
}
/**
@@ -39,63 +36,17 @@
* @param value the underlying value of this ID
*/
private DeviceKeyId(String value) {
- this.identifier = checkNotNull(value, "Device Key Id cannot be null.");
+ super(value);
}
/**
- * Static method to construct a device key identifier.
+ * Creates a new device key identifier.
*
- * @param id for the device key identifier
+ * @param id backing identifier value
* @return device key identifier
*/
- public static final DeviceKeyId deviceKeyId(String id) {
+ public static DeviceKeyId deviceKeyId(String id) {
return new DeviceKeyId(id);
}
- /**
- * Returns the identifier of the device key identifier.
- *
- * @return identifier
- */
- public String id() {
- return identifier;
- }
-
- /**
- * Returns the hashcode of the identifier.
- *
- * @return hashcode
- */
- @Override
- public int hashCode() {
- return identifier.hashCode();
- }
-
- /**
- * Compares two device key identifiers for equality.
- *
- * @param obj to compare against
- * @return true if the objects are equal, false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof DeviceKeyId) {
- final DeviceKeyId that = (DeviceKeyId) obj;
- return this.getClass() == that.getClass() &&
- Objects.equals(this.identifier, that.identifier);
- }
- return false;
- }
-
- /**
- * Returns a string representation of a DeviceKeyId.
- *
- * @return string
- */
- public String toString() {
- return identifier;
- }
}
diff --git a/core/api/src/main/java/org/onosproject/net/region/DefaultRegion.java b/core/api/src/main/java/org/onosproject/net/region/DefaultRegion.java
new file mode 100644
index 0000000..d828880
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/DefaultRegion.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.collect.ImmutableList;
+import org.onosproject.cluster.NodeId;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+
+/**
+ * Default implementation of a region.
+ */
+public final class DefaultRegion implements Region {
+
+ private final RegionId id;
+ private final String name;
+ private final Type type;
+ private final List<Set<NodeId>> masters;
+
+ /**
+ * Creates a region using the supplied information.
+ *
+ * @param id region identifier
+ * @param name friendly name
+ * @param type region type
+ * @param masters list of sets of cluster node identifiers; in order of mastership
+ */
+ public DefaultRegion(RegionId id, String name, Type type, List<Set<NodeId>> masters) {
+ this.id = id;
+ this.name = name;
+ this.type = type;
+ this.masters = masters != null ? ImmutableList.copyOf(masters) : ImmutableList.of();
+ }
+
+ @Override
+ public RegionId id() {
+ return id;
+ }
+
+ @Override
+ public String name() {
+ return name;
+ }
+
+ @Override
+ public Type type() {
+ return type;
+ }
+
+ @Override
+ public List<Set<NodeId>> masters() {
+ return masters;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name, type, masters);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof DefaultRegion) {
+ final DefaultRegion that = (DefaultRegion) obj;
+ return Objects.equals(this.id, that.id)
+ && Objects.equals(this.name, that.name)
+ && Objects.equals(this.type, that.type)
+ && Objects.equals(this.masters, that.masters);
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("id", id)
+ .add("name", name)
+ .add("type", type)
+ .add("masters", masters)
+ .toString();
+ }
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/Region.java b/core/api/src/main/java/org/onosproject/net/region/Region.java
new file mode 100644
index 0000000..3a9f60a
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/Region.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import org.onosproject.cluster.NodeId;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Representation of a group of devices located in a common physical or
+ * logical region. Optionally, devices in the region can share the same
+ * cluster nodes mastership affinities.
+ */
+public interface Region {
+
+ /**
+ * Coarse representation of the type of the region.
+ */
+ enum Type {
+ /**
+ * Region represents an entire continent.
+ */
+ CONTINENT,
+
+ /**
+ * Region represents an entire country.
+ */
+ COUNTRY,
+
+ /**
+ * Region represents a metropolitan area.
+ */
+ METRO,
+
+ /**
+ * Region represents a campus.
+ */
+ CAMPUS,
+
+ /**
+ * Region represents a building.
+ */
+ BUILDING,
+
+ /**
+ * Region represents a building floor.
+ */
+ FLOOR,
+
+ /**
+ * Region represents a room.
+ */
+ ROOM,
+
+ /**
+ * Region represents a rack.
+ */
+ RACK,
+
+ /**
+ * Region represents a logical grouping.
+ */
+ LOGICAL_GROUP
+ }
+
+ /**
+ * Returns the unique identifier of the region.
+ *
+ * @return region identifier
+ */
+ RegionId id();
+
+ /**
+ * Returns the friendly region name that can be used for display purposes.
+ *
+ * @return friendly name of the region
+ */
+ String name();
+
+ /**
+ * Returns the region type.
+ *
+ * @return region type
+ */
+ Type type();
+
+ /**
+ * Returns the list of master node sets. The sets of cluster node identifiers
+ * should be listed in the order of preferred mastership. Nodes specified
+ * in each sets should be considered with equally priority and devices in
+ * the region can be balanced between them based on other criteria, e.g. load.
+ *
+ * @return list of preferred master node sets
+ */
+ List<Set<NodeId>> masters();
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/RegionAdminService.java b/core/api/src/main/java/org/onosproject/net/region/RegionAdminService.java
new file mode 100644
index 0000000..e402a7d
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/RegionAdminService.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import org.onosproject.cluster.NodeId;
+import org.onosproject.net.DeviceId;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Service for interacting with inventory of network control regions.
+ */
+public interface RegionAdminService extends RegionService {
+
+ /**
+ * Creates a new region using the supplied data.
+ *
+ * @param regionId region identifier
+ * @param name friendly name
+ * @param type region type
+ * @param masterNodeIds list of sets of master nodes; null implies empty list
+ * @return new region descriptor
+ * @throws IllegalArgumentException if region already exists
+ */
+ Region createRegion(RegionId regionId, String name, Region.Type type,
+ List<Set<NodeId>> masterNodeIds);
+
+ /**
+ * Update the specified region using the new set of data.
+ *
+ * @param regionId region identifier
+ * @param name friendly name
+ * @param type region type
+ * @param masterNodeIds list of sets of master nodes; null implies empty list
+ * @return new region descriptor
+ */
+ Region updateRegion(RegionId regionId, String name, Region.Type type,
+ List<Set<NodeId>> masterNodeIds);
+
+ /**
+ * Removes the specified region using the new set of data.
+ *
+ * @param regionId region identifier
+ */
+ void removeRegion(RegionId regionId);
+
+ /**
+ * Adds the specified collection of devices to the region.
+ *
+ * @param regionId region identifier
+ * @param deviceIds list of device identifiers
+ */
+ void addDevices(RegionId regionId, Collection<DeviceId> deviceIds);
+
+ /**
+ * Removes the specified collection of devices from the region.
+ *
+ * @param regionId region identifier
+ * @param deviceIds list of device identifiers
+ */
+ void removeDevices(RegionId regionId, Collection<DeviceId> deviceIds);
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/RegionEvent.java b/core/api/src/main/java/org/onosproject/net/region/RegionEvent.java
new file mode 100644
index 0000000..6f0abd8
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/RegionEvent.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import com.google.common.collect.ImmutableSet;
+import org.onosproject.event.AbstractEvent;
+import org.onosproject.net.DeviceId;
+
+import java.util.Set;
+
+/**
+ * Describes region event.
+ */
+public class RegionEvent extends AbstractEvent<RegionEvent.Type, Region> {
+
+ private final Set<DeviceId> deviceIds;
+
+ public enum Type {
+ /**
+ * Signifies that a new region was created.
+ */
+ REGION_ADDED,
+
+ /**
+ * Signifies that a region was updated.
+ */
+ REGION_REMOVED,
+
+ /**
+ * Signifies that a region was removed.
+ */
+ REGION_UPDATED,
+
+ /**
+ * Signifies that a region device membership has changed.
+ */
+ REGION_MEMBERSHIP_CHANGED
+ }
+
+ /**
+ * Creates an event of a given type and for the specified region and the
+ * current time.
+ *
+ * @param type device event type
+ * @param region event region subject
+ */
+ public RegionEvent(Type type, Region region) {
+ this(type, region, null);
+ }
+
+ /**
+ * Creates an event of a given type and for the specified region, device
+ * id list and the current time.
+ *
+ * @param type device event type
+ * @param region event region subject
+ * @param deviceIds optional set of device ids
+ */
+ public RegionEvent(Type type, Region region, Set<DeviceId> deviceIds) {
+ super(type, region);
+ this.deviceIds = deviceIds != null ? ImmutableSet.copyOf(deviceIds) : ImmutableSet.of();
+ }
+
+ /**
+ * Creates an event of a given type and for the specified device and time.
+ *
+ * @param type device event type
+ * @param region event region subject
+ * @param deviceIds optional set of device ids
+ * @param time occurrence time
+ */
+ public RegionEvent(Type type, Region region, Set<DeviceId> deviceIds, long time) {
+ super(type, region, time);
+ this.deviceIds = deviceIds != null ? ImmutableSet.copyOf(deviceIds) : ImmutableSet.of();
+ }
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/RegionId.java b/core/api/src/main/java/org/onosproject/net/region/RegionId.java
new file mode 100644
index 0000000..0754f6e
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/RegionId.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import org.onlab.util.Identifier;
+
+/**
+ * Region identifier backed by a string value.
+ */
+public final class RegionId extends Identifier<String> {
+
+ /**
+ * Constructor for serialization.
+ */
+ private RegionId() {
+ super();
+ }
+
+ /**
+ * Constructs the ID corresponding to a given string value.
+ *
+ * @param value the underlying value of this ID
+ */
+ private RegionId(String value) {
+ super(value);
+ }
+
+ /**
+ * Creates a new region identifier.
+ *
+ * @param id backing identifier value
+ * @return region identifier
+ */
+ public static RegionId regionId(String id) {
+ return new RegionId(id);
+ }
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/RegionListener.java b/core/api/src/main/java/org/onosproject/net/region/RegionListener.java
new file mode 100644
index 0000000..1a41c76
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/RegionListener.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import org.onosproject.event.EventListener;
+
+/**
+ * Entity capable of receiving region related events.
+ */
+public interface RegionListener extends EventListener<RegionEvent> {
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/RegionService.java b/core/api/src/main/java/org/onosproject/net/region/RegionService.java
new file mode 100644
index 0000000..9f16aff
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/RegionService.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import org.onosproject.net.DeviceId;
+
+import java.util.Set;
+
+/**
+ * Service for interacting with inventory of network control regions.
+ */
+public interface RegionService {
+
+ /**
+ * Returns set of all regions.
+ *
+ * @return set of regions
+ */
+ Set<Region> getRegions();
+
+ /**
+ * Returns the region with the specified identifier.
+ *
+ * @param regionId region identifier
+ * @return region
+ * @throws org.onlab.util.ItemNotFoundException if region with given
+ * id does not exist
+ */
+ Region getRegion(RegionId regionId);
+
+ /**
+ * Returns the region to which the specified device belongs.
+ *
+ * @param deviceId device identifier
+ * @return region or null if device does not belong to any region
+ */
+ Region getRegionForDevice(DeviceId deviceId);
+
+ /**
+ * Returns the set of devices that belong to the specified region.
+ *
+ * @param regionId region identifier
+ * @return set of identifiers for devices in the given region
+ */
+ Set<DeviceId> getRegionDevices(RegionId regionId);
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/RegionStore.java b/core/api/src/main/java/org/onosproject/net/region/RegionStore.java
new file mode 100644
index 0000000..6ba1354
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/RegionStore.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import org.onosproject.cluster.NodeId;
+import org.onosproject.net.DeviceId;
+import org.onosproject.store.Store;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Manages inventory of regions of devices; not intended for direct use.
+ */
+public interface RegionStore extends Store<RegionEvent, RegionStoreDelegate> {
+
+ /**
+ * Returns set of all regions.
+ *
+ * @return set of regions
+ */
+ Set<Region> getRegions();
+
+ /**
+ * Returns the region with the specified identifier.
+ *
+ * @param regionId region identifier
+ * @return region
+ * @throws org.onlab.util.ItemNotFoundException if region with given
+ * id does not exist
+ */
+ Region getRegion(RegionId regionId);
+
+ /**
+ * Returns the region to which the specified device belongs.
+ *
+ * @param deviceId device identifier
+ * @return region or null if device does not belong to any region
+ */
+ Region getRegionForDevice(DeviceId deviceId);
+
+ /**
+ * Returns the set of devices that belong to the specified region.
+ *
+ * @param regionId region identifier
+ * @return set of identifiers for devices in the given region
+ */
+ Set<DeviceId> getRegionDevices(RegionId regionId);
+
+ /**
+ * Creates a new region using the supplied data.
+ *
+ * @param regionId region identifier
+ * @param name friendly name
+ * @param type region type
+ * @param masterNodeIds list of master nodes; null implies empty list
+ * @return new region descriptor
+ * @throws IllegalArgumentException if item already exists
+ */
+ Region createRegion(RegionId regionId, String name, Region.Type type,
+ List<Set<NodeId>> masterNodeIds);
+
+ /**
+ * Updates the specified new region using the supplied data.
+ *
+ * @param regionId region identifier
+ * @param name friendly name
+ * @param type region type
+ * @param masterNodeIds list of master nodes; null implies empty list
+ * @return new region descriptor
+ * @throws IllegalArgumentException if item already exists
+ */
+ Region updateRegion(RegionId regionId, String name, Region.Type type,
+ List<Set<NodeId>> masterNodeIds);
+
+ /**
+ * Removes the specified region using the new set of data.
+ *
+ * @param regionId region identifier
+ */
+ void removeRegion(RegionId regionId);
+
+ /**
+ * Adds the specified collection of devices to the region.
+ *
+ * @param regionId region identifier
+ * @param deviceIds list of device identifiers
+ */
+ void addDevices(RegionId regionId, Collection<DeviceId> deviceIds);
+
+ /**
+ * Removes the specified collection of devices from the region.
+ *
+ * @param regionId region identifier
+ * @param deviceIds list of device identifiers
+ */
+ void removeDevices(RegionId regionId, Collection<DeviceId> deviceIds);
+
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/RegionStoreDelegate.java b/core/api/src/main/java/org/onosproject/net/region/RegionStoreDelegate.java
new file mode 100644
index 0000000..be0c0bb
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/RegionStoreDelegate.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2016 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.net.region;
+
+import org.onosproject.store.StoreDelegate;
+
+/**
+ * Region store delegate abstraction.
+ */
+public interface RegionStoreDelegate extends StoreDelegate<RegionEvent> {
+}
diff --git a/core/api/src/main/java/org/onosproject/net/region/package-info.java b/core/api/src/main/java/org/onosproject/net/region/package-info.java
new file mode 100644
index 0000000..9f6bafd
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/region/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 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.
+ */
+
+/**
+ * Subsystem for tracking inventory of network control regions.
+ */
+package org.onosproject.net.region;
\ No newline at end of file