sangho

Separated OpenstackInterface feature from OpenstackNetworking application.

Change-Id: I4766de7e93c5b432c50a2167b9a9d9d4605b1ad2
Showing 46 changed files with 445 additions and 140 deletions
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 category="default" url="http://onosproject.org" 18 category="default" url="http://onosproject.org"
19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features" 19 featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
20 features="${project.artifactId}" 20 features="${project.artifactId}"
21 - apps="org.onosproject.ovsdb-base,org.onosproject.openstacknetworking,org.onosproject.dhcp"> 21 + apps="org.onosproject.ovsdb-base,org.onosproject.openstackinterface,org.onosproject.dhcp">
22 <description>${project.description}</description> 22 <description>${project.description}</description>
23 <artifact>mvn:${project.groupId}/onos-app-cordvtn/${project.version}</artifact> 23 <artifact>mvn:${project.groupId}/onos-app-cordvtn/${project.version}</artifact>
24 </app> 24 </app>
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
103 </dependency> 103 </dependency>
104 <dependency> 104 <dependency>
105 <groupId>org.onosproject</groupId> 105 <groupId>org.onosproject</groupId>
106 - <artifactId>onos-app-openstacknetworking-api</artifactId> 106 + <artifactId>onos-app-openstackinterface-api</artifactId>
107 <version>${project.version}</version> 107 <version>${project.version}</version>
108 </dependency> 108 </dependency>
109 <dependency> 109 <dependency>
......
...@@ -19,8 +19,8 @@ import com.google.common.base.MoreObjects; ...@@ -19,8 +19,8 @@ import com.google.common.base.MoreObjects;
19 import org.onlab.packet.IpAddress; 19 import org.onlab.packet.IpAddress;
20 import org.onlab.packet.IpPrefix; 20 import org.onlab.packet.IpPrefix;
21 import org.onosproject.net.Host; 21 import org.onosproject.net.Host;
22 -import org.onosproject.openstacknetworking.OpenstackNetwork; 22 +import org.onosproject.openstackinterface.OpenstackNetwork;
23 -import org.onosproject.openstacknetworking.OpenstackSubnet; 23 +import org.onosproject.openstackinterface.OpenstackSubnet;
24 24
25 import java.util.Map; 25 import java.util.Map;
26 import java.util.Objects; 26 import java.util.Objects;
......
...@@ -62,10 +62,10 @@ import org.onosproject.net.packet.PacketProcessor; ...@@ -62,10 +62,10 @@ import org.onosproject.net.packet.PacketProcessor;
62 import org.onosproject.net.packet.PacketService; 62 import org.onosproject.net.packet.PacketService;
63 import org.onosproject.net.provider.AbstractProvider; 63 import org.onosproject.net.provider.AbstractProvider;
64 import org.onosproject.net.provider.ProviderId; 64 import org.onosproject.net.provider.ProviderId;
65 -import org.onosproject.openstacknetworking.OpenstackNetworkingService; 65 +import org.onosproject.openstackinterface.OpenstackInterfaceService;
66 -import org.onosproject.openstacknetworking.OpenstackNetwork; 66 +import org.onosproject.openstackinterface.OpenstackNetwork;
67 -import org.onosproject.openstacknetworking.OpenstackPort; 67 +import org.onosproject.openstackinterface.OpenstackPort;
68 -import org.onosproject.openstacknetworking.OpenstackSubnet; 68 +import org.onosproject.openstackinterface.OpenstackSubnet;
69 import org.slf4j.Logger; 69 import org.slf4j.Logger;
70 70
71 import java.util.List; 71 import java.util.List;
...@@ -123,7 +123,7 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro ...@@ -123,7 +123,7 @@ public class CordVtn extends AbstractProvider implements CordVtnService, HostPro
123 protected GroupService groupService; 123 protected GroupService groupService;
124 124
125 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 125 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
126 - protected OpenstackNetworkingService openstackService; 126 + protected OpenstackInterfaceService openstackService;
127 127
128 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 128 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
129 protected DhcpService dhcpService; 129 protected DhcpService dhcpService;
......
...@@ -71,8 +71,8 @@ import org.onosproject.net.group.GroupBuckets; ...@@ -71,8 +71,8 @@ import org.onosproject.net.group.GroupBuckets;
71 import org.onosproject.net.group.GroupDescription; 71 import org.onosproject.net.group.GroupDescription;
72 import org.onosproject.net.group.GroupKey; 72 import org.onosproject.net.group.GroupKey;
73 import org.onosproject.net.group.GroupService; 73 import org.onosproject.net.group.GroupService;
74 -import org.onosproject.openstacknetworking.OpenstackNetwork; 74 +import org.onosproject.openstackinterface.OpenstackNetwork;
75 -import org.onosproject.openstacknetworking.OpenstackSubnet; 75 +import org.onosproject.openstackinterface.OpenstackSubnet;
76 import org.slf4j.Logger; 76 import org.slf4j.Logger;
77 77
78 import java.util.ArrayList; 78 import java.util.ArrayList;
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<project xmlns="http://maven.apache.org/POM/4.0.0"
18 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20 + <modelVersion>4.0.0</modelVersion>
21 +
22 + <parent>
23 + <groupId>org.onosproject</groupId>
24 + <artifactId>onos-app-openstackinterface</artifactId>
25 + <version>1.5.0-SNAPSHOT</version>
26 + <relativePath>../pom.xml</relativePath>
27 + </parent>
28 +
29 + <artifactId>onos-app-openstackinterface-api</artifactId>
30 + <packaging>bundle</packaging>
31 +
32 + <dependencies>
33 + <dependency>
34 + <groupId>org.osgi</groupId>
35 + <artifactId>org.osgi.compendium</artifactId>
36 + </dependency>
37 + <dependency>
38 + <groupId>org.onosproject</groupId>
39 + <artifactId>onos-api</artifactId>
40 + </dependency>
41 + <dependency>
42 + <groupId>org.onosproject</groupId>
43 + <artifactId>onos-core-serializers</artifactId>
44 + <version>${project.version}</version>
45 + </dependency>
46 + </dependencies>
47 +
48 +</project>
49 +
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import com.google.common.collect.ImmutableMap; 18 import com.google.common.collect.ImmutableMap;
19 import com.google.common.collect.Maps; 19 import com.google.common.collect.Maps;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import org.onlab.packet.Ip4Address; 18 import org.onlab.packet.Ip4Address;
19 19
......
...@@ -13,17 +13,16 @@ ...@@ -13,17 +13,16 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import org.onosproject.net.Port; 18 import org.onosproject.net.Port;
19 19
20 import java.util.Collection; 20 import java.util.Collection;
21 -import java.util.Map;
22 21
23 /** 22 /**
24 * Handles port management REST API from Openstack for VMs. 23 * Handles port management REST API from Openstack for VMs.
25 */ 24 */
26 -public interface OpenstackNetworkingService { 25 +public interface OpenstackInterfaceService {
27 26
28 /** 27 /**
29 * Returns port information list for the network ID given. 28 * Returns port information list for the network ID given.
...@@ -101,23 +100,6 @@ public interface OpenstackNetworkingService { ...@@ -101,23 +100,6 @@ public interface OpenstackNetworkingService {
101 OpenstackRouter router(String routerId); 100 OpenstackRouter router(String routerId);
102 101
103 /** 102 /**
104 - * Retruns OpenstackPortInfo map.
105 - *
106 - * @return OpenstackPortInfo map
107 - */
108 - Map<String, OpenstackPortInfo> openstackPortInfo();
109 -
110 - /**
111 - * Sets configurations specified by net-config.xml file.
112 - *
113 - * @param neutronUrl neutron server url
114 - * @param keystoneUrl keystone server url
115 - * @param userName horizon user name
116 - * @param pass horizon passowrd
117 - */
118 - void setConfigurations(String neutronUrl, String keystoneUrl, String userName, String pass);
119 -
120 - /**
121 * Returns Security Group information of the security groupd id given. 103 * Returns Security Group information of the security groupd id given.
122 * 104 *
123 * @param id security group id 105 * @param id security group id
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import java.util.Collection; 18 import java.util.Collection;
19 19
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import org.onosproject.core.ApplicationId; 18 import org.onosproject.core.ApplicationId;
19 import org.onosproject.net.config.Config; 19 import org.onosproject.net.config.Config;
...@@ -23,7 +23,6 @@ import org.onosproject.net.config.basics.BasicElementConfig; ...@@ -23,7 +23,6 @@ import org.onosproject.net.config.basics.BasicElementConfig;
23 * Handles configuration for OpenstackSwitching app. 23 * Handles configuration for OpenstackSwitching app.
24 */ 24 */
25 public class OpenstackNetworkingConfig extends Config<ApplicationId> { 25 public class OpenstackNetworkingConfig extends Config<ApplicationId> {
26 - public static final String DONOTPUSH = "do_not_push_flows";
27 public static final String NEUTRON_SERVER = "neutron_server"; 26 public static final String NEUTRON_SERVER = "neutron_server";
28 public static final String KEYSTONE_SERVER = "keystone_server"; 27 public static final String KEYSTONE_SERVER = "keystone_server";
29 public static final String USER_NAME = "user_name"; 28 public static final String USER_NAME = "user_name";
...@@ -31,16 +30,6 @@ public class OpenstackNetworkingConfig extends Config<ApplicationId> { ...@@ -31,16 +30,6 @@ public class OpenstackNetworkingConfig extends Config<ApplicationId> {
31 public static final String PHYSICAL_ROUTER_MAC = "physicalRouterMac"; 30 public static final String PHYSICAL_ROUTER_MAC = "physicalRouterMac";
32 31
33 /** 32 /**
34 - * Returns the flag whether the app pushes flows or not.
35 - *
36 - * @return the flag or false if not set
37 - */
38 - public boolean doNotPushFlows() {
39 - String flag = get(DONOTPUSH, "false");
40 - return Boolean.valueOf(flag);
41 - }
42 -
43 - /**
44 * Returns the Neutron server IP address. 33 * Returns the Neutron server IP address.
45 * 34 *
46 * @return Neutron server IP 35 * @return Neutron server IP
...@@ -84,15 +73,6 @@ public class OpenstackNetworkingConfig extends Config<ApplicationId> { ...@@ -84,15 +73,6 @@ public class OpenstackNetworkingConfig extends Config<ApplicationId> {
84 public String physicalRouterMac() { 73 public String physicalRouterMac() {
85 return get(PHYSICAL_ROUTER_MAC, ""); 74 return get(PHYSICAL_ROUTER_MAC, "");
86 } 75 }
87 - /**
88 - * Sets the flag whether the app pushes flows or not.
89 - *
90 - * @param flag the flag whether the app pushes flows or not
91 - * @return self
92 - */
93 - public BasicElementConfig doNotPushFlows(boolean flag) {
94 - return (BasicElementConfig) setOrClear(DONOTPUSH, flag);
95 - }
96 76
97 /** 77 /**
98 * Sets the neutron server IP address. 78 * Sets the neutron server IP address.
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import com.google.common.collect.Maps; 18 import com.google.common.collect.Maps;
19 import org.onlab.packet.Ip4Address; 19 import org.onlab.packet.Ip4Address;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import java.util.Objects; 18 import java.util.Objects;
19 import static com.google.common.base.Preconditions.checkNotNull; 19 import static com.google.common.base.Preconditions.checkNotNull;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import java.util.Objects; 18 import java.util.Objects;
19 19
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import java.util.Collection; 18 import java.util.Collection;
19 import java.util.Collections; 19 import java.util.Collections;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import java.util.Objects; 18 import java.util.Objects;
19 19
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking; 16 +package org.onosproject.openstackinterface;
17 17
18 import org.onlab.packet.Ip4Address; 18 import org.onlab.packet.Ip4Address;
19 19
......
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +/**
18 + * Application for OpenstackRouting.
19 + */
20 +package org.onosproject.openstackinterface;
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2015-2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<project xmlns="http://maven.apache.org/POM/4.0.0"
18 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
20 + <modelVersion>4.0.0</modelVersion>
21 +
22 + <parent>
23 + <groupId>org.onosproject</groupId>
24 + <artifactId>onos-app-openstackinterface</artifactId>
25 + <version>1.5.0-SNAPSHOT</version>
26 + <relativePath>../pom.xml</relativePath>
27 + </parent>
28 +
29 + <artifactId>onos-app-openstackinterface-app</artifactId>
30 + <packaging>bundle</packaging>
31 +
32 +
33 + <properties>
34 + <onos.app.name>org.onosproject.openstackinterface</onos.app.name>
35 + <onos.app.category>default</onos.app.category>
36 + <onos.app.url>http://onosproject.org</onos.app.url>
37 + <onos.app.readme>Openstack Interface Application.</onos.app.readme>
38 + </properties>
39 +
40 + <dependencies>
41 + <dependency>
42 + <groupId>org.onosproject</groupId>
43 + <artifactId>onos-app-openstackinterface-api</artifactId>
44 + <version>${project.version}</version>
45 + </dependency>
46 + <dependency>
47 + <groupId>org.onosproject</groupId>
48 + <artifactId>onos-rest</artifactId>
49 + <version>${project.version}</version>
50 + </dependency>
51 + <dependency>
52 + <groupId>org.onosproject</groupId>
53 + <artifactId>onlab-rest</artifactId>
54 + <version>${project.version}</version>
55 + </dependency>
56 + <dependency>
57 + <groupId>com.sun.jersey</groupId>
58 + <artifactId>jersey-servlet</artifactId>
59 + </dependency>
60 + <dependency>
61 + <groupId>com.fasterxml.jackson.core</groupId>
62 + <artifactId>jackson-databind</artifactId>
63 + </dependency>
64 + <dependency>
65 + <groupId>com.fasterxml.jackson.core</groupId>
66 + <artifactId>jackson-annotations</artifactId>
67 + </dependency>
68 + <dependency>
69 + <groupId>org.osgi</groupId>
70 + <artifactId>org.osgi.compendium</artifactId>
71 + </dependency>
72 + <dependency>
73 + <groupId>org.osgi</groupId>
74 + <artifactId>org.osgi.core</artifactId>
75 + </dependency>
76 + <dependency>
77 + <groupId>org.onosproject</groupId>
78 + <artifactId>onos-app-dhcp-api</artifactId>
79 + <version>${project.version}</version>
80 + </dependency>
81 + <dependency>
82 + <groupId>com.sun.jersey</groupId>
83 + <artifactId>jersey-client</artifactId>
84 + <version>1.19</version>
85 + </dependency>
86 + <dependency>
87 + <groupId>com.sun.jersey</groupId>
88 + <artifactId>jersey-core</artifactId>
89 + <version>1.19</version>
90 + </dependency>
91 + <dependency>
92 + <groupId>org.onosproject</groupId>
93 + <artifactId>onlab-misc</artifactId>
94 + <version>${project.version}</version>
95 + </dependency>
96 + </dependencies>
97 +
98 +
99 +</project>
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking.web; 16 +package org.onosproject.openstackinterface;
17 17
18 import com.fasterxml.jackson.databind.ObjectMapper; 18 import com.fasterxml.jackson.databind.ObjectMapper;
19 import com.fasterxml.jackson.databind.node.ArrayNode; 19 import com.fasterxml.jackson.databind.node.ArrayNode;
20 import com.fasterxml.jackson.databind.node.ObjectNode; 20 import com.fasterxml.jackson.databind.node.ObjectNode;
21 +import com.google.common.collect.ImmutableSet;
21 import com.google.common.collect.Lists; 22 import com.google.common.collect.Lists;
22 import com.sun.jersey.api.client.Client; 23 import com.sun.jersey.api.client.Client;
23 import com.sun.jersey.api.client.WebResource; 24 import com.sun.jersey.api.client.WebResource;
...@@ -30,26 +31,30 @@ import org.apache.felix.scr.annotations.Service; ...@@ -30,26 +31,30 @@ import org.apache.felix.scr.annotations.Service;
30 import org.onosproject.core.ApplicationId; 31 import org.onosproject.core.ApplicationId;
31 import org.onosproject.core.CoreService; 32 import org.onosproject.core.CoreService;
32 import org.onosproject.net.Port; 33 import org.onosproject.net.Port;
33 -import org.onosproject.net.driver.DriverService; 34 +import org.onosproject.net.config.ConfigFactory;
34 -import org.onosproject.openstacknetworking.OpenstackNetwork; 35 +import org.onosproject.net.config.NetworkConfigEvent;
35 -import org.onosproject.openstacknetworking.OpenstackNetworkingService; 36 +import org.onosproject.net.config.NetworkConfigListener;
36 -import org.onosproject.openstacknetworking.OpenstackPort; 37 +import org.onosproject.net.config.NetworkConfigRegistry;
37 -import org.onosproject.openstacknetworking.OpenstackPortInfo; 38 +import org.onosproject.openstackinterface.web.OpenstackNetworkCodec;
38 -import org.onosproject.openstacknetworking.OpenstackRouter; 39 +import org.onosproject.openstackinterface.web.OpenstackPortCodec;
39 -import org.onosproject.openstacknetworking.OpenstackSecurityGroup; 40 +import org.onosproject.openstackinterface.web.OpenstackRouterCodec;
40 -import org.onosproject.openstacknetworking.OpenstackSubnet; 41 +import org.onosproject.openstackinterface.web.OpenstackSecurityGroupCodec;
41 -import org.onosproject.openstacknetworking.OpenstackSwitchingService; 42 +import org.onosproject.openstackinterface.web.OpenstackSubnetCodec;
42 import org.slf4j.Logger; 43 import org.slf4j.Logger;
43 import javax.ws.rs.core.MediaType; 44 import javax.ws.rs.core.MediaType;
44 import java.io.IOException; 45 import java.io.IOException;
45 import java.util.Collection; 46 import java.util.Collection;
46 import java.util.Collections; 47 import java.util.Collections;
47 import java.util.List; 48 import java.util.List;
48 -import java.util.Map; 49 +import java.util.Set;
50 +import java.util.concurrent.ExecutorService;
51 +import java.util.concurrent.Executors;
49 import java.util.stream.Collectors; 52 import java.util.stream.Collectors;
50 53
51 import static com.google.common.base.Preconditions.checkNotNull; 54 import static com.google.common.base.Preconditions.checkNotNull;
52 import static com.google.common.net.MediaType.JSON_UTF_8; 55 import static com.google.common.net.MediaType.JSON_UTF_8;
56 +import static org.onlab.util.Tools.groupedThreads;
57 +import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY;
53 import static org.slf4j.LoggerFactory.getLogger; 58 import static org.slf4j.LoggerFactory.getLogger;
54 59
55 /** 60 /**
...@@ -58,7 +63,7 @@ import static org.slf4j.LoggerFactory.getLogger; ...@@ -58,7 +63,7 @@ import static org.slf4j.LoggerFactory.getLogger;
58 */ 63 */
59 @Service 64 @Service
60 @Component(immediate = true) 65 @Component(immediate = true)
61 -public class OpenstackNetworkingManager implements OpenstackNetworkingService { 66 +public class OpenstackInterfaceManager implements OpenstackInterfaceService {
62 67
63 private static final String URI_NETWORKS = "networks"; 68 private static final String URI_NETWORKS = "networks";
64 private static final String URI_PORTS = "ports"; 69 private static final String URI_PORTS = "ports";
...@@ -91,20 +96,39 @@ public class OpenstackNetworkingManager implements OpenstackNetworkingService { ...@@ -91,20 +96,39 @@ public class OpenstackNetworkingManager implements OpenstackNetworkingService {
91 protected CoreService coreService; 96 protected CoreService coreService;
92 97
93 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 98 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
94 - protected DriverService driverService; 99 + protected NetworkConfigRegistry cfgService;
100 +
101 + private InternalConfigListener internalConfigListener = new InternalConfigListener();
102 + private ExecutorService networkEventExcutorService =
103 + Executors.newSingleThreadExecutor(groupedThreads("onos/openstackinterface", "config-event"));
104 +
105 + private final Set<ConfigFactory> factories = ImmutableSet.of(
106 + new ConfigFactory<ApplicationId, OpenstackNetworkingConfig>(APP_SUBJECT_FACTORY,
107 + OpenstackNetworkingConfig.class,
108 + "openstackinterface") {
109 + @Override
110 + public OpenstackNetworkingConfig createConfig() {
111 + return new OpenstackNetworkingConfig();
112 + }
113 + }
114 + );
95 115
96 - protected OpenstackSwitchingService openstackSwitchingService;
97 116
98 @Activate 117 @Activate
99 protected void activate() { 118 protected void activate() {
100 appId = coreService 119 appId = coreService
101 - .registerApplication("org.onosproject.openstacknetworking"); 120 + .registerApplication("org.onosproject.openstackinterface");
121 +
122 + factories.forEach(cfgService::registerConfigFactory);
123 + cfgService.addListener(internalConfigListener);
102 124
103 log.info("started"); 125 log.info("started");
104 } 126 }
105 127
106 @Deactivate 128 @Deactivate
107 protected void deactivate() { 129 protected void deactivate() {
130 + cfgService.removeListener(internalConfigListener);
131 + factories.forEach(cfgService::unregisterConfigFactory);
108 log.info("stopped"); 132 log.info("stopped");
109 } 133 }
110 134
...@@ -355,16 +379,31 @@ public class OpenstackNetworkingManager implements OpenstackNetworkingService { ...@@ -355,16 +379,31 @@ public class OpenstackNetworkingManager implements OpenstackNetworkingService {
355 .findAny().orElse(null); 379 .findAny().orElse(null);
356 } 380 }
357 381
358 - @Override 382 + private class InternalConfigListener implements NetworkConfigListener {
359 - public Map<String, OpenstackPortInfo> openstackPortInfo() {
360 - return openstackSwitchingService.openstackPortInfo();
361 - }
362 383
363 - @Override 384 + public void configureNetwork() {
364 - public void setConfigurations(String neutronUrl, String keystoneUrl, String userName, String pass) { 385 + OpenstackNetworkingConfig cfg =
365 - this.neutronUrl = checkNotNull(neutronUrl); 386 + cfgService.getConfig(appId, OpenstackNetworkingConfig.class);
366 - this.keystoneUrl = checkNotNull(keystoneUrl); 387 + if (cfg == null) {
367 - this.userName = checkNotNull(userName); 388 + log.error("There is no openstack server information in config.");
368 - this.pass = checkNotNull(pass); 389 + return;
390 + }
391 +
392 + neutronUrl = checkNotNull(cfg.neutronServer());
393 + keystoneUrl = checkNotNull(cfg.keystoneServer());
394 + userName = checkNotNull(cfg.userName());
395 + pass = checkNotNull(cfg.password());
396 + }
397 +
398 + @Override
399 + public void event(NetworkConfigEvent event) {
400 + if (((event.type() == NetworkConfigEvent.Type.CONFIG_ADDED ||
401 + event.type() == NetworkConfigEvent.Type.CONFIG_UPDATED)) &&
402 + event.configClass().equals(OpenstackNetworkingConfig.class)) {
403 +
404 + log.info("Network configuration changed");
405 + networkEventExcutorService.execute(this::configureNetwork);
406 + }
407 + }
369 } 408 }
370 } 409 }
...\ No newline at end of file ...\ No newline at end of file
......
1 +/*
2 + * Copyright 2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +/**
18 + * Application for OpenstackRouting.
19 + */
20 +package org.onosproject.openstackinterface;
...\ No newline at end of file ...\ No newline at end of file
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking.web; 16 +package org.onosproject.openstackinterface.web;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 import com.fasterxml.jackson.databind.node.ObjectNode; 19 import com.fasterxml.jackson.databind.node.ObjectNode;
20 import org.onosproject.codec.CodecContext; 20 import org.onosproject.codec.CodecContext;
21 import org.onosproject.codec.JsonCodec; 21 import org.onosproject.codec.JsonCodec;
22 -import org.onosproject.openstacknetworking.OpenstackNetwork; 22 +import org.onosproject.openstackinterface.OpenstackNetwork;
23 import org.slf4j.Logger; 23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory; 24 import org.slf4j.LoggerFactory;
25 25
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking.web; 16 +package org.onosproject.openstackinterface.web;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 import com.fasterxml.jackson.databind.node.ArrayNode; 19 import com.fasterxml.jackson.databind.node.ArrayNode;
...@@ -25,7 +25,7 @@ import org.onlab.packet.IpAddress; ...@@ -25,7 +25,7 @@ import org.onlab.packet.IpAddress;
25 import org.onlab.packet.MacAddress; 25 import org.onlab.packet.MacAddress;
26 import org.onosproject.codec.CodecContext; 26 import org.onosproject.codec.CodecContext;
27 import org.onosproject.codec.JsonCodec; 27 import org.onosproject.codec.JsonCodec;
28 -import org.onosproject.openstacknetworking.OpenstackPort; 28 +import org.onosproject.openstackinterface.OpenstackPort;
29 import org.slf4j.Logger; 29 import org.slf4j.Logger;
30 import org.slf4j.LoggerFactory; 30 import org.slf4j.LoggerFactory;
31 31
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking.web; 16 +package org.onosproject.openstackinterface.web;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 import com.fasterxml.jackson.databind.node.ArrayNode; 19 import com.fasterxml.jackson.databind.node.ArrayNode;
...@@ -22,8 +22,8 @@ import com.google.common.collect.Maps; ...@@ -22,8 +22,8 @@ import com.google.common.collect.Maps;
22 import org.onlab.packet.Ip4Address; 22 import org.onlab.packet.Ip4Address;
23 import org.onosproject.codec.CodecContext; 23 import org.onosproject.codec.CodecContext;
24 import org.onosproject.codec.JsonCodec; 24 import org.onosproject.codec.JsonCodec;
25 -import org.onosproject.openstacknetworking.OpenstackExternalGateway; 25 +import org.onosproject.openstackinterface.OpenstackExternalGateway;
26 -import org.onosproject.openstacknetworking.OpenstackRouter; 26 +import org.onosproject.openstackinterface.OpenstackRouter;
27 import org.slf4j.Logger; 27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
29 import static com.google.common.base.Preconditions.checkNotNull; 29 import static com.google.common.base.Preconditions.checkNotNull;
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking.web; 16 +package org.onosproject.openstackinterface.web;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 import com.fasterxml.jackson.databind.node.ObjectNode; 19 import com.fasterxml.jackson.databind.node.ObjectNode;
20 import org.onosproject.codec.CodecContext; 20 import org.onosproject.codec.CodecContext;
21 import org.onosproject.codec.JsonCodec; 21 import org.onosproject.codec.JsonCodec;
22 -import org.onosproject.openstacknetworking.OpenstackRouterInterface; 22 +import org.onosproject.openstackinterface.OpenstackRouterInterface;
23 import org.slf4j.Logger; 23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory; 24 import org.slf4j.LoggerFactory;
25 import static com.google.common.base.Preconditions.checkNotNull; 25 import static com.google.common.base.Preconditions.checkNotNull;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking.web; 16 +package org.onosproject.openstackinterface.web;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 import com.fasterxml.jackson.databind.node.ArrayNode; 19 import com.fasterxml.jackson.databind.node.ArrayNode;
...@@ -21,8 +21,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; ...@@ -21,8 +21,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
21 import com.google.common.collect.Lists; 21 import com.google.common.collect.Lists;
22 import org.onosproject.codec.CodecContext; 22 import org.onosproject.codec.CodecContext;
23 import org.onosproject.codec.JsonCodec; 23 import org.onosproject.codec.JsonCodec;
24 -import org.onosproject.openstacknetworking.OpenstackSecurityGroup; 24 +import org.onosproject.openstackinterface.OpenstackSecurityGroup;
25 -import org.onosproject.openstacknetworking.OpenstackSecurityGroupRule; 25 +import org.onosproject.openstackinterface.OpenstackSecurityGroupRule;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory; 27 import org.slf4j.LoggerFactory;
28 28
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package org.onosproject.openstacknetworking.web; 16 +package org.onosproject.openstackinterface.web;
17 17
18 import com.fasterxml.jackson.databind.JsonNode; 18 import com.fasterxml.jackson.databind.JsonNode;
19 19
...@@ -24,7 +24,7 @@ import com.google.common.collect.Lists; ...@@ -24,7 +24,7 @@ import com.google.common.collect.Lists;
24 import org.onlab.packet.Ip4Address; 24 import org.onlab.packet.Ip4Address;
25 import org.onosproject.codec.CodecContext; 25 import org.onosproject.codec.CodecContext;
26 import org.onosproject.codec.JsonCodec; 26 import org.onosproject.codec.JsonCodec;
27 -import org.onosproject.openstacknetworking.OpenstackSubnet; 27 +import org.onosproject.openstackinterface.OpenstackSubnet;
28 import org.slf4j.Logger; 28 import org.slf4j.Logger;
29 import org.slf4j.LoggerFactory; 29 import org.slf4j.LoggerFactory;
30 30
......
1 +/*
2 + * Copyright 2015-2016 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
17 +/**
18 + * OpenStack networking implementation.
19 + */
20 +package org.onosproject.openstackinterface.web;
1 +{
2 + "apps" : {
3 + "org.onosproject.openstackinterface" : {
4 + "openstackinterface" : {
5 + "neutron_server" : "http://10.40.101.209:9696/v2.0/",
6 + "keystone_server" : "http://10.40.101.209:5000/v2.0/",
7 + "user_name" : "admin",
8 + "password" : "nova"
9 + }
10 + }
11 + },
12 + "devices" : {
13 + "of:0000000000000001" : {
14 + "basic" : {
15 + "driver" : "sona"
16 + }
17 + },
18 + "of:0000000000000002" : {
19 + "basic" : {
20 + "driver" : "sona"
21 + }
22 + },
23 + "of:0000000000000003" : {
24 + "basic" : {
25 + "driver" : "sona"
26 + }
27 + }
28 + }
29 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!--
3 + ~ Copyright 2016 Open Networking Laboratory
4 + ~
5 + ~ Licensed under the Apache License, Version 2.0 (the "License");
6 + ~ you may not use this file except in compliance with the License.
7 + ~ You may obtain a copy of the License at
8 + ~
9 + ~ http://www.apache.org/licenses/LICENSE-2.0
10 + ~
11 + ~ Unless required by applicable law or agreed to in writing, software
12 + ~ distributed under the License is distributed on an "AS IS" BASIS,
13 + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 + ~ See the License for the specific language governing permissions and
15 + ~ limitations under the License.
16 + -->
17 +<project xmlns="http://maven.apache.org/POM/4.0.0"
18 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20 + <modelVersion>4.0.0</modelVersion>
21 +
22 + <parent>
23 + <groupId>org.onosproject</groupId>
24 + <artifactId>onos-apps</artifactId>
25 + <version>1.5.0-SNAPSHOT</version>
26 + <relativePath>../pom.xml</relativePath>
27 + </parent>
28 +
29 + <artifactId>onos-app-openstackinterface</artifactId>
30 + <packaging>pom</packaging>
31 +
32 + <modules>
33 + <module>api</module>
34 + <module>app</module>
35 + </modules>
36 +
37 +</project>
38 +
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
31 31
32 <dependencies> 32 <dependencies>
33 <dependency> 33 <dependency>
34 + <groupId>org.onosproject</groupId>
35 + <artifactId>onos-app-openstackinterface-api</artifactId>
36 + <version>1.5.0-SNAPSHOT</version>
37 + </dependency>
38 + <dependency>
34 <groupId>org.osgi</groupId> 39 <groupId>org.osgi</groupId>
35 <artifactId>org.osgi.compendium</artifactId> 40 <artifactId>org.osgi.compendium</artifactId>
36 </dependency> 41 </dependency>
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
15 */ 15 */
16 package org.onosproject.openstacknetworking; 16 package org.onosproject.openstacknetworking;
17 17
18 +import org.onosproject.openstackinterface.OpenstackFloatingIP;
19 +import org.onosproject.openstackinterface.OpenstackRouter;
20 +import org.onosproject.openstackinterface.OpenstackRouterInterface;
21 +
18 /** 22 /**
19 * The Interface of Openstack Routing. 23 * The Interface of Openstack Routing.
20 */ 24 */
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
15 */ 15 */
16 package org.onosproject.openstacknetworking; 16 package org.onosproject.openstacknetworking;
17 17
18 +import org.onosproject.openstackinterface.OpenstackNetwork;
19 +import org.onosproject.openstackinterface.OpenstackPort;
20 +import org.onosproject.openstackinterface.OpenstackSubnet;
21 +
18 import java.util.Map; 22 import java.util.Map;
19 23
20 /** 24 /**
......
...@@ -48,6 +48,11 @@ ...@@ -48,6 +48,11 @@
48 <artifactId>onos-app-openstacknetworking-api</artifactId> 48 <artifactId>onos-app-openstacknetworking-api</artifactId>
49 <version>${project.version}</version> 49 <version>${project.version}</version>
50 </dependency> 50 </dependency>
51 + <dependency>
52 + <groupId>org.onosproject</groupId>
53 + <artifactId>onos-app-openstackinterface-api</artifactId>
54 + <version>${project.version}</version>
55 + </dependency>
51 </dependencies> 56 </dependencies>
52 </project> 57 </project>
53 58
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 */ 15 */
16 package org.onosproject.openstacknetworking.routing; 16 package org.onosproject.openstacknetworking.routing;
17 17
18 -import org.onosproject.event.AbstractEvent; 18 + import org.onosproject.event.AbstractEvent;
19 19
20 /** 20 /**
21 * Handle FloatingIP Event for Managing Flow Rules In Openstack Nodes. 21 * Handle FloatingIP Event for Managing Flow Rules In Openstack Nodes.
......
...@@ -29,10 +29,10 @@ import org.onosproject.net.packet.DefaultOutboundPacket; ...@@ -29,10 +29,10 @@ import org.onosproject.net.packet.DefaultOutboundPacket;
29 import org.onosproject.net.packet.InboundPacket; 29 import org.onosproject.net.packet.InboundPacket;
30 import org.onosproject.net.packet.PacketContext; 30 import org.onosproject.net.packet.PacketContext;
31 import org.onosproject.net.packet.PacketService; 31 import org.onosproject.net.packet.PacketService;
32 -import org.onosproject.openstacknetworking.OpenstackNetwork; 32 +import org.onosproject.openstackinterface.OpenstackInterfaceService;
33 -import org.onosproject.openstacknetworking.OpenstackNetworkingService; 33 +import org.onosproject.openstackinterface.OpenstackNetwork;
34 -import org.onosproject.openstacknetworking.OpenstackPort; 34 +import org.onosproject.openstackinterface.OpenstackPort;
35 -import org.onosproject.openstacknetworking.OpenstackRouter; 35 +import org.onosproject.openstackinterface.OpenstackRouter;
36 import org.slf4j.Logger; 36 import org.slf4j.Logger;
37 import org.slf4j.LoggerFactory; 37 import org.slf4j.LoggerFactory;
38 38
...@@ -91,7 +91,7 @@ public class OpenstackPnatHandler implements Runnable { ...@@ -91,7 +91,7 @@ public class OpenstackPnatHandler implements Runnable {
91 } 91 }
92 92
93 private OpenstackRouter getOpenstackRouter(OpenstackPort openstackPort) { 93 private OpenstackRouter getOpenstackRouter(OpenstackPort openstackPort) {
94 - OpenstackNetworkingService networkingService = getService(OpenstackNetworkingService.class); 94 + OpenstackInterfaceService networkingService = getService(OpenstackInterfaceService.class);
95 OpenstackNetwork network = networkingService.network(openstackPort.networkId()); 95 OpenstackNetwork network = networkingService.network(openstackPort.networkId());
96 96
97 OpenstackPort port = networkingService.ports() 97 OpenstackPort port = networkingService.ports()
......
...@@ -39,11 +39,11 @@ import org.onosproject.net.packet.InboundPacket; ...@@ -39,11 +39,11 @@ import org.onosproject.net.packet.InboundPacket;
39 import org.onosproject.net.packet.PacketContext; 39 import org.onosproject.net.packet.PacketContext;
40 import org.onosproject.net.packet.PacketProcessor; 40 import org.onosproject.net.packet.PacketProcessor;
41 import org.onosproject.net.packet.PacketService; 41 import org.onosproject.net.packet.PacketService;
42 -import org.onosproject.openstacknetworking.OpenstackFloatingIP; 42 +import org.onosproject.openstackinterface.OpenstackFloatingIP;
43 -import org.onosproject.openstacknetworking.OpenstackNetworkingService; 43 +import org.onosproject.openstackinterface.OpenstackInterfaceService;
44 -import org.onosproject.openstacknetworking.OpenstackPort; 44 +import org.onosproject.openstackinterface.OpenstackPort;
45 -import org.onosproject.openstacknetworking.OpenstackRouter; 45 +import org.onosproject.openstackinterface.OpenstackRouter;
46 -import org.onosproject.openstacknetworking.OpenstackRouterInterface; 46 +import org.onosproject.openstackinterface.OpenstackRouterInterface;
47 import org.onosproject.openstacknetworking.OpenstackRoutingService; 47 import org.onosproject.openstacknetworking.OpenstackRoutingService;
48 import org.slf4j.Logger; 48 import org.slf4j.Logger;
49 import org.slf4j.LoggerFactory; 49 import org.slf4j.LoggerFactory;
...@@ -77,7 +77,7 @@ public class OpenstackRoutingManager implements OpenstackRoutingService { ...@@ -77,7 +77,7 @@ public class OpenstackRoutingManager implements OpenstackRoutingService {
77 protected DeviceService deviceService; 77 protected DeviceService deviceService;
78 78
79 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 79 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
80 - protected OpenstackNetworkingService openstackService; 80 + protected OpenstackInterfaceService openstackService;
81 81
82 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 82 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
83 protected FlowObjectiveService flowObjectiveService; 83 protected FlowObjectiveService flowObjectiveService;
......
...@@ -47,11 +47,11 @@ import org.onosproject.net.flowobjective.DefaultForwardingObjective; ...@@ -47,11 +47,11 @@ import org.onosproject.net.flowobjective.DefaultForwardingObjective;
47 import org.onosproject.net.flowobjective.FlowObjectiveService; 47 import org.onosproject.net.flowobjective.FlowObjectiveService;
48 import org.onosproject.net.flowobjective.ForwardingObjective; 48 import org.onosproject.net.flowobjective.ForwardingObjective;
49 import org.onosproject.net.packet.InboundPacket; 49 import org.onosproject.net.packet.InboundPacket;
50 -import org.onosproject.openstacknetworking.OpenstackNetworkingService; 50 +import org.onosproject.openstackinterface.OpenstackInterfaceService;
51 -import org.onosproject.openstacknetworking.OpenstackPort; 51 +import org.onosproject.openstackinterface.OpenstackPort;
52 -import org.onosproject.openstacknetworking.OpenstackRouter; 52 +import org.onosproject.openstackinterface.OpenstackRouter;
53 -import org.onosproject.openstacknetworking.OpenstackRouterInterface; 53 +import org.onosproject.openstackinterface.OpenstackRouterInterface;
54 -import org.onosproject.openstacknetworking.OpenstackSubnet; 54 +import org.onosproject.openstackinterface.OpenstackSubnet;
55 import org.slf4j.Logger; 55 import org.slf4j.Logger;
56 import org.slf4j.LoggerFactory; 56 import org.slf4j.LoggerFactory;
57 57
...@@ -68,7 +68,7 @@ public class OpenstackRoutingRulePopulator { ...@@ -68,7 +68,7 @@ public class OpenstackRoutingRulePopulator {
68 68
69 private final ApplicationId appId; 69 private final ApplicationId appId;
70 private final FlowObjectiveService flowObjectiveService; 70 private final FlowObjectiveService flowObjectiveService;
71 - private final OpenstackNetworkingService openstackService; 71 + private final OpenstackInterfaceService openstackService;
72 private final DeviceService deviceService; 72 private final DeviceService deviceService;
73 private final DriverService driverService; 73 private final DriverService driverService;
74 74
...@@ -105,7 +105,7 @@ public class OpenstackRoutingRulePopulator { ...@@ -105,7 +105,7 @@ public class OpenstackRoutingRulePopulator {
105 * @param deviceService DeviceService 105 * @param deviceService DeviceService
106 * @param driverService DriverService 106 * @param driverService DriverService
107 */ 107 */
108 - public OpenstackRoutingRulePopulator(ApplicationId appId, OpenstackNetworkingService openstackService, 108 + public OpenstackRoutingRulePopulator(ApplicationId appId, OpenstackInterfaceService openstackService,
109 FlowObjectiveService flowObjectiveService, 109 FlowObjectiveService flowObjectiveService,
110 DeviceService deviceService, DriverService driverService) { 110 DeviceService deviceService, DriverService driverService) {
111 this.appId = appId; 111 this.appId = appId;
......
...@@ -37,6 +37,11 @@ ...@@ -37,6 +37,11 @@
37 </dependency> 37 </dependency>
38 <dependency> 38 <dependency>
39 <groupId>org.onosproject</groupId> 39 <groupId>org.onosproject</groupId>
40 + <artifactId>onos-app-openstackinterface-api</artifactId>
41 + <version>${project.version}</version>
42 + </dependency>
43 + <dependency>
44 + <groupId>org.onosproject</groupId>
40 <artifactId>onos-app-dhcp</artifactId> 45 <artifactId>onos-app-dhcp</artifactId>
41 <version>${project.version}</version> 46 <version>${project.version}</version>
42 </dependency> 47 </dependency>
......
...@@ -27,8 +27,8 @@ import org.onosproject.net.host.HostService; ...@@ -27,8 +27,8 @@ import org.onosproject.net.host.HostService;
27 import org.onosproject.net.packet.DefaultOutboundPacket; 27 import org.onosproject.net.packet.DefaultOutboundPacket;
28 import org.onosproject.net.packet.InboundPacket; 28 import org.onosproject.net.packet.InboundPacket;
29 import org.onosproject.net.packet.PacketService; 29 import org.onosproject.net.packet.PacketService;
30 -import org.onosproject.openstacknetworking.OpenstackNetworkingService; 30 +import org.onosproject.openstackinterface.OpenstackInterfaceService;
31 -import org.onosproject.openstacknetworking.OpenstackPort; 31 +import org.onosproject.openstackinterface.OpenstackPort;
32 import org.onosproject.openstacknetworking.OpenstackPortInfo; 32 import org.onosproject.openstacknetworking.OpenstackPortInfo;
33 import org.slf4j.Logger; 33 import org.slf4j.Logger;
34 import org.slf4j.LoggerFactory; 34 import org.slf4j.LoggerFactory;
...@@ -46,7 +46,7 @@ public class OpenstackArpHandler { ...@@ -46,7 +46,7 @@ public class OpenstackArpHandler {
46 .getLogger(OpenstackArpHandler.class); 46 .getLogger(OpenstackArpHandler.class);
47 private static final MacAddress GATEWAY_MAC = MacAddress.valueOf("1f:1f:1f:1f:1f:1f"); 47 private static final MacAddress GATEWAY_MAC = MacAddress.valueOf("1f:1f:1f:1f:1f:1f");
48 private PacketService packetService; 48 private PacketService packetService;
49 - private OpenstackNetworkingService openstackService; 49 + private OpenstackInterfaceService openstackService;
50 private HostService hostService; 50 private HostService hostService;
51 51
52 /** 52 /**
...@@ -56,7 +56,7 @@ public class OpenstackArpHandler { ...@@ -56,7 +56,7 @@ public class OpenstackArpHandler {
56 * @param packetService PacketService reference 56 * @param packetService PacketService reference
57 * @param hostService host service 57 * @param hostService host service
58 */ 58 */
59 - public OpenstackArpHandler(OpenstackNetworkingService openstackService, PacketService packetService, 59 + public OpenstackArpHandler(OpenstackInterfaceService openstackService, PacketService packetService,
60 HostService hostService) { 60 HostService hostService) {
61 this.openstackService = openstackService; 61 this.openstackService = openstackService;
62 this.packetService = packetService; 62 this.packetService = packetService;
......
...@@ -40,9 +40,9 @@ import org.onosproject.net.flow.instructions.ExtensionTreatmentType; ...@@ -40,9 +40,9 @@ import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
40 import org.onosproject.net.flowobjective.DefaultForwardingObjective; 40 import org.onosproject.net.flowobjective.DefaultForwardingObjective;
41 import org.onosproject.net.flowobjective.FlowObjectiveService; 41 import org.onosproject.net.flowobjective.FlowObjectiveService;
42 import org.onosproject.net.flowobjective.ForwardingObjective; 42 import org.onosproject.net.flowobjective.ForwardingObjective;
43 -import org.onosproject.openstacknetworking.OpenstackNetwork; 43 +import org.onosproject.openstackinterface.OpenstackInterfaceService;
44 -import org.onosproject.openstacknetworking.OpenstackNetworkingService; 44 +import org.onosproject.openstackinterface.OpenstackNetwork;
45 -import org.onosproject.openstacknetworking.OpenstackPort; 45 +import org.onosproject.openstackinterface.OpenstackPort;
46 import org.onosproject.openstacknetworking.OpenstackPortInfo; 46 import org.onosproject.openstacknetworking.OpenstackPortInfo;
47 import org.slf4j.Logger; 47 import org.slf4j.Logger;
48 import org.slf4j.LoggerFactory; 48 import org.slf4j.LoggerFactory;
...@@ -80,7 +80,7 @@ public class OpenstackSwitchingRulePopulator { ...@@ -80,7 +80,7 @@ public class OpenstackSwitchingRulePopulator {
80 public OpenstackSwitchingRulePopulator(ApplicationId appId, 80 public OpenstackSwitchingRulePopulator(ApplicationId appId,
81 FlowObjectiveService flowObjectiveService, 81 FlowObjectiveService flowObjectiveService,
82 DeviceService deviceService, 82 DeviceService deviceService,
83 - OpenstackNetworkingService openstackService, 83 + OpenstackInterfaceService openstackService,
84 DriverService driverService) { 84 DriverService driverService) {
85 this.flowObjectiveService = flowObjectiveService; 85 this.flowObjectiveService = flowObjectiveService;
86 this.deviceService = deviceService; 86 this.deviceService = deviceService;
...@@ -95,14 +95,10 @@ public class OpenstackSwitchingRulePopulator { ...@@ -95,14 +95,10 @@ public class OpenstackSwitchingRulePopulator {
95 /** 95 /**
96 * Populates flow rules for the VM created. 96 * Populates flow rules for the VM created.
97 * 97 *
98 - * @param doNotPushFlow true to suppress push of initial flows
99 * @param device device to populate rules to 98 * @param device device to populate rules to
100 * @param port port for the VM created 99 * @param port port for the VM created
101 */ 100 */
102 - public void populateSwitchingRules(boolean doNotPushFlow, Device device, Port port) { 101 + public void populateSwitchingRules(Device device, Port port) {
103 - if (doNotPushFlow) {
104 - return;
105 - }
106 populateFlowRulesForTunnelTag(device, port); 102 populateFlowRulesForTunnelTag(device, port);
107 populateFlowRulesForTrafficToSameCnode(device, port); 103 populateFlowRulesForTrafficToSameCnode(device, port);
108 populateFlowRulesForTrafficToDifferentCnode(device, port); 104 populateFlowRulesForTrafficToDifferentCnode(device, port);
...@@ -271,15 +267,11 @@ public class OpenstackSwitchingRulePopulator { ...@@ -271,15 +267,11 @@ public class OpenstackSwitchingRulePopulator {
271 /** 267 /**
272 * Remove flows rules for the removed VM. 268 * Remove flows rules for the removed VM.
273 * 269 *
274 - * @param doNotPushFlows true to suppress push of initial flows
275 * @param removedPort removedport info 270 * @param removedPort removedport info
276 * @param openstackPortInfoMap openstackPortInfoMap 271 * @param openstackPortInfoMap openstackPortInfoMap
277 */ 272 */
278 - public void removeSwitchingRules(boolean doNotPushFlows, Port removedPort, Map<String, 273 + public void removeSwitchingRules(Port removedPort, Map<String,
279 OpenstackPortInfo> openstackPortInfoMap) { 274 OpenstackPortInfo> openstackPortInfoMap) {
280 - if (doNotPushFlows) {
281 - return;
282 - }
283 OpenstackPortInfo openstackPortInfo = openstackPortInfoMap 275 OpenstackPortInfo openstackPortInfo = openstackPortInfoMap
284 .get(removedPort.annotations().value("portName")); 276 .get(removedPort.annotations().value("portName"));
285 277
......
...@@ -47,6 +47,16 @@ ...@@ -47,6 +47,16 @@
47 </dependency> 47 </dependency>
48 <dependency> 48 <dependency>
49 <groupId>org.onosproject</groupId> 49 <groupId>org.onosproject</groupId>
50 + <artifactId>onos-app-openstackinterface-app</artifactId>
51 + <version>${project.version}</version>
52 + </dependency>
53 + <dependency>
54 + <groupId>org.onosproject</groupId>
55 + <artifactId>onos-app-openstackinterface-api</artifactId>
56 + <version>${project.version}</version>
57 + </dependency>
58 + <dependency>
59 + <groupId>org.onosproject</groupId>
50 <artifactId>onos-rest</artifactId> 60 <artifactId>onos-rest</artifactId>
51 <version>${project.version}</version> 61 <version>${project.version}</version>
52 </dependency> 62 </dependency>
......
...@@ -17,8 +17,10 @@ package org.onosproject.openstacknetworking.web; ...@@ -17,8 +17,10 @@ package org.onosproject.openstacknetworking.web;
17 17
18 import com.fasterxml.jackson.databind.ObjectMapper; 18 import com.fasterxml.jackson.databind.ObjectMapper;
19 import com.fasterxml.jackson.databind.node.ObjectNode; 19 import com.fasterxml.jackson.databind.node.ObjectNode;
20 -import org.onosproject.openstacknetworking.OpenstackRouter; 20 +import org.onosproject.openstackinterface.OpenstackRouter;
21 -import org.onosproject.openstacknetworking.OpenstackRouterInterface; 21 +import org.onosproject.openstackinterface.OpenstackRouterInterface;
22 +import org.onosproject.openstackinterface.web.OpenstackRouterCodec;
23 +import org.onosproject.openstackinterface.web.OpenstackRouterInterfaceCodec;
22 import org.onosproject.openstacknetworking.OpenstackRoutingService; 24 import org.onosproject.openstacknetworking.OpenstackRoutingService;
23 import org.onosproject.rest.AbstractWebResource; 25 import org.onosproject.rest.AbstractWebResource;
24 import org.slf4j.Logger; 26 import org.slf4j.Logger;
......
...@@ -17,7 +17,8 @@ package org.onosproject.openstacknetworking.web; ...@@ -17,7 +17,8 @@ package org.onosproject.openstacknetworking.web;
17 17
18 import com.fasterxml.jackson.databind.ObjectMapper; 18 import com.fasterxml.jackson.databind.ObjectMapper;
19 import com.fasterxml.jackson.databind.node.ObjectNode; 19 import com.fasterxml.jackson.databind.node.ObjectNode;
20 -import org.onosproject.openstacknetworking.OpenstackPort; 20 +import org.onosproject.openstackinterface.OpenstackPort;
21 +import org.onosproject.openstackinterface.web.OpenstackPortCodec;
21 import org.onosproject.openstacknetworking.OpenstackSwitchingService; 22 import org.onosproject.openstacknetworking.OpenstackSwitchingService;
22 import org.onosproject.rest.AbstractWebResource; 23 import org.onosproject.rest.AbstractWebResource;
23 import org.slf4j.Logger; 24 import org.slf4j.Logger;
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
68 <module>vpls</module> 68 <module>vpls</module>
69 <module>openstacknode</module> 69 <module>openstacknode</module>
70 <module>openstacknetworking</module> 70 <module>openstacknetworking</module>
71 + <module>openstackinterface</module>
71 </modules> 72 </modules>
72 73
73 <properties> 74 <properties>
......