aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/routing
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/apps/routing')
-rw-r--r--framework/src/onos/apps/routing/pom.xml2
-rw-r--r--framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java27
-rw-r--r--framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java14
-rw-r--r--framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/impl/Router.java7
-rw-r--r--framework/src/onos/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java22
5 files changed, 27 insertions, 45 deletions
diff --git a/framework/src/onos/apps/routing/pom.xml b/framework/src/onos/apps/routing/pom.xml
index 1d9f19b7..c461ef3f 100644
--- a/framework/src/onos/apps/routing/pom.xml
+++ b/framework/src/onos/apps/routing/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>onos-apps</artifactId>
<groupId>org.onosproject</groupId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
index 57481c20..ab8a0493 100644
--- a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
+++ b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
@@ -300,21 +300,18 @@ public class BgpSessionManager implements BgpInfoService, BgpService {
ChannelFactory channelFactory = new NioServerSocketChannelFactory(
newCachedThreadPool(groupedThreads("onos/bgp", "sm-boss-%d")),
newCachedThreadPool(groupedThreads("onos/bgp", "sm-worker-%d")));
- ChannelPipelineFactory pipelineFactory = new ChannelPipelineFactory() {
- @Override
- public ChannelPipeline getPipeline() throws Exception {
- // Allocate a new session per connection
- BgpSession bgpSessionHandler =
- new BgpSession(BgpSessionManager.this);
- BgpFrameDecoder bgpFrameDecoder =
- new BgpFrameDecoder(bgpSessionHandler);
-
- // Setup the processing pipeline
- ChannelPipeline pipeline = Channels.pipeline();
- pipeline.addLast("BgpFrameDecoder", bgpFrameDecoder);
- pipeline.addLast("BgpSession", bgpSessionHandler);
- return pipeline;
- }
+ ChannelPipelineFactory pipelineFactory = () -> {
+ // Allocate a new session per connection
+ BgpSession bgpSessionHandler =
+ new BgpSession(BgpSessionManager.this);
+ BgpFrameDecoder bgpFrameDecoder =
+ new BgpFrameDecoder(bgpSessionHandler);
+
+ // Setup the processing pipeline
+ ChannelPipeline pipeline = Channels.pipeline();
+ pipeline.addLast("BgpFrameDecoder", bgpFrameDecoder);
+ pipeline.addLast("BgpSession", bgpSessionHandler);
+ return pipeline;
};
InetSocketAddress listenAddress =
new InetSocketAddress(bgpPort);
diff --git a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
index 1078319d..0a6f9d4c 100644
--- a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
+++ b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
@@ -38,7 +38,6 @@ import org.onosproject.net.config.ConfigFactory;
import org.onosproject.net.config.NetworkConfigRegistry;
import org.onosproject.net.config.NetworkConfigService;
import org.onosproject.net.config.basics.SubjectFactories;
-import org.onosproject.net.host.HostService;
import org.onosproject.routing.config.BgpConfig;
import org.onosproject.routing.config.BgpPeer;
import org.onosproject.routing.config.BgpSpeaker;
@@ -76,9 +75,6 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService {
private String configFileName = DEFAULT_CONFIG_FILE;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected HostService hostService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected NetworkConfigRegistry registry;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
@@ -103,7 +99,6 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService {
new DefaultByteArrayNodeFactory());
private MacAddress virtualGatewayMacAddress;
- private HostToInterfaceAdaptor hostAdaptor;
private ConfigFactory configFactory =
new ConfigFactory(SubjectFactories.APP_SUBJECT_FACTORY, BgpConfig.class, "bgp") {
@@ -117,7 +112,6 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService {
public void activate() {
registry.registerConfigFactory(configFactory);
readConfiguration();
- hostAdaptor = new HostToInterfaceAdaptor(hostService);
log.info("Routing configuration service started");
}
@@ -189,7 +183,7 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService {
@Override
public Set<Interface> getInterfaces() {
- return hostAdaptor.getInterfaces();
+ return Collections.emptySet();
}
@Override
@@ -212,17 +206,17 @@ public class RoutingConfigurationImpl implements RoutingConfigurationService {
@Override
public Interface getInterface(ConnectPoint connectPoint) {
- return hostAdaptor.getInterface(connectPoint);
+ return null;
}
@Override
public Interface getInterface(IpAddress ip) {
- return hostAdaptor.getInterface(ip);
+ return null;
}
@Override
public Interface getMatchingInterface(IpAddress ipAddress) {
- return hostAdaptor.getMatchingInterface(ipAddress);
+ return null;
}
@Override
diff --git a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/impl/Router.java b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/impl/Router.java
index c4f291ba..6700d530 100644
--- a/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/impl/Router.java
+++ b/framework/src/onos/apps/routing/src/main/java/org/onosproject/routing/impl/Router.java
@@ -159,12 +159,7 @@ public class Router implements RoutingService {
bgpService.start(new InternalRouteListener());
- bgpUpdatesExecutor.execute(new Runnable() {
- @Override
- public void run() {
- doUpdatesThread();
- }
- });
+ bgpUpdatesExecutor.execute(this::doUpdatesThread);
}
@Override
diff --git a/framework/src/onos/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java b/framework/src/onos/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
index 634e87b9..3f5a6b8b 100644
--- a/framework/src/onos/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
+++ b/framework/src/onos/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
@@ -151,19 +151,15 @@ public class BgpSessionManagerTest {
new NioClientSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
- ChannelPipelineFactory pipelineFactory =
- new ChannelPipelineFactory() {
- @Override
- public ChannelPipeline getPipeline() throws Exception {
- // Setup the transmitting pipeline
- ChannelPipeline pipeline = Channels.pipeline();
- pipeline.addLast("TestBgpPeerFrameDecoder",
- peerFrameDecoder);
- pipeline.addLast("TestBgpPeerChannelHandler",
- peerChannelHandler);
- return pipeline;
- }
- };
+ ChannelPipelineFactory pipelineFactory = () -> {
+ // Setup the transmitting pipeline
+ ChannelPipeline pipeline = Channels.pipeline();
+ pipeline.addLast("TestBgpPeerFrameDecoder",
+ peerFrameDecoder);
+ pipeline.addLast("TestBgpPeerChannelHandler",
+ peerChannelHandler);
+ return pipeline;
+ };
peerBootstrap = new ClientBootstrap(channelFactory);
peerBootstrap.setOption("child.keepAlive", true);