Java Code Examples for org.onosproject.net.flow.TrafficTreatment#tableTransition()
The following examples show how to use
org.onosproject.net.flow.TrafficTreatment#tableTransition() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FlowsListCommand.java From onos with Apache License 2.0 | 6 votes |
private String printTreatment(TrafficTreatment treatment) { final String delimiter = ", "; StringBuilder builder = new StringBuilder("["); if (!treatment.immediate().isEmpty()) { builder.append("immediate=" + treatment.immediate() + delimiter); } if (!treatment.deferred().isEmpty()) { builder.append("deferred=" + treatment.deferred() + delimiter); } if (treatment.clearedDeferred()) { builder.append("clearDeferred" + delimiter); } if (treatment.tableTransition() != null) { builder.append("transition=" + treatment.tableTransition() + delimiter); } if (treatment.metered() != null) { builder.append("meter=" + treatment.metered() + delimiter); } if (treatment.writeMetadata() != null) { builder.append("metadata=" + treatment.writeMetadata() + delimiter); } // Chop off last delimiter builder.replace(builder.length() - delimiter.length(), builder.length(), ""); builder.append("]"); return builder.toString(); }
Example 2
Source File: VirtualFlowsListCommand.java From onos with Apache License 2.0 | 6 votes |
private String printTreatment(TrafficTreatment treatment) { final String delimiter = ", "; StringBuilder builder = new StringBuilder("["); if (!treatment.immediate().isEmpty()) { builder.append("immediate=" + treatment.immediate() + delimiter); } if (!treatment.deferred().isEmpty()) { builder.append("deferred=" + treatment.deferred() + delimiter); } if (treatment.clearedDeferred()) { builder.append("clearDeferred" + delimiter); } if (treatment.tableTransition() != null) { builder.append("transition=" + treatment.tableTransition() + delimiter); } if (treatment.metered() != null) { builder.append("meter=" + treatment.metered() + delimiter); } if (treatment.writeMetadata() != null) { builder.append("metadata=" + treatment.writeMetadata() + delimiter); } // Chop off last delimiter builder.replace(builder.length() - delimiter.length(), builder.length(), ""); builder.append("]"); return builder.toString(); }
Example 3
Source File: T3CliUtils.java From onos with Apache License 2.0 | 6 votes |
private static String printTreatment(TrafficTreatment treatment) { final String delimiter = ", "; StringBuilder builder = new StringBuilder("["); if (!treatment.immediate().isEmpty()) { builder.append("immediate=" + treatment.immediate() + delimiter); } if (!treatment.deferred().isEmpty()) { builder.append("deferred=" + treatment.deferred() + delimiter); } if (treatment.clearedDeferred()) { builder.append("clearDeferred" + delimiter); } if (treatment.tableTransition() != null) { builder.append("transition=" + treatment.tableTransition() + delimiter); } if (treatment.metered() != null) { builder.append("meter=" + treatment.metered() + delimiter); } if (treatment.writeMetadata() != null) { builder.append("metadata=" + treatment.writeMetadata() + delimiter); } // Chop off last delimiter builder.replace(builder.length() - delimiter.length(), builder.length(), ""); builder.append("]"); return builder.toString(); }
Example 4
Source File: FlowViewMessageHandler.java From onos with Apache License 2.0 | 5 votes |
@Override public String format(Object value) { FlowEntry flow = (FlowEntry) value; TrafficTreatment treatment = flow.treatment(); List<Instruction> imm = treatment.immediate(); List<Instruction> def = treatment.deferred(); if (imm.isEmpty() && def.isEmpty() && treatment.metered() == null && treatment.tableTransition() == null && treatment.writeMetadata() == null) { return MSG_NO_TREATMENT; } StringBuilder sb = new StringBuilder(); if (!shortFormat) { sb.append(TREATMENT_INSTRUCTIONS).append(COLON).append(SPACE); } formatInstructs(sb, imm, IMM); formatInstructs(sb, def, DEF); treatment.meters().forEach(meterInstruction -> addLabVal(sb, METERED, meterInstruction) ); addLabVal(sb, TRANSITION, treatment.tableTransition()); addLabVal(sb, METADATA, treatment.writeMetadata()); sb.append(CLEARED).append(COLON) .append(treatment.clearedDeferred()); return sb.toString(); }
Example 5
Source File: FlowViewMessageHandler.java From onos with Apache License 2.0 | 5 votes |
private ObjectNode jsonTreatment(FlowEntry flow) { ObjectNode treat = objectNode(); TrafficTreatment treatment = flow.treatment(); List<Instruction> imm = Lists.newArrayList(treatment.immediate()); List<Instruction> def = treatment.deferred(); Set<Instructions.MeterInstruction> meter = treatment.meters(); Instructions.TableTypeTransition table = treatment.tableTransition(); Instructions.MetadataInstruction meta = treatment.writeMetadata(); if (!imm.isEmpty()) { treat.set(IMMED, jsonInstrList(imm)); } if (!def.isEmpty()) { treat.set(DEFER, jsonInstrList(def)); } if (!meter.isEmpty()) { treat.set(METER, jsonInstrList(Lists.newArrayList(meter))); } if (table != null) { treat.put(TABLE, table.toString()); } if (meta != null) { treat.put(META, meta.toString()); } treat.put(CLEARDEF, treatment.clearedDeferred()); return treat; }