use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method setSetFieldTableFeatureProperty.
private static void setSetFieldTableFeatureProperty(final TableFeaturePropertiesBuilder builder, final TableFeaturesPropType type, final List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFields) {
List<MatchEntry> matchEntriesList = new ArrayList<>();
for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch currMatch : setFields) {
Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MatchField> currMatchType = currMatch.getMatchType();
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField> ofTableFeatureClass = SAL_TO_OF_TABLE_FEATURES.get(currMatchType);
setMatchEntry(matchEntryBuilder, ofTableFeatureClass, currMatch.isHasMask());
matchEntriesList.add(matchEntryBuilder.build());
}
OxmRelatedTableFeaturePropertyBuilder propBuilder = new OxmRelatedTableFeaturePropertyBuilder();
propBuilder.setMatchEntry(matchEntriesList);
builder.setType(type);
builder.addAugmentation(OxmRelatedTableFeatureProperty.class, propBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method toTableProperties.
private static List<TableFeatureProperties> toTableProperties(final org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TableProperties tableProperties) {
if (tableProperties == null) {
return Collections.emptyList();
}
List<TableFeatureProperties> ofTablePropertiesList = new ArrayList<>();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties> sortedTableProperties = TABLE_FEATURE_PROPS_ORDERING.sortedCopy(tableProperties.getTableFeatureProperties());
for (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties property : sortedTableProperties) {
TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType propType = property.getTableFeaturePropType();
setTableFeatureProperty(propType);
if (propType instanceof Instructions) {
setTableFeatureProperty((Instructions) propType, propBuilder);
} else if (propType instanceof InstructionsMiss) {
setTableFeatureProperty((InstructionsMiss) propType, propBuilder);
} else if (propType instanceof NextTable) {
setTableFeatureProperty((NextTable) propType, propBuilder);
} else if (propType instanceof NextTableMiss) {
setTableFeatureProperty((NextTableMiss) propType, propBuilder);
} else if (propType instanceof WriteActions) {
setTableFeatureProperty((WriteActions) propType, propBuilder);
} else if (propType instanceof WriteActionsMiss) {
setTableFeatureProperty((WriteActionsMiss) propType, propBuilder);
} else if (propType instanceof ApplyActions) {
setTableFeatureProperty((ApplyActions) propType, propBuilder);
} else if (propType instanceof ApplyActionsMiss) {
setTableFeatureProperty((ApplyActionsMiss) propType, propBuilder);
} else if (propType instanceof Match) {
setTableFeatureProperty((Match) propType, propBuilder);
} else if (propType instanceof Wildcards) {
setTableFeatureProperty((Wildcards) propType, propBuilder);
} else if (propType instanceof WriteSetfield) {
setTableFeatureProperty((WriteSetfield) propType, propBuilder);
} else if (propType instanceof WriteSetfieldMiss) {
setTableFeatureProperty((WriteSetfieldMiss) propType, propBuilder);
} else if (propType instanceof ApplySetfield) {
setTableFeatureProperty((ApplySetfield) propType, propBuilder);
} else if (propType instanceof ApplySetfieldMiss) {
setTableFeatureProperty((ApplySetfieldMiss) propType, propBuilder);
}
// Experimenter and Experimenter miss Table features are unhandled
ofTablePropertiesList.add(propBuilder.build());
}
return ofTablePropertiesList;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder in project openflowplugin by opendaylight.
the class TableFeaturesResponseConvertor method toTableProperties.
private static TableProperties toTableProperties(final List<TableFeatureProperties> ofTablePropertiesList) {
if (ofTablePropertiesList == null) {
return new TablePropertiesBuilder().setTableFeatureProperties(Collections.emptyList()).build();
}
List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties> salTablePropertiesList = new ArrayList<>();
TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
int index = 0;
for (TableFeatureProperties property : ofTablePropertiesList) {
TableFeaturesPropType propType = property.getType();
ActionExecutor actionExecutor = TABLE_FEATURE_PROPERTY_TYPE_TO_ACTION.get(propType);
if (actionExecutor != null) {
actionExecutor.execute(property, propBuilder);
} else {
LOG.error("Unsupported table feature property : " + propType);
}
propBuilder.setOrder(index);
salTablePropertiesList.add(propBuilder.build());
index += 1;
}
return new TablePropertiesBuilder().setTableFeatureProperties(salTablePropertiesList).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createApplySetFieldTblFeatureProp.
private TableFeaturePropertiesBuilder createApplySetFieldTblFeatureProp() {
// t13
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
SetFieldMatchBuilder setFieldMatchBld2 = new SetFieldMatchBuilder();
setFieldMatchBld2.setHasMask(true);
setFieldMatchBld2.setMatchType(InPort.class);
SetFieldMatchBuilder setFieldMatchBld3 = new SetFieldMatchBuilder();
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(Ipv4Dst.class);
List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
ApplySetfieldBuilder applySetfieldBld = new ApplySetfieldBuilder();
org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder();
applySetfieldBuilder.setSetFieldMatch(setFieldMatch);
applySetfieldBld.setApplySetfield(applySetfieldBuilder.build());
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(applySetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createWriteActionsMissTblFeatureProp.
private TableFeaturePropertiesBuilder createWriteActionsMissTblFeatureProp() {
// t9
List<Action> actionList = new ArrayList<>();
ActionBuilder abt1 = new ActionBuilder();
abt1.setAction(new CopyTtlInCaseBuilder().build());
actionList.add(abt1.build());
ActionBuilder abt2 = new ActionBuilder();
abt2.setAction(new PushPbbActionCaseBuilder().build());
actionList.add(abt2.build());
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder().setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
}
Aggregations