Set protocol field for server devices
The protocol field of server devices was empty
in the DeviceView UI. This commit fixes the issue
by passing the protocol as a device annotation.
Change-Id: I56c6b37b0952a6f025c9fb12130e1eb25dd4f304
Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
index 3ff7f05..ac6c28d 100644
--- a/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
@@ -66,7 +66,6 @@
import com.google.common.collect.Lists;
import com.google.common.collect.ImmutableList;
-import javax.ws.rs.ProcessingException;
import java.io.InputStream;
import java.io.IOException;
import java.net.URI;
@@ -80,6 +79,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
+import javax.ws.rs.ProcessingException;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -294,6 +294,9 @@
DefaultAnnotations.Builder annotations = DefaultAnnotations.builder();
+ // Pass the southbound protocol as an annotation
+ annotations.set(AnnotationKeys.PROTOCOL, "REST");
+
// Construct NIC objects
for (JsonNode nn : nicNode) {
ObjectNode nicObjNode = (ObjectNode) nn;
@@ -848,7 +851,7 @@
DefaultPortStatistics.Builder nicBuilder = DefaultPortStatistics.builder();
nicBuilder.setDeviceId(deviceId)
- .setPort((int) portNumber)
+ .setPort(PortNumber.portNumber(portNumber))
.setPacketsReceived(rxCount)
.setPacketsSent(txCount)
.setBytesReceived(rxBytes)