@Test public void testConfigArpPEntry() throws Exception { WriteTransaction writeTransaction = mock(WriteTransaction.class); when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); physicalFlowUtils.configArpPEntry("test"); verify(dataBroker).newWriteOnlyTransaction(); Assert.assertNotNull(physicalFlowUtils); }
public void configArpPEntry(String strNodeId) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); EthernetType ethernetTypeLLDP = new EthernetTypeBuilder().setType(new EtherType((long) ETH_TYPE_ARP)).build(); EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder().setEthernetType(ethernetTypeLLDP); EthernetMatch ethernetMatch = ethernetMatchBuilder.build(); Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build(); List<Instruction> instructionList = new LinkedList<Instruction>(); List<Action> actionList = new LinkedList<Action>(); Uri uri = controllerConnectorId(); OutputAction outputAction = new OutputActionBuilder().setOutputNodeConnector(uri).build(); OutputActionCase outputActionCase = new OutputActionCaseBuilder().setOutputAction(outputAction).build(); Action actionOutput = new ActionBuilder().setOrder(actionList.size()).setAction(outputActionCase).build(); actionList.add(actionOutput); ApplyActions applyActions = new ApplyActionsBuilder().setAction(actionList).build(); ApplyActionsCase applyActionsCase = new ApplyActionsCaseBuilder().setApplyActions(applyActions).build(); Instruction instructionApply = new InstructionBuilder().setOrder(instructionList.size()).setInstruction(applyActionsCase).build(); instructionList.add(instructionApply); Instructions instructions = new InstructionsBuilder().setInstruction(instructionList).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(CONFIG_TABLE_ID).setPriority(CONFIG_FLOW_PRIORITY); Flow flow = flowBuilder.setMatch(match).setInstructions(instructions).build(); NodeId nodeId = new NodeId(strNodeId); InstanceIdentifier<Flow> flowInsId = createFlowPath(nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; }
PhysicalFlowUtils { public void configArpPEntry(String strNodeId) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); EthernetType ethernetTypeLLDP = new EthernetTypeBuilder().setType(new EtherType((long) ETH_TYPE_ARP)).build(); EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder().setEthernetType(ethernetTypeLLDP); EthernetMatch ethernetMatch = ethernetMatchBuilder.build(); Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build(); List<Instruction> instructionList = new LinkedList<Instruction>(); List<Action> actionList = new LinkedList<Action>(); Uri uri = controllerConnectorId(); OutputAction outputAction = new OutputActionBuilder().setOutputNodeConnector(uri).build(); OutputActionCase outputActionCase = new OutputActionCaseBuilder().setOutputAction(outputAction).build(); Action actionOutput = new ActionBuilder().setOrder(actionList.size()).setAction(outputActionCase).build(); actionList.add(actionOutput); ApplyActions applyActions = new ApplyActionsBuilder().setAction(actionList).build(); ApplyActionsCase applyActionsCase = new ApplyActionsCaseBuilder().setApplyActions(applyActions).build(); Instruction instructionApply = new InstructionBuilder().setOrder(instructionList.size()).setInstruction(applyActionsCase).build(); instructionList.add(instructionApply); Instructions instructions = new InstructionsBuilder().setInstruction(instructionList).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(CONFIG_TABLE_ID).setPriority(CONFIG_FLOW_PRIORITY); Flow flow = flowBuilder.setMatch(match).setInstructions(instructions).build(); NodeId nodeId = new NodeId(strNodeId); InstanceIdentifier<Flow> flowInsId = createFlowPath(nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } }
PhysicalFlowUtils { public void configArpPEntry(String strNodeId) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); EthernetType ethernetTypeLLDP = new EthernetTypeBuilder().setType(new EtherType((long) ETH_TYPE_ARP)).build(); EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder().setEthernetType(ethernetTypeLLDP); EthernetMatch ethernetMatch = ethernetMatchBuilder.build(); Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build(); List<Instruction> instructionList = new LinkedList<Instruction>(); List<Action> actionList = new LinkedList<Action>(); Uri uri = controllerConnectorId(); OutputAction outputAction = new OutputActionBuilder().setOutputNodeConnector(uri).build(); OutputActionCase outputActionCase = new OutputActionCaseBuilder().setOutputAction(outputAction).build(); Action actionOutput = new ActionBuilder().setOrder(actionList.size()).setAction(outputActionCase).build(); actionList.add(actionOutput); ApplyActions applyActions = new ApplyActionsBuilder().setAction(actionList).build(); ApplyActionsCase applyActionsCase = new ApplyActionsCaseBuilder().setApplyActions(applyActions).build(); Instruction instructionApply = new InstructionBuilder().setOrder(instructionList.size()).setInstruction(applyActionsCase).build(); instructionList.add(instructionApply); Instructions instructions = new InstructionsBuilder().setInstruction(instructionList).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(CONFIG_TABLE_ID).setPriority(CONFIG_FLOW_PRIORITY); Flow flow = flowBuilder.setMatch(match).setInstructions(instructions).build(); NodeId nodeId = new NodeId(strNodeId); InstanceIdentifier<Flow> flowInsId = createFlowPath(nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } PhysicalFlowUtils(DataBroker dataBroker); }
PhysicalFlowUtils { public void configArpPEntry(String strNodeId) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); EthernetType ethernetTypeLLDP = new EthernetTypeBuilder().setType(new EtherType((long) ETH_TYPE_ARP)).build(); EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder().setEthernetType(ethernetTypeLLDP); EthernetMatch ethernetMatch = ethernetMatchBuilder.build(); Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build(); List<Instruction> instructionList = new LinkedList<Instruction>(); List<Action> actionList = new LinkedList<Action>(); Uri uri = controllerConnectorId(); OutputAction outputAction = new OutputActionBuilder().setOutputNodeConnector(uri).build(); OutputActionCase outputActionCase = new OutputActionCaseBuilder().setOutputAction(outputAction).build(); Action actionOutput = new ActionBuilder().setOrder(actionList.size()).setAction(outputActionCase).build(); actionList.add(actionOutput); ApplyActions applyActions = new ApplyActionsBuilder().setAction(actionList).build(); ApplyActionsCase applyActionsCase = new ApplyActionsCaseBuilder().setApplyActions(applyActions).build(); Instruction instructionApply = new InstructionBuilder().setOrder(instructionList.size()).setInstruction(applyActionsCase).build(); instructionList.add(instructionApply); Instructions instructions = new InstructionsBuilder().setInstruction(instructionList).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(CONFIG_TABLE_ID).setPriority(CONFIG_FLOW_PRIORITY); Flow flow = flowBuilder.setMatch(match).setInstructions(instructions).build(); NodeId nodeId = new NodeId(strNodeId); InstanceIdentifier<Flow> flowInsId = createFlowPath(nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } PhysicalFlowUtils(DataBroker dataBroker); void configLLDPEntry(String strNodeId); void configArpPEntry(String strNodeId); }
PhysicalFlowUtils { public void configArpPEntry(String strNodeId) { WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); EthernetType ethernetTypeLLDP = new EthernetTypeBuilder().setType(new EtherType((long) ETH_TYPE_ARP)).build(); EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder().setEthernetType(ethernetTypeLLDP); EthernetMatch ethernetMatch = ethernetMatchBuilder.build(); Match match = new MatchBuilder().setEthernetMatch(ethernetMatch).build(); List<Instruction> instructionList = new LinkedList<Instruction>(); List<Action> actionList = new LinkedList<Action>(); Uri uri = controllerConnectorId(); OutputAction outputAction = new OutputActionBuilder().setOutputNodeConnector(uri).build(); OutputActionCase outputActionCase = new OutputActionCaseBuilder().setOutputAction(outputAction).build(); Action actionOutput = new ActionBuilder().setOrder(actionList.size()).setAction(outputActionCase).build(); actionList.add(actionOutput); ApplyActions applyActions = new ApplyActionsBuilder().setAction(actionList).build(); ApplyActionsCase applyActionsCase = new ApplyActionsCaseBuilder().setApplyActions(applyActions).build(); Instruction instructionApply = new InstructionBuilder().setOrder(instructionList.size()).setInstruction(applyActionsCase).build(); instructionList.add(instructionApply); Instructions instructions = new InstructionsBuilder().setInstruction(instructionList).build(); FlowId flowId = new FlowId(UUID.randomUUID().toString()); FlowBuilder flowBuilder = baseFlowBuilder().setId(flowId).setTableId(CONFIG_TABLE_ID).setPriority(CONFIG_FLOW_PRIORITY); Flow flow = flowBuilder.setMatch(match).setInstructions(instructions).build(); NodeId nodeId = new NodeId(strNodeId); InstanceIdentifier<Flow> flowInsId = createFlowPath(nodeId, flow.getTableId(), flow.getId()); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowInsId, flow, true); writeTransaction.submit(); return; } PhysicalFlowUtils(DataBroker dataBroker); void configLLDPEntry(String strNodeId); void configArpPEntry(String strNodeId);  }