Squashed commit of the following:
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / VlanConfigurationCache.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Authors : Dave Tucker
9  */
10
11 package org.opendaylight.ovsdb.openstack.netvirt.api;
12
13 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
14
15 /**
16  * This cache stores the VLAN assignments used for tenant separation within a vSwitch
17  * An assignment consists of a VLAN ID and a tenant network ID.
18  */
19 public interface VlanConfigurationCache {
20
21     /**
22      * Assigns a free VLAN ID for the given tenant network
23      * @param node an Open vSwitch {@link Node}
24      * @param networkId the Neutron Network ID
25      * @return a VLAN ID or 0 in case of an error
26      */
27     public Integer assignInternalVlan (Node node, String networkId);
28
29     /**
30      * Recovers an assigned VLAN ID when it is no longer required
31      * @param node an Open vSwitch {@link Node}
32      * @param networkId the Neutron Network ID
33      * @return the reclaimed VLAN ID or 0 in case of an error
34      */
35     public Integer reclaimInternalVlan (Node node, String networkId);
36
37     /**
38      * Returns a VLAN ID assigned to a given tenant network
39      * @param node an Open vSwitch {@link Node}
40      * @param networkId the Neutron Network ID
41      * @return the VLAN ID or 0 in case of an error
42      */
43     public Integer getInternalVlan (Node node, String networkId);
44 }