Merge "Use ${project.version} for internal dependencies"
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / VlanConfigurationCache.java
1 /*
2  * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
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
9 package org.opendaylight.ovsdb.openstack.netvirt.api;
10
11 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
12
13 /**
14  * This cache stores the VLAN assignments used for tenant separation within a vSwitch
15  * An assignment consists of a VLAN ID and a tenant network ID.
16  */
17 public interface VlanConfigurationCache {
18
19     /**
20      * Assigns a free VLAN ID for the given tenant network
21      * @param node an Open vSwitch {@link Node}
22      * @param networkId the Neutron Network ID
23      * @return a VLAN ID or 0 in case of an error
24      */
25     Integer assignInternalVlan(Node node, String networkId);
26
27     /**
28      * Recovers an assigned VLAN ID when it is no longer required
29      * @param node an Open vSwitch {@link Node}
30      * @param networkId the Neutron Network ID
31      * @return the reclaimed VLAN ID or 0 in case of an error
32      */
33     Integer reclaimInternalVlan(Node node, String networkId);
34
35     /**
36      * Returns a VLAN ID assigned to a given tenant network
37      * @param node an Open vSwitch {@link Node}
38      * @param networkId the Neutron Network ID
39      * @return the VLAN ID or 0 in case of an error
40      */
41     Integer getInternalVlan(Node node, String networkId);
42 }