summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/vtn
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/apps/vtn')
-rw-r--r--framework/src/onos/apps/vtn/pom.xml26
-rw-r--r--framework/src/onos/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java46
2 files changed, 34 insertions, 38 deletions
diff --git a/framework/src/onos/apps/vtn/pom.xml b/framework/src/onos/apps/vtn/pom.xml
index 56aa99d6..fb8fcb13 100644
--- a/framework/src/onos/apps/vtn/pom.xml
+++ b/framework/src/onos/apps/vtn/pom.xml
@@ -1,12 +1,28 @@
<?xml version="1.0"?>
+<!--
+ ~ Copyright 2015 Open Networking Laboratory
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-apps</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -26,10 +42,6 @@
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
- <artifactId>onos-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onosproject</groupId>
<artifactId>onos-incubator-api</artifactId>
</dependency>
<dependency>
diff --git a/framework/src/onos/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java b/framework/src/onos/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
index 01c98825..ba4745b6 100644
--- a/framework/src/onos/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
+++ b/framework/src/onos/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
@@ -289,12 +289,10 @@ public class VTNManager implements VTNService {
ports.stream()
.filter(p -> p.name()
.equalsIgnoreCase(tunnelName))
- .forEach(p -> {
- programTunnelOut(sw.deviceId(),
- network.segmentationId(), p,
- host.mac(), appId,
- Objective.Operation.ADD);
- });
+ .forEach(p -> programTunnelOut(sw.deviceId(),
+ network.segmentationId(), p,
+ host.mac(), appId,
+ Objective.Operation.ADD));
}
});
programLocalIn(deviceId, network.segmentationId(), inPort, host.mac(),
@@ -355,12 +353,10 @@ public class VTNManager implements VTNService {
ports.stream()
.filter(p -> p.name()
.equalsIgnoreCase(tunnelName))
- .forEach(p -> {
- programTunnelOut(sw.deviceId(),
- segId, p,
- host.mac(), appId,
- Objective.Operation.REMOVE);
- });
+ .forEach(p -> programTunnelOut(sw.deviceId(),
+ segId, p,
+ host.mac(), appId,
+ Objective.Operation.REMOVE));
}
});
programLocalIn(deviceId, segId, inPort, host.mac(),
@@ -379,26 +375,18 @@ public class VTNManager implements VTNService {
Device device = event.subject();
if (Device.Type.CONTROLLER == device.type()
&& DeviceEvent.Type.DEVICE_ADDED == event.type()) {
- backgroundService.execute(() -> {
- onServerDetected(device);
- });
+ backgroundService.execute(() -> onServerDetected(device));
} else if (Device.Type.CONTROLLER == device.type()
&& DeviceEvent.Type.DEVICE_AVAILABILITY_CHANGED == event
.type()) {
- backgroundService.execute(() -> {
- onServerVanished(device);
- });
+ backgroundService.execute(() -> onServerVanished(device));
} else if (Device.Type.SWITCH == device.type()
&& DeviceEvent.Type.DEVICE_ADDED == event.type()) {
- backgroundService.execute(() -> {
- onOvsDetected(device);
- });
+ backgroundService.execute(() -> onOvsDetected(device));
} else if (Device.Type.SWITCH == device.type()
&& DeviceEvent.Type.DEVICE_AVAILABILITY_CHANGED == event
.type()) {
- backgroundService.execute(() -> {
- onOvsVanished(device);
- });
+ backgroundService.execute(() -> onOvsVanished(device));
} else {
log.info("Do nothing for this device type");
}
@@ -412,13 +400,9 @@ public class VTNManager implements VTNService {
public void event(HostEvent event) {
Host host = event.subject();
if (HostEvent.Type.HOST_ADDED == event.type()) {
- backgroundService.execute(() -> {
- onHostDetected(host);
- });
+ backgroundService.execute(() -> onHostDetected(host));
} else if (HostEvent.Type.HOST_REMOVED == event.type()) {
- backgroundService.execute(() -> {
- onHostVanished(host);
- });
+ backgroundService.execute(() -> onHostVanished(host));
} else if (HostEvent.Type.HOST_UPDATED == event.type()) {
backgroundService.execute(() -> {
onHostVanished(host);
@@ -626,7 +610,7 @@ public class VTNManager implements VTNService {
VirtualPort port = virtualPortService.getPort(portId);
TenantNetwork network = tenantNetworkService
.getNetwork(port.networkId());
- Collection<String> ifaceIds = new HashSet<String>();
+ Collection<String> ifaceIds = new HashSet<>();
Collection<VirtualPort> ports = virtualPortService
.getPorts(network.id());
Sets.newHashSet(ports).stream()