use of org.onosproject.incubator.net.virtual.store.impl.primitives.VirtualFlowRule in project onos by opennetworkinglab.
the class DistributedVirtualFlowRuleStore method getFlowEntry.
@Override
public FlowEntry getFlowEntry(NetworkId networkId, FlowRule rule) {
MastershipService mastershipService = vnaService.get(networkId, MastershipService.class);
NodeId master = mastershipService.getMasterFor(rule.deviceId());
if (master == null) {
log.debug("Failed to getFlowEntry: No master for {}, vnet {}", rule.deviceId(), networkId);
return null;
}
if (Objects.equals(local, master)) {
return flowTable.getFlowEntry(networkId, rule);
}
log.trace("Forwarding getFlowEntry to {}, which is the primary (master) " + "for device {}, vnet {}", master, rule.deviceId(), networkId);
VirtualFlowRule vRule = new VirtualFlowRule(networkId, rule);
return Tools.futureGetOrElse(clusterCommunicator.sendAndReceive(vRule, GET_FLOW_ENTRY, serializer::encode, serializer::decode, master), FLOW_RULE_STORE_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS, null);
}
Aggregations