Search in sources :

Example 1 with WriteActionsMiss

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss in project openflowplugin by opendaylight.

the class WriteActionsMissTablePropertySerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    final WriteActionsMiss property = new 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(Collections.singletonList(new ActionBuilder().setOrder(0).setAction(new SetNwSrcActionCaseBuilder().build()).build())).build()).build();
    assertProperty(property, out -> {
        assertEquals(out.readUnsignedShort(), ActionConstants.SET_FIELD_CODE);
        // Skip length of set field action
        out.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
    });
}
Also used : SetNwSrcActionCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) WriteActionsMissBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder) WriteActionsMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss) Test(org.junit.Test)

Example 2 with WriteActionsMiss

use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss 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;
}
Also used : TableFeatureProperties(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties) ArrayList(java.util.ArrayList) WriteSetfieldMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfieldMiss) ApplyActionsMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMiss) Match(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match) ApplySetfieldMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMiss) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeaturePropertiesBuilder) WriteActions(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActions) WriteActionsMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss) TableFeaturePropType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType) ApplyActions(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActions) NextTable(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTable) InstructionsMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMiss) Instructions(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Instructions) ApplySetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield) NextTableMiss(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMiss) WriteSetfield(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteSetfield) Wildcards(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Wildcards)

Aggregations

WriteActionsMiss (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMiss)2 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 SetNwSrcActionCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwSrcActionCaseBuilder)1 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)1 TableFeatureProperties (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties)1 TableFeaturePropertiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeaturePropertiesBuilder)1 TableFeaturePropType (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.TableFeaturePropType)1 ApplyActions (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActions)1 ApplyActionsMiss (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMiss)1 ApplySetfield (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfield)1 ApplySetfieldMiss (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplySetfieldMiss)1 Instructions (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Instructions)1 InstructionsMiss (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMiss)1 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match)1 NextTable (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTable)1 NextTableMiss (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.NextTableMiss)1 Wildcards (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Wildcards)1 WriteActions (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActions)1 WriteActionsMissBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder)1