ODTN: Including proper Describtion and device type, removing unecessary extends call, lowering log levels
Change-Id: I59412ac1370cc9d01127c661f873ab1d30d298a5
diff --git a/apps/odtn/service/src/main/java/org/onosproject/odtn/impl/ServiceApplicationComponent.java b/apps/odtn/service/src/main/java/org/onosproject/odtn/impl/ServiceApplicationComponent.java
index e296f1b..9e4bed3 100644
--- a/apps/odtn/service/src/main/java/org/onosproject/odtn/impl/ServiceApplicationComponent.java
+++ b/apps/odtn/service/src/main/java/org/onosproject/odtn/impl/ServiceApplicationComponent.java
@@ -161,8 +161,7 @@
@Override
public void event(DeviceEvent event) {
- log.info("Device event type: {}", event.type());
- log.info("Device event subject: {}", event.subject());
+ log.debug("Device event type: {}, subject: {}", event.type(), event.subject());
switch (event.type()) {
case DEVICE_ADDED:
tapiTopologyManager.addDevice(event.subject());
@@ -248,8 +247,7 @@
@Override
public void event(NetworkConfigEvent event) {
- log.info("type: {}", event.type());
- log.info("subject: {}", event.subject());
+ log.debug("Event type: {}, subject: {}", event.type(), event.subject());
DeviceId did = ((ConnectPoint) event.subject()).deviceId();
DefaultOdtnTerminalDeviceDriver driver = DefaultOdtnTerminalDeviceDriver.create();
@@ -259,12 +257,12 @@
case CONFIG_ADDED:
case CONFIG_UPDATED:
config = (TerminalDeviceConfig) event.config().get();
- log.info("config: {}", config);
+ log.debug("config: {}", config);
driver.apply(did, config.clientCp().port(), config.subject().port(), config.isEnabled());
break;
case CONFIG_REMOVED:
config = (TerminalDeviceConfig) event.prevConfig().get();
- log.info("config: {}", config);
+ log.debug("config: {}", config);
driver.apply(did, config.clientCp().port(), config.subject().port(), false);
break;
default:
diff --git a/apps/odtn/service/src/main/java/org/onosproject/odtn/internal/DcsBasedTapiTopologyManager.java b/apps/odtn/service/src/main/java/org/onosproject/odtn/internal/DcsBasedTapiTopologyManager.java
index c5fd719..f8cb640 100644
--- a/apps/odtn/service/src/main/java/org/onosproject/odtn/internal/DcsBasedTapiTopologyManager.java
+++ b/apps/odtn/service/src/main/java/org/onosproject/odtn/internal/DcsBasedTapiTopologyManager.java
@@ -83,7 +83,7 @@
@Override
public void addDevice(Device device) {
- log.info("Add device: {}", device);
+ log.debug("Add device: {}", device);
DeviceId deviceId = device.id();
if (tapiResolver.hasNodeRef(deviceId)) {
return;
@@ -95,12 +95,13 @@
@Override
public void removeDevice(Device device) {
- log.info("Remove device: {}", device);
+ //TODO Implement
+ log.warn("NOT-IMPLEMENTED, Remove device: {}", device);
}
@Override
public void addLink(Link link) {
- log.info("Add link: {}", link);
+ log.debug("Add link: {}", link);
// TODO: existence check
@@ -116,12 +117,13 @@
@Override
public void removeLink(Link link) {
- log.info("Remove link: {}", link);
+ //TODO Implement
+ log.warn("NOT-IMPLEMENTED, Remove link: {}", link);
}
@Override
public void addPort(Port port) {
- log.info("Add port: {}", port);
+ log.debug("Add port: {}", port);
ConnectPoint cp = new ConnectPoint(port.element().id(), port.number());
if (tapiResolver.hasNepRef(cp)) {
@@ -157,7 +159,8 @@
@Override
public void removePort(Port port) {
- log.info("Remove port: {}", port);
+ //TODO implement
+ log.warn("NOT-IMPLEMENTED, Remove port: {}", port);
}
/**
diff --git a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/InfineraOpenConfigDeviceDiscovery.java b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/InfineraOpenConfigDeviceDiscovery.java
index 4ebe973..55eb6c7 100644
--- a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/InfineraOpenConfigDeviceDiscovery.java
+++ b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/InfineraOpenConfigDeviceDiscovery.java
@@ -31,14 +31,16 @@
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.configuration.XMLConfiguration;
import org.apache.commons.configuration.tree.xpath.XPathExpressionEngine;
+import org.onlab.packet.ChassisId;
import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Port.Type;
import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.DefaultDeviceDescription;
import org.onosproject.net.device.DefaultPortDescription;
import org.onosproject.net.device.DefaultPortDescription.Builder;
import org.onosproject.net.device.DeviceDescription;
-import org.onosproject.net.device.DeviceDescriptionDiscovery;
import org.onosproject.net.device.PortDescription;
import org.onosproject.net.driver.AbstractHandlerBehaviour;
import org.onosproject.netconf.NetconfController;
@@ -55,15 +57,15 @@
*/
public class InfineraOpenConfigDeviceDiscovery
extends AbstractHandlerBehaviour
- implements OdtnDeviceDescriptionDiscovery, DeviceDescriptionDiscovery {
+ implements OdtnDeviceDescriptionDiscovery {
private static final Logger log = getLogger(InfineraOpenConfigDeviceDiscovery.class);
@Override
public DeviceDescription discoverDeviceDetails() {
- // TODO Auto-generated method stub
- // Not really used right now
- return null;
+ return new DefaultDeviceDescription(handler().data().deviceId().uri(),
+ Device.Type.OTN, "Infinera", "XT-3300",
+ "unknown", "unknown", new ChassisId());
}
@Override
diff --git a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java
index 1d5563a..fa5b14e 100644
--- a/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java
+++ b/drivers/odtn-driver/src/main/java/org/onosproject/drivers/odtn/OpenConfigDeviceDiscovery.java
@@ -30,14 +30,16 @@
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.configuration.XMLConfiguration;
import org.apache.commons.configuration.tree.xpath.XPathExpressionEngine;
+import org.onlab.packet.ChassisId;
import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Port.Type;
import org.onosproject.net.PortNumber;
+import org.onosproject.net.device.DefaultDeviceDescription;
import org.onosproject.net.device.DefaultPortDescription;
import org.onosproject.net.device.DefaultPortDescription.Builder;
import org.onosproject.net.device.DeviceDescription;
-import org.onosproject.net.device.DeviceDescriptionDiscovery;
import org.onosproject.net.device.PortDescription;
import org.onosproject.net.driver.AbstractHandlerBehaviour;
import org.onosproject.netconf.NetconfController;
@@ -55,15 +57,15 @@
*/
public class OpenConfigDeviceDiscovery
extends AbstractHandlerBehaviour
- implements OdtnDeviceDescriptionDiscovery, DeviceDescriptionDiscovery {
+ implements OdtnDeviceDescriptionDiscovery {
private static final Logger log = getLogger(OpenConfigDeviceDiscovery.class);
@Override
public DeviceDescription discoverDeviceDetails() {
- // TODO Auto-generated method stub
- // Not really used right now
- return null;
+ return new DefaultDeviceDescription(handler().data().deviceId().uri(),
+ Device.Type.OTN, "unknown", "unknown",
+ "unknown", "unknown", new ChassisId());
}
@Override