private static InstructionsBuilder createGotoTableInstructions() { GoToTableBuilder aab = new GoToTableBuilder(); aab.setTableId((short) 2); InstructionBuilder ib = new InstructionBuilder(); ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build()); // Put our Instruction in a list of Instructions InstructionsBuilder isb = new InstructionsBuilder(); List<Instruction> instructions = new ArrayList<Instruction>(); instructions.add(ib.build()); isb.setInstruction(instructions); return isb; }
public static Instruction gotoTableIns(short tableId) { return new GoToTableCaseBuilder().setGoToTable(new GoToTableBuilder().setTableId(tableId).build()).build(); }
private static InstructionsBuilder createGotoTableInstructions() { GoToTableBuilder aab = new GoToTableBuilder(); aab.setTableId((short) 2); InstructionBuilder ib = new InstructionBuilder(); ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build()); // Put our Instruction in a list of Instructions InstructionsBuilder isb = new InstructionsBuilder(); List<Instruction> instructions = new ArrayList<Instruction>(); instructions.add(ib.build()); isb.setInstruction(instructions); return isb; }
/** * Create GOTO Table Instruction Builder * * @param ib Map InstructionBuilder without any instructions * @param tableId short representing a flow table ID short representing a flow table ID * @return ib Map InstructionBuilder with instructions */ public static InstructionBuilder createGotoTableInstructions(InstructionBuilder ib, short tableId) { GoToTableBuilder gttb = new GoToTableBuilder(); gttb.setTableId(tableId); // Wrap our Apply Action in an InstructionBuilder ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(gttb.build()).build()); return ib; }
private static InstructionsBuilder createGotoTableInstructions() { final GoToTableBuilder aab = new GoToTableBuilder(); aab.setTableId((short) 5); final InstructionBuilder ib = new InstructionBuilder(); ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build()); // Put our Instruction in a list of Instructions final InstructionsBuilder isb = new InstructionsBuilder(); final List<Instruction> instructions = new ArrayList<Instruction>(); ib.setKey(new InstructionKey(0)); instructions.add(ib.build()); isb.setInstruction(instructions); return isb; }
/** * Create GOTO Table Instruction Builder * * @param ib Map InstructionBuilder without any instructions * @param tableId short representing a flow table ID short representing a flow table ID * @return ib Map InstructionBuilder with instructions */ public static InstructionBuilder createGotoTableInstructions(InstructionBuilder ib, short tableId) { GoToTableBuilder gttb = new GoToTableBuilder(); gttb.setTableId(tableId); // Wrap our Apply Action in an InstructionBuilder ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(gttb.build()).build()); return ib; }
.setOrder(1) .setInstruction(new GoToTableCaseBuilder() .setGoToTable(gotoInst.build()).build()) .build();
GoToTableBuilder goToTableBuilder = new GoToTableBuilder(); goToTableBuilder.setTableId(gotoTableCase.getGotoTable().getTableId()); goToTableCaseBuilder.setGoToTable(goToTableBuilder.build());
.setGoToTable(new GoToTableBuilder().build()) .build())); } else if (currInstructionType instanceof WriteMetadataCase) {
private void addFlowGoto(Node node, Short currentId, Short nextId) { FlowBuilder flowBuilder = new FlowBuilder(); flowBuilder.setTableId(currentId); flowBuilder.setHardTimeout(0); flowBuilder.setPriority(0); flowBuilder.setMatch(new MatchBuilder().build()); flowBuilder.setInstructions( new InstructionsBuilder().setInstruction(Collections.singletonList( new InstructionBuilder().setInstruction( new GoToTableCaseBuilder().setGoToTable( new GoToTableBuilder().setTableId(nextId).build() ).build() ).setOrder(0).build() )).build()); String flowIdStr = "PipelineManager"; final FlowId flowId = new FlowId(flowIdStr); final FlowKey key = new FlowKey(flowId); flowBuilder.setKey(key); InstanceIdentifier<Flow> flowIID = InstanceIdentifier.builder(Nodes.class) .child(Node.class, new NodeKey(node.getId())).augmentation(FlowCapableNode.class) .child(Table.class, new TableKey(flowBuilder.getTableId())).child(Flow.class, flowBuilder.getKey()) .build(); WriteTransaction transaction = dataBroker.newWriteOnlyTransaction(); transaction.put(LogicalDatastoreType.CONFIGURATION, flowIID, flowBuilder.build(), true); transaction.submit(); }