Squashed commit of the following:
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / TenantNetworkManager.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
9 package org.opendaylight.ovsdb.openstack.netvirt.api;
10
11 import org.opendaylight.neutron.spi.NeutronNetwork;
12 import org.opendaylight.neutron.spi.NeutronPort;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
14 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
15
16 /**
17  * Open vSwitch isolates Tenant Networks using VLANs on the Integration Bridge
18  * This class manages the provisioning of these VLANs
19  *
20  * @author Dave Tucker
21  * @author Sam Hague (shague@redhat.com)
22  */
23 public interface TenantNetworkManager {
24
25     /**
26      * Get the VLAN assigned to the provided Network
27      * @param node the {@link Node} to query
28      * @param networkId the Neutron Network ID
29      * @return the assigned VLAN ID or 0 in case of an error
30      */
31     public int getInternalVlan(Node node, String networkId);
32
33     /**
34      * Reclaim the assigned VLAN for the given Network
35      * @param node the {@link Node} to query
36      * @param network the Neutron Network ID
37      */
38     public void reclaimInternalVlan(Node node, NeutronNetwork network);
39
40     /**
41      * Configures the VLAN for a Tenant Network
42      * @param node the {@link Node} to configure
43      * @param tp the termination point
44      * @param network the Neutron Network ID
45      */
46     public void programInternalVlan(Node node, OvsdbTerminationPointAugmentation tp, NeutronNetwork network);
47
48     /**
49      * Check is the given network is present on a Node
50      * @param node the {@link Node} to query
51      * @param segmentationId the Neutron Segementation ID
52      * @return True or False
53      */
54     public boolean isTenantNetworkPresentInNode(Node node, String segmentationId);
55
56     /**
57      * Get the Neutron Network ID for a given Segmentation ID
58      */
59     public String getNetworkId (String segmentationId);
60
61     /**
62      * Network Created Callback
63      */
64     public int networkCreated (Node node, String networkId);
65
66     /**
67      * Network Deleted Callback
68      */
69     public void networkDeleted(String id);
70     NeutronNetwork getTenantNetwork(OvsdbTerminationPointAugmentation terminationPointAugmentation);
71     public NeutronPort getTenantPort(OvsdbTerminationPointAugmentation terminationPointAugmentation);
72 }