Refactor OVSDB Neutron Code
[netvirt.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / ConfigurationService.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.controller.sal.core.Node;
14
15 import org.apache.commons.lang3.tuple.Pair;
16
17 import java.net.InetAddress;
18 import java.util.Map;
19
20 /**
21  * The ConfigurationService handles the configuration of the OpenStack Neutron Integration
22  * It exposes a set of Configuration variables and helper functions for obtaining node-specific
23  * configuration from the Open_vSwitch table of an OVS instance.
24  */
25 public interface ConfigurationService {
26
27     /**
28      * Returns the name configured name of the Integration Bridge
29      */
30     public String getIntegrationBridgeName();
31
32     /**
33      * Configures the name of the Integration Bridge
34      */
35     public void setIntegrationBridgeName(String integrationBridgeName);
36
37     /**
38      * Returns the name configured name of the Network Bridge
39      */
40     public String getNetworkBridgeName();
41
42     /**
43      * Configures the name of the Network Bridge
44      */
45     public void setNetworkBridgeName(String networkBridgeName);
46
47     /**
48      * Returns the name configured name of the ExternalBridge
49      */
50     public String getExternalBridgeName();
51
52     /**
53      * Configures the name of the External Bridge
54      */
55     public void setExternalBridgeName(String externalBridgeName);
56
57     /**
58      * Returns the key used to access the Tunnel Endpoint configuration from Open vSwitch
59      */
60     public String getTunnelEndpointKey();
61
62     /**
63      * Sets the key used to access the Tunnel Endpoint configuration from Open vSwitch
64      */
65     public void setTunnelEndpointKey(String tunnelEndpointKey);
66
67     /**
68      * Returns a Map of patch port names where the key is a tuple of source bridge and destination bridge
69      */
70     public Map<Pair<String, String>, String> getPatchPortNames();
71
72     /**
73      * Sets the Map of source/destination bridges to patch port name
74      */
75     public void setPatchPortNames(Map<Pair<String, String>, String> patchPortNames);
76
77     /**
78      * Get the name of a patch port
79      * @param portTuple a {@link org.apache.commons.lang3.tuple.Pair} where L
80      *                  is the source bridge and R the destination bridge
81      * @return the name of the patch port
82      */
83     public String getPatchPortName(Pair portTuple);
84
85     /**
86      * Returns the key used to access the Tunnel Endpoint configuration from Open vSwitch
87      */
88     public String getProviderMappingsKey();
89
90     /**
91      * Sets the key used to access the Tunnel Endpoint configuration from Open vSwitch
92      */
93     public void setProviderMappingsKey(String providerMappingsKey);
94
95     /**
96      * Gets the default provider mapping
97      */
98     public String getDefaultProviderMapping();
99
100     /**
101      * Sets the default provider mapping
102      */
103     public void setDefaultProviderMapping(String providerMapping);
104
105     /**
106      * Gets the tunnel endpoint address for a given Node
107      * @param node a {@link org.opendaylight.controller.sal.core.Node}
108      * @return the tunnel endpoint
109      * @see java.net.InetAddress
110      */
111     public InetAddress getTunnelEndPoint(Node node);
112
113     /**
114      * Returns the OpenFlow version to be used by the {@link NetworkingProvider}
115      * Default is OpenFlow 1.0. OVS versions greater than 1.10.0 will use OpenFlow 1.3
116      * @param node the node to query
117      * @return the OpenFlow version to use
118      */
119     public String getOpenflowVersion(Node node);
120 }