2 * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
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
9 package org.opendaylight.netvirt.openstack.netvirt.api;
11 import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
12 import org.opendaylight.netvirt.openstack.netvirt.translator.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;
17 * Open vSwitch isolates Tenant Networks using VLANs on the Integration Bridge
18 * This class manages the provisioning of these VLANs
21 * @author Sam Hague (shague@redhat.com)
23 public interface TenantNetworkManager {
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
31 int getInternalVlan(Node node, String networkId);
34 * Reclaim the assigned VLAN for the given Network
35 * @param node the {@link Node} to query
36 * @param network the Neutron Network ID
38 void reclaimInternalVlan(Node node, NeutronNetwork network);
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
46 void programInternalVlan(Node node, OvsdbTerminationPointAugmentation tp, NeutronNetwork network);
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
54 boolean isTenantNetworkPresentInNode(Node node, String segmentationId);
57 * Get the Neutron Network ID for a given Segmentation ID
58 * @param segmentationId segmentation id of the neutron network
59 * @return Neutron network id associated with the given segmentation id
61 String getNetworkId(String segmentationId);
64 * Network Created Callback
65 * @param node target node
66 * @param networkId Id of neutron network
67 * @return vlan assigned to the network
69 int networkCreated(Node node, String networkId);
72 * Network Deleted Callback
73 * @param id Id of the neutron network
75 void networkDeleted(String id);
76 NeutronNetwork getTenantNetwork(OvsdbTerminationPointAugmentation terminationPointAugmentation);
77 NeutronPort getTenantPort(OvsdbTerminationPointAugmentation terminationPointAugmentation);