public static Instruction gotoTableIns(short tableId) { return new GoToTableCaseBuilder().setGoToTable(new GoToTableBuilder().setTableId(tableId).build()).build(); }
public GoToTableBuilder setTableId(java.lang.Short value) { if (value != null) { BigInteger _constraint = BigInteger.valueOf(value); boolean isValidRange = false; for (Range<BigInteger> r : _tableId_range()) { if (r.contains(_constraint)) { isValidRange = true; } } if (!isValidRange) { throw new IllegalArgumentException(String.format("Invalid range: %s, expected: %s.", value, _tableId_range)); } } this._tableId = value; return this; } public static List<Range<BigInteger>> _tableId_range() {
private GoToTableImpl(GoToTableBuilder base) { this._tableId = base.getTableId(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTable>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTable>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTable>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTable>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public static GoToTableBuilder createActionGotoTable(final short toTable) { GoToTableBuilder gotoTb = new GoToTableBuilder(); gotoTb.setTableId(toTable); return gotoTb; }
.setGoToTable(new GoToTableBuilder().build()) .build())); } else if (currInstructionType instanceof WriteMetadataCase) {
/** * 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; }
/** * 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() { 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; }
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; }
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; }
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(); }
GoToTableBuilder gotoInst = new GoToTableBuilder().setTableId(FIB_TABLE); .setOrder(1) .setInstruction(new GoToTableCaseBuilder() .setGoToTable(gotoInst.build()).build()) .build();
GoToTableBuilder goToTableBuilder = new GoToTableBuilder(); goToTableBuilder.setTableId(gotoTableCase.getGotoTable().getTableId()); goToTableCaseBuilder.setGoToTable(goToTableBuilder.build());