mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-22 12:51:09 +02:00
Removed unnecessary mapper declaration -- use the one exposed in the superclass.
Change-Id: I90154dddb6dd69a064097a93a9c3cabec251c599
This commit is contained in:
parent
dde53d116b
commit
c00295cb91
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.onosproject.ui.impl;
|
package org.onosproject.ui.impl;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
@ -60,8 +59,6 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
|
|||||||
private static final String SPEED = "speed";
|
private static final String SPEED = "speed";
|
||||||
private static final String NAME = "name";
|
private static final String NAME = "name";
|
||||||
|
|
||||||
private static final ObjectMapper MAPPER = new ObjectMapper();
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new message handler for the device messages.
|
* Creates a new message handler for the device messages.
|
||||||
@ -107,7 +104,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
|
|||||||
DeviceService service = get(DeviceService.class);
|
DeviceService service = get(DeviceService.class);
|
||||||
MastershipService ms = get(MastershipService.class);
|
MastershipService ms = get(MastershipService.class);
|
||||||
Device device = service.getDevice(deviceId);
|
Device device = service.getDevice(deviceId);
|
||||||
ObjectNode data = MAPPER.createObjectNode();
|
ObjectNode data = mapper.createObjectNode();
|
||||||
|
|
||||||
data.put(ID, deviceId.toString());
|
data.put(ID, deviceId.toString());
|
||||||
data.put(TYPE, device.type().toString());
|
data.put(TYPE, device.type().toString());
|
||||||
@ -120,7 +117,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
|
|||||||
data.put(MASTER_ID, ms.getMasterFor(deviceId).toString());
|
data.put(MASTER_ID, ms.getMasterFor(deviceId).toString());
|
||||||
data.put(PROTOCOL, device.annotations().value(PROTOCOL));
|
data.put(PROTOCOL, device.annotations().value(PROTOCOL));
|
||||||
|
|
||||||
ArrayNode ports = MAPPER.createArrayNode();
|
ArrayNode ports = mapper.createArrayNode();
|
||||||
|
|
||||||
List<Port> portList = new ArrayList<>(service.getPorts(deviceId));
|
List<Port> portList = new ArrayList<>(service.getPorts(deviceId));
|
||||||
Collections.sort(portList, (p1, p2) -> {
|
Collections.sort(portList, (p1, p2) -> {
|
||||||
@ -150,7 +147,7 @@ public class DeviceViewMessageHandler extends AbstractTabularViewMessageHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ObjectNode portData(Port p, DeviceId id) {
|
private ObjectNode portData(Port p, DeviceId id) {
|
||||||
ObjectNode port = MAPPER.createObjectNode();
|
ObjectNode port = mapper.createObjectNode();
|
||||||
LinkService ls = get(LinkService.class);
|
LinkService ls = get(LinkService.class);
|
||||||
String name = p.annotations().value(AnnotationKeys.PORT_NAME);
|
String name = p.annotations().value(AnnotationKeys.PORT_NAME);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user