use of org.onosproject.net.packet.PacketEvent in project onos by opennetworkinglab.
the class DistributedPacketStore method emit.
@Override
public void emit(OutboundPacket packet) {
NodeId myId = clusterService.getLocalNode().id();
NodeId master = mastershipService.getMasterFor(packet.sendThrough());
if (master == null) {
return;
}
if (myId.equals(master)) {
notifyDelegate(new PacketEvent(Type.EMIT, packet));
return;
}
communicationService.unicast(packet, PACKET_OUT_SUBJECT, SERIALIZER::encode, master).whenComplete((r, error) -> {
if (error != null) {
log.warn("Failed to send packet-out to {}", master, error);
}
});
}
Aggregations