Search in sources :

Example 1 with OfInPortCaseValueBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValueBuilder in project openflowplugin by opendaylight.

the class NxmInPortConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmOfInPortGrouping> matchGrouping = MatchUtil.NXM_OF_INPORT_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    Integer value = matchGrouping.get().getOfInPort().getValue();
    OfInPortCaseValueBuilder inPortCaseValueBuilder = new OfInPortCaseValueBuilder();
    inPortCaseValueBuilder.setNxmOfInPortValues(new NxmOfInPortValuesBuilder().setValue(value).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfInPort.class, Nxm0Class.class, inPortCaseValueBuilder.build()).build();
}
Also used : NxmOfInPortGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfInPortGrouping) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException) Nxm0Class(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class) NxmOfInPortValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.in.port.type.grouping.NxmOfInPortValuesBuilder) OfInPortCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValueBuilder)

Example 2 with OfInPortCaseValueBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValueBuilder in project openflowplugin by opendaylight.

the class InPortCodec method deserialize.

@Override
public MatchEntry deserialize(ByteBuf message) {
    MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
    OfInPortCaseValueBuilder caseBuilder = new OfInPortCaseValueBuilder();
    NxmOfInPortValuesBuilder valuesBuilder = new NxmOfInPortValuesBuilder();
    valuesBuilder.setValue(message.readInt()).build();
    caseBuilder.setNxmOfInPortValues(valuesBuilder.build());
    matchEntryBuilder.setMatchEntryValue(caseBuilder.build());
    return matchEntryBuilder.build();
}
Also used : NxmOfInPortValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.in.port.type.grouping.NxmOfInPortValuesBuilder) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) OfInPortCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValueBuilder)

Aggregations

NxmOfInPortValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.in.port.type.grouping.NxmOfInPortValuesBuilder)2 OfInPortCaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.OfInPortCaseValueBuilder)2 CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)1 Nxm0Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 NxmOfInPortGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfInPortGrouping)1