ArpFlowManager extends AbstractFlowManager implements TopologyListener { protected FlowBuilder createArpReplyToControllerFlow() { final FlowBuilder arpFlow = new FlowBuilder() .setPriority(OFRendererConstants.ARP_REPLY_TO_CONTROLLER_FLOW_PRIORITY) .setIdleTimeout(0) .setHardTimeout(0) .setCookie(new FlowCookie(BigInteger.valueOf(flowCookie.incrementAndGet()))) .setFlags(new FlowModFlags(false, false, false, false, false)); final EthernetMatch ethernetMatch = FlowUtils.createEthernetMatch(); final Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build(); arpFlow.setMatch(match); final Instructions instructions = createOutputInstructions(OutputPortValues.CONTROLLER, OutputPortValues.NORMAL); arpFlow.setInstructions(instructions); final String flowName = createFlowName(); arpFlow.setFlowName(flowName); final FlowId flowId = new FlowId(flowName); arpFlow.setId(flowId); arpFlow.setKey(new FlowKey(flowId)); return arpFlow; } ArpFlowManager(final DataBroker dataBroker,
                          final PipelineManager pipelineManager,
                          final NetworkEventsService networkEventsService); void start(); @Override void pushFlow(final NodeId nodeId, final FlowAction flowAction); @Override void onSwitchAdd(NodeId switchAdded); @Override void onSwitchRemoved(NodeId switchRemoved);  }
@Test public void testCreateArpReplyControllerFlow() { flowBuilder = arpFlowManager.createArpReplyToControllerFlow(); Assert.assertEquals(flowBuilder.getPriority().intValue(), OFRendererConstants.ARP_REPLY_TO_CONTROLLER_FLOW_PRIORITY); Assert.assertEquals(flowBuilder.getIdleTimeout().intValue(), 0); Assert.assertEquals(flowBuilder.getHardTimeout().intValue(), 0); Assert.assertNotNull(flowBuilder.getCookie()); Assert.assertNotNull(flowBuilder.getFlags()); final Match match = flowBuilder.getMatch(); final EthernetMatch ethernetMatch = FlowUtils.createEthernetMatch(); Assert.assertEquals(match.getEthernetMatch(), ethernetMatch); }