@Override public int hashCode() { return Objects.hash(type, deviceId.toString(), load, rate, count, timestamp); }
/** * Instantiates a new Alarm id. * * @param id the device id * @param uniqueIdentifier the unique identifier of the Alarm on that device */ private AlarmId(DeviceId id, String uniqueIdentifier) { super(id.toString() + ":" + uniqueIdentifier); checkNotNull(id, "device id must not be null"); checkNotNull(uniqueIdentifier, "unique identifier must not be null"); checkArgument(!uniqueIdentifier.isEmpty(), "unique identifier must not be empty"); }
@Override public String toString() { return toStringHelper(this) .add("type", type) .add("deviceId", deviceId.toString()) .add("load", load) .add("rate", rate) .add("count", count) .add("timestamp", timestamp) .toString(); } }
@Override public String toString() { return toStringHelper(this) .add("type", type) .add("deviceId", deviceId.toString()) .add("load", load) .add("rate", rate) .add("count", count) .add("timestamp", timestamp) .toString(); } }
@Override public boolean removeGlobalNodeLabel(DeviceId id) { checkNotNull(id, DEVICE_ID_NULL); if (globalNodeLabelMap.remove(id) == null) { log.error("SR-TE node label deletion for device {} has failed.", id.toString()); return false; } return true; }
@Override public boolean removeGlobalNodeLabel(DeviceId id) { checkNotNull(id, DEVICE_ID_NULL); if (globalNodeLabelMap.remove(id) == null) { log.error("SR-TE node label deletion for device {} has failed.", id.toString()); return false; } return true; }
private ObjectNode json(ObjectMapper mapper, Device device, List<FlowEntry> flows) { ObjectNode result = mapper.createObjectNode(); ArrayNode array = mapper.createArrayNode(); flows.forEach(flow -> array.add(jsonForEntity(flow, FlowEntry.class))); result.put("device", device.id().toString()) .put("flowCount", flows.size()) .set("flows", array); return result; }
private ObjectNode json(ObjectMapper mapper, Device device, List<TableStatisticsEntry> tableStats) { ObjectNode result = mapper.createObjectNode(); ArrayNode array = mapper.createArrayNode(); tableStats.forEach(tableStat -> array.add(jsonForEntity(tableStat, TableStatisticsEntry.class))); result.put("device", device.id().toString()) .put("tableCount", tableStats.size()) .set("tables", array); return result; }
@Override public String toString() { return MoreObjects.toStringHelper(getClass()) .omitNullValues() .add("DeviceId", deviceId.toString()) .add("InLabelId", inLabelId.toString()) .add("OutLabelId", outLabelId.toString()) .add("InPort", inPort.toString()) .add("OutPort", outPort.toString()) .toString(); }
private OvsdbNodeId changeDeviceIdToNodeId(DeviceId deviceId) { String[] strings = deviceId.toString().split(":"); if (strings.length < 1) { return null; } return new OvsdbNodeId(IpAddress.valueOf(strings[1]), 0); }
@Override public ObjectNode encode(TableStatisticsEntry entry, CodecContext context) { checkNotNull(entry, "Table Statistics entry cannot be null"); final ObjectNode result = context.mapper().createObjectNode() .put("tableId", entry.table().toString()) .put("deviceId", entry.deviceId().toString()) .put("activeEntries", entry.activeFlowEntries()) .put("packetsLookedUp", entry.packetsLookedup()) .put("packetsMatched", entry.packetsMatched()); return result; }
private static boolean matchesDpid(Bridge b, DeviceId deviceId) { String ofDpid = deviceId.toString().replace("of:", ""); Set ofDeviceIds = ((OvsdbSet) b.getDatapathIdColumn().data()).set(); //TODO Set<String> return ofDeviceIds.contains(ofDpid); }
private static boolean matchesDpid(Bridge b, DeviceId deviceId) { String ofDpid = deviceId.toString().replace("of:", ""); Set ofDeviceIds = ((OvsdbSet) b.getDatapathIdColumn().data()).set(); //TODO Set<String> return ofDeviceIds.contains(ofDpid); }
private void executeProbe(DeviceId did) { boolean reachable = isReachable(did); log.debug("Probed device: id={}, reachable={}", did.toString(), reachable); if (reachable) { discoverDevice(did); } else { disconnectDevice(did); } }
@Override public ObjectNode encode(ConnectPoint point, CodecContext context) { checkNotNull(point, "Connect point cannot be null"); ObjectNode root = context.mapper().createObjectNode() .put(PORT, point.port().toString()); if (point.elementId() instanceof DeviceId) { root.put(ELEMENT_DEVICE, point.deviceId().toString()); } else if (point.elementId() instanceof HostId) { root.put(ELEMENT_HOST, point.hostId().toString()); } return root; }
@Override public void modifyDeviceDetails(PropertyPanel pp, DeviceId deviceId) { pp.title(MY_DEVICE_TITLE); pp.removeAllProps(); pp.addProp("SFF Device Id", deviceId.toString()); }
private void addDeviceBadge(Highlights h, DeviceId devId, int n) { DeviceHighlight dh = new DeviceHighlight(devId.toString()); dh.setBadge(createBadge(n)); h.add(dh); }