use of org.onosproject.net.flow.TableStatisticsEntry in project onos by opennetworkinglab.
the class ServerHandshaker method probeReachability.
@Override
public CompletableFuture<Boolean> probeReachability() {
// Retrieve the device ID from the handler
DeviceId deviceId = super.getDeviceId();
checkNotNull(deviceId, MSG_DEVICE_ID_NULL);
// Probe the driver to ask for flow rule service
FlowRuleService flowService = getHandler().get(FlowRuleService.class);
List<TableStatisticsEntry> tableStats = Lists.newArrayList(flowService.getFlowTableStatistics(deviceId));
// If no statistics fetched, the server is not reachable
return completedFuture(tableStats.isEmpty() ? false : true);
}
use of org.onosproject.net.flow.TableStatisticsEntry in project onos by opennetworkinglab.
the class OFSwitchManager method getFlowTableStatistics.
@Override
public List<TableStatisticsEntry> getFlowTableStatistics(NetworkId networkId, DeviceId deviceId) {
FlowRuleService flowRuleService = virtualNetService.get(networkId, FlowRuleService.class);
Iterable<TableStatisticsEntry> entries = flowRuleService.getFlowTableStatistics(deviceId);
if (entries == null) {
entries = new ArrayList<>();
}
return Lists.newArrayList(entries);
}
Aggregations