private static final Logger logger = LoggerFactory.getLogger(TableFeaturesReplyConvertor.class);
public static List<TableFeatures> toTableFeaturesReply(
- MultipartReplyTableFeatures ofTableFeaturesList) {
+ final MultipartReplyTableFeatures ofTableFeaturesList) {
if (ofTableFeaturesList == null || ofTableFeaturesList.getTableFeatures() == null) {
return Collections.<TableFeatures> emptyList();
}
return salTableFeaturesList;
}
- private static TableProperties toTableProperties(List<TableFeatureProperties> ofTablePropertiesList) {
+ private static TableProperties toTableProperties(final List<TableFeatureProperties> ofTablePropertiesList) {
if (ofTablePropertiesList == null) {
return new TablePropertiesBuilder()
.setTableFeatureProperties(
case OFPTFPTWRITESETFIELD:
WriteSetfieldBuilder writeSetfieldBuilder = new WriteSetfieldBuilder();
writeSetfieldBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
+ propBuilder.setTableFeaturePropType(new
org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldBuilder().setWriteSetfield(writeSetfieldBuilder.build()).build());
break;
case OFPTFPTWRITESETFIELDMISS:
WriteSetfieldMissBuilder writeSetfieldMissBuilder = new WriteSetfieldMissBuilder();
writeSetfieldMissBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
+ propBuilder.setTableFeaturePropType(new
org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMissBuilder().setWriteSetfieldMiss(writeSetfieldMissBuilder.build()).build());
break;
case OFPTFPTAPPLYSETFIELD:
ApplySetfieldBuilder applySetfieldBuilder = new ApplySetfieldBuilder();
applySetfieldBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
+ propBuilder.setTableFeaturePropType(new
org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldBuilder().setApplySetfield(applySetfieldBuilder.build()).build());
break;
case OFPTFPTAPPLYSETFIELDMISS:
ApplySetfieldMissBuilder applySetfieldMissBuilder = new ApplySetfieldMissBuilder();
applySetfieldMissBuilder.setSetFieldMatch(setSetFieldTableFeatureProperty(property, false));
- propBuilder.setTableFeaturePropType(new
+ propBuilder.setTableFeaturePropType(new
org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMissBuilder().setApplySetfieldMiss(applySetfieldMissBuilder.build()).build());
break;
case OFPTFPTEXPERIMENTER:
return new TablePropertiesBuilder().setTableFeatureProperties(salTablePropertiesList).build();
}
- private static List<Instruction> setInstructionTableFeatureProperty(TableFeatureProperties properties) {
+ private static List<Instruction> setInstructionTableFeatureProperty(final TableFeatureProperties properties) {
List<Instruction> instructionList = new ArrayList<>();
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder builder = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731
return instructionList;
}
- private static List<Short> setNextTableFeatureProperty(TableFeatureProperties properties) {
+ private static List<Short> setNextTableFeatureProperty(final TableFeatureProperties properties) {
List<Short> nextTableIdsList = new ArrayList<>();
for (NextTableIds tableId : properties.getAugmentation(NextTableRelatedTableFeatureProperty.class)
.getNextTableIds()) {
}
private static List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> setActionTableFeatureProperty(
- TableFeatureProperties properties) {
+ final TableFeatureProperties properties) {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList = new ArrayList<>();
- org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder();
+ int order=0;
for (Action action : properties
.getAugmentation(ActionRelatedTableFeatureProperty.class).getAction()) {
if (action != null) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder();
+
+ actionBuilder.setOrder(order++);
Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ActionBase> actionType = action
.getType();
if (actionType
return actionList;
}
- private static List<SetFieldMatch> setSetFieldTableFeatureProperty(TableFeatureProperties properties,
- boolean setHasMask) {
+ private static List<SetFieldMatch> setSetFieldTableFeatureProperty(final TableFeatureProperties properties,
+ final boolean setHasMask) {
List<SetFieldMatch> setFieldMatchList = new ArrayList<>();
SetFieldMatchBuilder setFieldMatchBuilder = new SetFieldMatchBuilder();
Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField> salMatchField = null;
* @param dstPort
* @return {@link FlowBuilder} forwarding all packets to controller port
*/
- public static FlowBuilder createDirectMacToMacFlow(Short tableId, int priority, MacAddress srcMac,
- MacAddress dstMac, NodeConnectorRef dstPort) {
+ public static FlowBuilder createDirectMacToMacFlow(final Short tableId, final int priority, final MacAddress srcMac,
+ final MacAddress dstMac, final NodeConnectorRef dstPort) {
FlowBuilder macToMacFlow = new FlowBuilder() //
.setTableId(tableId) //
.setFlowName("mac2mac");
Uri outputPort = dstPort.getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId();
Action outputToControllerAction = new ActionBuilder() //
+ .setOrder(0)
.setAction(new OutputActionCaseBuilder() //
.setOutputAction(new OutputActionBuilder() //
.setMaxLength(new Integer(0xffff)) //
// Wrap our Apply Action in an Instruction
Instruction applyActionsInstruction = new InstructionBuilder() //
+ .setOrder(0)
.setInstruction(new ApplyActionsCaseBuilder()//
.setApplyActions(applyActions) //
.build()) //
* @param flowId
* @return {@link FlowBuilder} forwarding all packets to controller port
*/
- public static FlowBuilder createFwdAllToControllerFlow(Short tableId, int priority, FlowId flowId) {
+ public static FlowBuilder createFwdAllToControllerFlow(final Short tableId, final int priority, final FlowId flowId) {
FlowBuilder allToCtrlFlow = new FlowBuilder().setTableId(tableId).setFlowName("allPacketsToCtrl").setId(flowId)
.setKey(new FlowKey(flowId));