summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/incubator/api/src
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-10-09 18:32:44 -0700
committerAshlee Young <ashlee@onosfw.com>2015-10-09 18:32:44 -0700
commit6a07d2d622eaa06953f3353e39c080984076e8de (patch)
treebfb50a2090fce186c2cc545a400c969bf2ea702b /framework/src/onos/incubator/api/src
parente6d71622143ff9b2421a1abbe8434b954b5b1099 (diff)
Updated master to commit id 6ee8aa3e67ce89908a8c93aa9445c6f71a18f986
Change-Id: I94b055ee2f298daf71e2ec794fd0f2495bd8081f
Diffstat (limited to 'framework/src/onos/incubator/api/src')
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java66
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainIntentResource.java84
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java26
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentResource.java52
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/NetworkIntentResource.java70
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceAdminService.java40
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DomainTunnelId.java92
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/NetworkTunnelId.java89
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java75
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualNetwork.java76
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualElement.java7
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java38
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkEvent.java72
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkListener.java24
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProvider.java31
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderRegistry.java25
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderService.java11
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStore.java161
-rw-r--r--framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStoreDelegate.java24
19 files changed, 996 insertions, 67 deletions
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java
index af2b47d8..592336c2 100644
--- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java
@@ -17,13 +17,15 @@
package org.onosproject.incubator.net.config.basics;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.annotations.Beta;
import com.google.common.collect.Sets;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
-import org.onosproject.net.config.Config;
import org.onosproject.incubator.net.intf.Interface;
import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.config.Config;
import org.onosproject.net.host.InterfaceIpAddress;
import java.util.Set;
@@ -37,7 +39,6 @@ public class InterfaceConfig extends Config<ConnectPoint> {
public static final String MAC = "mac";
public static final String VLAN = "vlan";
- public static final String IP_MISSING_ERROR = "Must have at least one IP address";
public static final String MAC_MISSING_ERROR = "Must have a MAC address for each interface";
public static final String CONFIG_VALUE_ERROR = "Error parsing config value";
@@ -53,9 +54,6 @@ public class InterfaceConfig extends Config<ConnectPoint> {
try {
for (JsonNode intfNode : array) {
Set<InterfaceIpAddress> ips = getIps(intfNode);
- if (ips.isEmpty()) {
- throw new ConfigException(IP_MISSING_ERROR);
- }
if (intfNode.path(MAC).isMissingNode()) {
throw new ConfigException(MAC_MISSING_ERROR);
@@ -63,10 +61,7 @@ public class InterfaceConfig extends Config<ConnectPoint> {
MacAddress mac = MacAddress.valueOf(intfNode.path(MAC).asText());
- VlanId vlan = VlanId.NONE;
- if (!intfNode.path(VLAN).isMissingNode()) {
- vlan = VlanId.vlanId(Short.valueOf(intfNode.path(VLAN).asText()));
- }
+ VlanId vlan = getVlan(intfNode);
interfaces.add(new Interface(subject, ips, mac, vlan));
}
@@ -77,13 +72,64 @@ public class InterfaceConfig extends Config<ConnectPoint> {
return interfaces;
}
+ /**
+ * Adds an interface to the config.
+ *
+ * @param intf interface to add
+ */
+ public void addInterface(Interface intf) {
+ ObjectNode intfNode = array.addObject();
+ intfNode.put(MAC, intf.mac().toString());
+
+ if (!intf.ipAddresses().isEmpty()) {
+ intfNode.set(IPS, putIps(intf.ipAddresses()));
+ }
+
+ if (!intf.vlan().equals(VlanId.NONE)) {
+ intfNode.put(VLAN, intf.vlan().toString());
+ }
+ }
+
+ /**
+ * Removes an interface from the config.
+ *
+ * @param intf interface to remove
+ */
+ public void removeInterface(Interface intf) {
+ for (int i = 0; i < array.size(); i++) {
+ if (intf.vlan().equals(getVlan(node))) {
+ array.remove(i);
+ break;
+ }
+ }
+ }
+
+ private VlanId getVlan(JsonNode node) {
+ VlanId vlan = VlanId.NONE;
+ if (!node.path(VLAN).isMissingNode()) {
+ vlan = VlanId.vlanId(Short.valueOf(node.path(VLAN).asText()));
+ }
+ return vlan;
+ }
+
private Set<InterfaceIpAddress> getIps(JsonNode node) {
Set<InterfaceIpAddress> ips = Sets.newHashSet();
JsonNode ipsNode = node.get(IPS);
- ipsNode.forEach(jsonNode -> ips.add(InterfaceIpAddress.valueOf(jsonNode.asText())));
+ if (ipsNode != null) {
+ ipsNode.forEach(jsonNode ->
+ ips.add(InterfaceIpAddress.valueOf(jsonNode.asText())));
+ }
return ips;
}
+ private ArrayNode putIps(Set<InterfaceIpAddress> intfIpAddresses) {
+ ArrayNode ipArray = mapper.createArrayNode();
+
+ intfIpAddresses.forEach(i -> ipArray.add(i.toString()));
+
+ return ipArray;
+ }
+
}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainIntentResource.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainIntentResource.java
new file mode 100644
index 00000000..ea1660e7
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainIntentResource.java
@@ -0,0 +1,84 @@
+/*
+ * 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.incubator.net.domain;
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.incubator.net.tunnel.DomainTunnelId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.Path;
+
+/**
+ * A variant of intent resource specialized for use on the intra-domain level. It contains a lower level path.
+ */
+public class DomainIntentResource extends IntentResource {
+
+ private final Path domainPath;
+
+ private final DomainTunnelId domainTunnelId;
+
+ private final IntentDomainId intentDomainId;
+
+ /**
+ * Constructor for a domain intent resource.
+ *
+ * @param primitive the primitive associated with this resource
+ * @param domainTunnelId the id of this tunnel (used as a sorting mechanism)
+ * @param domainId the ID of the intent domain containing this tunnel
+ * @param appId the id of the application which created this tunnel
+ * @param ingress the fist connect point associated with this tunnel (order is irrelevant as long as it is
+ * consistent with the path)
+ * @param egress the second connect point associated with this tunnel (order is irrelevant as long as it is
+ * consistent with the path)
+ * @param path the path followed through the domain
+ */
+ public DomainIntentResource(IntentPrimitive primitive, DomainTunnelId domainTunnelId, IntentDomainId domainId,
+ ApplicationId appId, ConnectPoint ingress, ConnectPoint egress, Path path) {
+ super(primitive, appId, ingress, egress);
+
+ this.domainPath = path;
+ this.domainTunnelId = domainTunnelId;
+ this.intentDomainId = domainId;
+ }
+
+ /**
+ * Returns the domain path associated with this resource at creation.
+ *
+ * @return this resource's domain level path or if this resource backs a network tunnel then null.
+ */
+ public Path path() {
+ return domainPath;
+ }
+
+ /**
+ * Returns the tunnel ID associated with this domain at creation.
+ *
+ * @return this resource's tunnel ID.
+ */
+ public DomainTunnelId tunnelId() {
+ return domainTunnelId;
+ }
+
+ /**
+ * Returns the domain ID associated with this resource at creation.
+ *
+ * @return this resource's domain ID.
+ */
+ public IntentDomainId domainId() {
+ return intentDomainId;
+ }
+
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java
index 51265f71..a19add60 100644
--- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java
@@ -34,51 +34,51 @@ public interface IntentDomainProvider {
*
* @param domain intent domain for the request
* @param primitive intent primitive
- * @return request contexts that contain resources to satisfy the intent
+ * @return intent resources that specify paths that satisfy the request.
*/
//TODO Consider an iterable and/or holds (only hold one or two reservation(s) at a time)
- List<RequestContext> request(IntentDomain domain, IntentPrimitive primitive);
+ List<DomainIntentResource> request(IntentDomain domain, IntentPrimitive primitive);
/**
* Request that the provider attempt to modify an existing resource to satisfy
* a new intent primitive. The application must apply the context before
* the intent resource can be used.
*
- * @param resource existing resource
- * @param newPrimitive intent primitive
+ * @param oldResource the resource to be replaced
+ * @param newResource the resource to be applied
* @return request contexts that contain resources to satisfy the intent
*/
- List<RequestContext> modify(IntentResource resource, IntentPrimitive newPrimitive);
+ DomainIntentResource modify(DomainIntentResource oldResource, DomainIntentResource newResource);
/**
* Requests that the provider release an intent resource.
*
* @param resource intent resource
*/
- void release(IntentResource resource);
+ void release(DomainIntentResource resource);
/**
- * Requests that the provider apply the intent resource in the request context.
+ * Requests that the provider apply the path from the intent resource.
*
- * @param context request context
+ * @param domainIntentResource request context
* @return intent resource that satisfies the intent
*/
- IntentResource apply(RequestContext context);
+ DomainIntentResource apply(DomainIntentResource domainIntentResource);
/**
- * Requests that the provider cancel the request. Requests that are not applied
+ * Requests that the provider cancel the path. Requests that are not applied
* will be eventually timed out by the provider.
*
- * @param context request context
+ * @param domainIntentResource the intent resource whose path should be cancelled.
*/
- void cancel(RequestContext context);
+ void cancel(DomainIntentResource domainIntentResource);
/**
* Returns all intent resources held by the provider.
*
* @return set of intent resources
*/
- Set<IntentResource> getResources();
+ Set<DomainIntentResource> getResources();
}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentResource.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentResource.java
index 9cd9aac0..627c863f 100644
--- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentResource.java
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentResource.java
@@ -16,53 +16,73 @@
package org.onosproject.incubator.net.domain;
import com.google.common.annotations.Beta;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.ConnectPoint;
+
/**
* The abstract base class for the resource that satisfies an intent primitive.
*/
@Beta
-public class IntentResource {
+public abstract class IntentResource {
private final IntentPrimitive primitive;
- private final long tunnelId;
- private final IntentDomainId domainId;
+
+ private final ApplicationId appId;
+ private final ConnectPoint ingress;
+ private final ConnectPoint egress;
+
+ //* QUESTIONABLE ADDITIONS *//
// TODO add other common fields
//String ingressTag;
//String egressTag;
//etc.
- public IntentResource(IntentPrimitive primitive, long tunnelId, IntentDomainId domainId) {
+ public IntentResource(IntentPrimitive primitive, ApplicationId appId,
+ ConnectPoint ingress, ConnectPoint egress) {
+ this.appId = appId;
+ this.ingress = ingress;
+ this.egress = egress;
this.primitive = primitive;
- this.tunnelId = tunnelId;
- this.domainId = domainId;
}
+ //TODO when is same package tunnelID should be of type tunnelID and netTunnelId not long.
+
+
/**
- * Returns the intent primitive associated with this resource as creation.
+ * Returns the intent primitive associated with this resource at creation.
*
- * @return this resource's intent primitive
+ * @return this resource's intent primitive.
*/
public IntentPrimitive primitive() {
return primitive;
}
/**
- * Returns the tunnel ID associated with this resource as creation.
+ * Returns the application ID associated with this resource at creation.
*
- * @return this resource's tunnel ID
+ * @return this resource's application ID.
*/
- public long tunnelId() {
- return tunnelId;
+ public ApplicationId appId() {
+ return appId;
}
/**
- * Returns the domain ID associated with this resource as creation.
+ * Returns the ingress connect point associated with this resource at creation.
*
- * @return this resource's domain ID
+ * @return this resource's ingress connect point.
*/
- public IntentDomainId domainId() {
- return domainId;
+ public ConnectPoint ingress() {
+ return ingress;
}
+ /**
+ * Returns the egress connect point associated with this resource at creation.
+ *
+ * @return this resource's connect point.
+ */
+ public ConnectPoint egress() {
+ return egress;
+ }
}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/NetworkIntentResource.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/NetworkIntentResource.java
new file mode 100644
index 00000000..ac4445b4
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/domain/NetworkIntentResource.java
@@ -0,0 +1,70 @@
+/*
+ * 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.incubator.net.domain;
+
+import org.onosproject.core.ApplicationId;
+import org.onosproject.incubator.net.tunnel.NetworkTunnelId;
+import org.onosproject.net.ConnectPoint;
+
+/**
+ * A variant of intent resource specialized for use on the inter-domain level. It contains a higher level path.
+ */
+public class NetworkIntentResource extends IntentResource {
+
+ private final org.onlab.graph.Path<DomainVertex, DomainEdge> netPath;
+
+ private NetworkTunnelId networkTunnelId;
+
+ /**
+ * Constructor for a network intent resource.
+ *
+ * @param primitive the primitive associated with this resource
+ * @param networkTunnelId the id of this tunnel (used as a sorting mechanism)
+ * @param appId the id of the application which created this tunnel
+ * @param ingress the fist connect point associated with this tunnel (order is irrelevant as long as it is
+ * consistent with the path)
+ * @param egress the second connect point associated with this tunnel (order is irrelevant as long as it is
+ * consistent with the path)
+ * @param path the path followed through the graph of domain vertices and domain edges
+ */
+ public NetworkIntentResource(IntentPrimitive primitive, NetworkTunnelId networkTunnelId, ApplicationId appId,
+ ConnectPoint ingress, ConnectPoint egress,
+ org.onlab.graph.Path<DomainVertex, DomainEdge> path) {
+ super(primitive, appId, ingress, egress);
+
+ this.networkTunnelId = networkTunnelId;
+ this.netPath = path;
+ }
+
+ /**
+ * Returns the network path associated with this resource at creation.
+ *
+ * @return this resource's network lever path or if this resource backs a domain level tunnel then null.
+ */
+ public org.onlab.graph.Path<DomainVertex, DomainEdge> path() {
+ return netPath;
+ }
+
+ /**
+ * Returns ths network ID associated with this network tunnel at creation.
+ *
+ * @return thsi resource's tunnel ID.
+ */
+ public NetworkTunnelId tunnelId() {
+ return this.networkTunnelId;
+ }
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceAdminService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceAdminService.java
new file mode 100644
index 00000000..56d5aecc
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/intf/InterfaceAdminService.java
@@ -0,0 +1,40 @@
+/*
+ * 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.incubator.net.intf;
+
+import org.onlab.packet.VlanId;
+import org.onosproject.net.ConnectPoint;
+
+/**
+ * Provides a means to modify the interfaces configuration.
+ */
+public interface InterfaceAdminService {
+ /**
+ * Adds a new interface configuration to the system.
+ *
+ * @param intf interface to add
+ */
+ void add(Interface intf);
+
+ /**
+ * Removes an interface configuration from the system.
+ *
+ * @param connectPoint connect point of the interface
+ * @param vlanId vlan id
+ */
+ void remove(ConnectPoint connectPoint, VlanId vlanId);
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DomainTunnelId.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DomainTunnelId.java
new file mode 100644
index 00000000..430823ca
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/DomainTunnelId.java
@@ -0,0 +1,92 @@
+/*
+ * 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.incubator.net.tunnel;
+
+/**
+ * A wrapper class for a long used to identify domain level tunnels.
+ */
+public final class DomainTunnelId {
+
+ private final long value;
+
+ /**
+ * Creates a tunnel identifier from the specified tunnel.
+ *
+ * @param value long value
+ * @return domain tunnel identifier
+ */
+ public static DomainTunnelId valueOf(long value) {
+ return new DomainTunnelId(value);
+ }
+
+ /**
+ * Creates a tunnel identifier from the specified tunnel.
+ *
+ * @param value long value as a string
+ * @return domain tunnel identifier
+ */
+ public static DomainTunnelId valueOf(String value) {
+ return new DomainTunnelId(Long.parseLong(value));
+ }
+
+ /**
+ * Constructor for serializer.
+ */
+ protected DomainTunnelId() {
+ this.value = 0;
+ }
+
+ /**
+ * Constructs the Domain ID corresponding to a given long value.
+ *
+ * @param value the underlying value of this domain ID
+ */
+ public DomainTunnelId(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns the backing value of this domain ID.
+ *
+ * @return the long value
+ */
+ public long id() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return Long.hashCode(value);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof DomainTunnelId)) {
+ return false;
+ }
+ DomainTunnelId that = (DomainTunnelId) obj;
+ return this.value == that.value;
+ }
+
+ @Override
+ public String toString() {
+ return "0x" + Long.toHexString(value);
+ }
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/NetworkTunnelId.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/NetworkTunnelId.java
new file mode 100644
index 00000000..a3de7883
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/tunnel/NetworkTunnelId.java
@@ -0,0 +1,89 @@
+/*
+ * 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.incubator.net.tunnel;
+
+import com.google.common.annotations.Beta;
+
+/**
+ * Representation of a Network Tunnel Id.
+ */
+@Beta
+public final class NetworkTunnelId {
+ private final long value;
+
+ /**
+ * Creates an tunnel identifier from the specified tunnel.
+ *
+ * @param value long value
+ * @return tunnel identifier
+ */
+ public static NetworkTunnelId valueOf(long value) {
+ return new NetworkTunnelId(value);
+ }
+
+ public static NetworkTunnelId valueOf(String value) {
+ return new NetworkTunnelId(Long.parseLong(value));
+ }
+
+ /**
+ * Constructor for serializer.
+ */
+ NetworkTunnelId() {
+ this.value = 0;
+ }
+
+ /**
+ * Constructs the ID corresponding to a given long value.
+ *
+ * @param value the underlying value of this ID
+ */
+ public NetworkTunnelId(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns the backing value.
+ *
+ * @return the value
+ */
+ public long id() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return Long.hashCode(value);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof NetworkTunnelId)) {
+ return false;
+ }
+ NetworkTunnelId that = (NetworkTunnelId) obj;
+ return this.value == that.value;
+ }
+
+ @Override
+ public String toString() {
+ return "0x" + Long.toHexString(value);
+ }
+
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java
new file mode 100644
index 00000000..54a22a46
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualDevice.java
@@ -0,0 +1,75 @@
+/*
+ * 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.incubator.net.virtual;
+
+import org.onlab.packet.ChassisId;
+import org.onosproject.net.DefaultDevice;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.provider.ProviderId;
+
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.*;
+
+/**
+ * Default representation of a virtual device.
+ */
+public class DefaultVirtualDevice extends DefaultDevice implements VirtualDevice {
+
+ private static final String VIRTUAL = "virtual";
+ private static final ProviderId PID = new ProviderId(VIRTUAL, VIRTUAL);
+
+ private final NetworkId networkId;
+
+ /**
+ * Creates a network element attributed to the specified provider.
+ *
+ * @param networkId network identifier
+ * @param id device identifier
+ */
+ public DefaultVirtualDevice(NetworkId networkId, DeviceId id) {
+ super(PID, id, Type.VIRTUAL, VIRTUAL, VIRTUAL, VIRTUAL, VIRTUAL,
+ new ChassisId(0));
+ this.networkId = networkId;
+ }
+
+ @Override
+ public NetworkId networkId() {
+ return networkId;
+ }
+
+ @Override
+ public int hashCode() {
+ return 31 * super.hashCode() + Objects.hash(networkId);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof DefaultVirtualDevice) {
+ DefaultVirtualDevice that = (DefaultVirtualDevice) obj;
+ return super.equals(that) && Objects.equals(this.networkId, that.networkId);
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this).add("networkId", networkId).toString();
+ }
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualNetwork.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualNetwork.java
new file mode 100644
index 00000000..c1141912
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/DefaultVirtualNetwork.java
@@ -0,0 +1,76 @@
+/*
+ * 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.incubator.net.virtual;
+
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Default implementation of the virtual network descriptor.
+ */
+public class DefaultVirtualNetwork implements VirtualNetwork {
+
+ private final NetworkId id;
+ private final TenantId tenantId;
+
+ /**
+ * Creates a new virtual network descriptor.
+ *
+ * @param id network identifier
+ * @param tenantId tenant identifier
+ */
+ public DefaultVirtualNetwork(NetworkId id, TenantId tenantId) {
+ this.id = id;
+ this.tenantId = tenantId;
+ }
+
+ @Override
+ public NetworkId id() {
+ return id;
+ }
+
+ @Override
+ public TenantId tenantId() {
+ return tenantId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, tenantId);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof DefaultVirtualNetwork) {
+ DefaultVirtualNetwork that = (DefaultVirtualNetwork) obj;
+ return Objects.equals(this.id, that.id)
+ && Objects.equals(this.tenantId, that.tenantId);
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this)
+ .add("id", id)
+ .add("tenantId", tenantId)
+ .toString();
+ }
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualElement.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualElement.java
index 1c74b92a..791b8e24 100644
--- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualElement.java
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualElement.java
@@ -24,13 +24,6 @@ import com.google.common.annotations.Beta;
public interface VirtualElement {
/**
- * Returns the identifier of the tenant to which this virtual element belongs.
- *
- * @return tenant identifier
- */
- TenantId tenantId();
-
- /**
* Returns the network identifier to which this virtual element belongs.
*
* @return network identifier
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java
index 1e3648b5..07c399c0 100644
--- a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java
@@ -16,14 +16,11 @@
package org.onosproject.incubator.net.virtual;
import com.google.common.annotations.Beta;
-import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.incubator.net.tunnel.TunnelId;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Port;
import org.onosproject.net.PortNumber;
-import org.onosproject.net.device.DeviceDescription;
-import org.onosproject.net.device.PortDescription;
-import org.onosproject.net.link.LinkDescription;
import java.util.Set;
@@ -76,12 +73,12 @@ public interface VirtualNetworkAdminService extends VirtualNetworkService {
* Creates a new virtual device within the specified network. The device id
* must be unique within the bounds of the network.
*
- * @param networkId network identifier
- * @param description device description
+ * @param networkId network identifier
+ * @param deviceId device identifier
* @return newly created device
* @throws org.onlab.util.ItemNotFoundException if no such network found
*/
- VirtualDevice createVirtualDevice(NetworkId networkId, DeviceDescription description);
+ VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId);
/**
* Removes the specified virtual device and all its ports and affiliated links.
@@ -96,14 +93,16 @@ public interface VirtualNetworkAdminService extends VirtualNetworkService {
/**
* Creates a new virtual link within the specified network.
*
- * @param networkId network identifier
- * @param description link description
- * @param realizedBy tunnel using which this link is realized
+ * @param networkId network identifier
+ * @param src source connection point
+ * @param dst destination connection point
+ * @param realizedBy identifier of the tunnel using which this link is realized
* @return newly created virtual link
* @throws org.onlab.util.ItemNotFoundException if no such network found
*/
- VirtualLink createVirtualLink(NetworkId networkId, LinkDescription description,
- Tunnel realizedBy);
+ VirtualLink createVirtualLink(NetworkId networkId,
+ ConnectPoint src, ConnectPoint dst,
+ TunnelId realizedBy);
// TODO: Discuss whether we should provide an alternate createVirtualLink
// which is backed by a Path instead; I'm leaning towards not doing that.
@@ -119,20 +118,17 @@ public interface VirtualNetworkAdminService extends VirtualNetworkService {
void removeVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
/**
- * Creates a new virtual port on the specified device. Note that the port
- * description can only request the resources which the underlying port
- * port is capable of providing. It is, however, permissible to request
- * only portion of those resources.
+ * Creates a new virtual port on the specified device.
*
- * @param networkId network identifier
- * @param deviceId device identifier
- * @param description port description
- * @param realizedBy underlying port using which this virtual port is realized
+ * @param networkId network identifier
+ * @param deviceId device identifier
+ * @param portNumber port number
+ * @param realizedBy underlying port using which this virtual port is realized
* @return newly created port
* @throws org.onlab.util.ItemNotFoundException if no such network or device found
*/
VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId,
- PortDescription description, Port realizedBy);
+ PortNumber portNumber, Port realizedBy);
/**
* Removes the specified virtual port.
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkEvent.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkEvent.java
new file mode 100644
index 00000000..7e076e09
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkEvent.java
@@ -0,0 +1,72 @@
+/*
+ * 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.incubator.net.virtual;
+
+import org.onosproject.event.AbstractEvent;
+
+/**
+ * Describes virtual network event.
+ */
+public class VirtualNetworkEvent extends AbstractEvent<VirtualNetworkEvent.Type, NetworkId> {
+
+ /**
+ * Type of virtual network events.
+ */
+ public enum Type {
+ /**
+ * Signifies that a new tenant identifier was registered.
+ */
+ TENANT_REGISTERED,
+ /**
+ * Signifies that a tenant identifier was unregistered.
+ */
+ TENANT_UNREGISTERED,
+ /**
+ * Signifies that a new virtual network was added.
+ */
+ NETWORK_ADDED,
+ /**
+ * Signifies that a virtual network was updated.
+ */
+ NETWORK_UPDATED,
+ /**
+ * Signifies that a virtual network was removed.
+ */
+ NETWORK_REMOVED
+ }
+
+ /**
+ * Creates an event of a given type and for the specified subject and the
+ * current time.
+ *
+ * @param type event type
+ * @param subject event subject
+ */
+ public VirtualNetworkEvent(Type type, NetworkId subject) {
+ super(type, subject);
+ }
+
+ /**
+ * Creates an event of a given type and for the specified subject and time.
+ *
+ * @param type device event type
+ * @param subject event subject
+ * @param time occurrence time
+ */
+ public VirtualNetworkEvent(Type type, NetworkId subject, long time) {
+ super(type, subject, time);
+ }
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkListener.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkListener.java
new file mode 100644
index 00000000..707ca8a7
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkListener.java
@@ -0,0 +1,24 @@
+/*
+ * 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.incubator.net.virtual;
+
+import org.onosproject.event.EventListener;
+
+/**
+ * Represents entity capable of receiving virtual network events.
+ */
+public interface VirtualNetworkListener extends EventListener<VirtualNetworkEvent> {
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProvider.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProvider.java
new file mode 100644
index 00000000..8e5b19a5
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProvider.java
@@ -0,0 +1,31 @@
+package org.onosproject.incubator.net.virtual;
+
+import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.provider.Provider;
+
+/**
+ * Entity capable of providing traffic isolation constructs for use in
+ * implementation of virtual devices and virtual links.
+ */
+public interface VirtualNetworkProvider extends Provider {
+
+ /**
+ * Creates a network tunnel for all traffic from the specified source
+ * connection point to the indicated destination connection point.
+ *
+ * @param networkId virtual network identifier
+ * @param src source connection point
+ * @param dst destination connection point
+ */
+ TunnelId createTunnel(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
+
+ /**
+ * Destroys the specified network tunnel.
+ *
+ * @param networkId virtual network identifier
+ * @param tunnelId tunnel identifier
+ */
+ void destroyTunnel(NetworkId networkId, TunnelId tunnelId);
+
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderRegistry.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderRegistry.java
new file mode 100644
index 00000000..4e893165
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderRegistry.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 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.incubator.net.virtual;
+
+import org.onosproject.net.provider.ProviderRegistry;
+
+/**
+ * Abstraction of a virtual network provider registry.
+ */
+public interface VirtualNetworkProviderRegistry
+ extends ProviderRegistry<VirtualNetworkProvider, VirtualNetworkProviderService> {
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderService.java
new file mode 100644
index 00000000..cba933c9
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkProviderService.java
@@ -0,0 +1,11 @@
+package org.onosproject.incubator.net.virtual;
+
+import org.onosproject.net.provider.ProviderService;
+
+/**
+ * Service through which virtual network providers can inject information into
+ * the core.
+ */
+public interface VirtualNetworkProviderService extends ProviderService<VirtualNetworkProvider> {
+ // TODO: Add methods for notification of core about damaged tunnels, etc.
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStore.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStore.java
new file mode 100644
index 00000000..49ad2f2b
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStore.java
@@ -0,0 +1,161 @@
+/*
+ * 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.incubator.net.virtual;
+
+import org.onosproject.incubator.net.tunnel.TunnelId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.Port;
+import org.onosproject.net.PortNumber;
+import org.onosproject.store.Store;
+
+import java.util.Set;
+
+/**
+ * Mechanism for distributing and storing virtual network model information.
+ */
+public interface VirtualNetworkStore
+ extends Store<VirtualNetworkEvent, VirtualNetworkStoreDelegate> {
+
+ /**
+ * Adds a new tenant ID to the store.
+ *
+ * @param tenantId tenant identifier
+ */
+ void addTenantId(TenantId tenantId);
+
+ /**
+ * Removes the specified tenant ID from the store.
+ *
+ * @param tenantId tenant identifier
+ */
+ void removeTenantId(TenantId tenantId);
+
+ /**
+ * Returns set of registered tenant IDs.
+ *
+ * @return set of tenant identifiers
+ */
+ Set<TenantId> getTenantIds();
+
+ /**
+ * Adds a new virtual network for the specified tenant to the store.
+ *
+ * @param tenantId tenant identifier
+ * @return the virtual network
+ */
+ VirtualNetwork addNetwork(TenantId tenantId);
+
+ /**
+ * Removes the specified virtual network from the store.
+ *
+ * @param networkId network identifier
+ */
+ void removeNetwork(NetworkId networkId);
+
+ /**
+ * Adds a new virtual device to the store. This device will have no ports.
+ *
+ * @param networkId network identifier
+ * @param deviceId device identifier
+ * @return the virtual device
+ */
+ VirtualDevice addDevice(NetworkId networkId, DeviceId deviceId);
+
+ /**
+ * Renmoves the specified virtual device from the given network.
+ *
+ * @param networkId network identifier
+ * @param deviceId device identifier
+ */
+ void removeDevice(NetworkId networkId, DeviceId deviceId);
+
+ /**
+ * Adds a new virtual link.
+ *
+ * @param networkId network identifier
+ * @param src source end-point of the link
+ * @param dst destination end-point of the link
+ * @param realizedBy underlying tunnel using which this link is realized
+ * @return the virtual link
+ */
+ VirtualLink addLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst,
+ TunnelId realizedBy);
+
+ /**
+ * Removes the specified link from the store.
+ *
+ * @param networkId network identifier
+ * @param src source connection point
+ * @param dst destination connection point
+ */
+ void removeLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
+
+ /**
+ * Adds a new virtual port to the network.
+ *
+ * @param networkId network identifier
+ * @param deviceId device identifier
+ * @param portNumber port number
+ * @param realizedBy underlying port which realizes the virtual port
+ * @return the virtual port
+ */
+ VirtualPort addPort(NetworkId networkId, DeviceId deviceId,
+ PortNumber portNumber, Port realizedBy);
+
+ /**
+ * Removes the specified port from the given device and network.
+ *
+ * @param networkId network identifier
+ * @param deviceId device identifier
+ * @param portNumber port number
+ */
+ void removePort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
+
+ /**
+ * Returns the list of networks.
+ *
+ * @param tenantId tenant identifier
+ * @return set of virtual networks
+ */
+ Set<VirtualNetwork> getNetworks(TenantId tenantId);
+
+ /**
+ * Returns the list of devices in the specified virtual network.
+ *
+ * @param networkId network identifier
+ * @return set of virtual devices
+ */
+ Set<VirtualDevice> getDevices(NetworkId networkId);
+
+ /**
+ * Returns the list of virtual links in the specified virtual network.
+ *
+ * @param networkId network identifier
+ * @return set of virtual links
+ */
+ Set<VirtualLink> getLinks(NetworkId networkId);
+
+ /**
+ * Returns the list of ports of the specified virtual device.
+ *
+ * @param networkId network identifier
+ * @param deviceId device identifier
+ * @return set of virtual networks
+ */
+ Set<VirtualPort> getPorts(NetworkId networkId, DeviceId deviceId);
+
+}
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStoreDelegate.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStoreDelegate.java
new file mode 100644
index 00000000..e57c3d3a
--- /dev/null
+++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkStoreDelegate.java
@@ -0,0 +1,24 @@
+/*
+ * 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.incubator.net.virtual;
+
+import org.onosproject.store.StoreDelegate;
+
+/**
+ * Network configuration store delegate abstraction.
+ */
+public interface VirtualNetworkStoreDelegate extends StoreDelegate<VirtualNetworkEvent> {
+}