Search in sources :

Example 1 with EncapEthTypeCaseValueBuilder

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

the class EncapEthTypeCodec method deserialize.

@Override
public MatchEntry deserialize(ByteBuf message) {
    MatchEntryBuilder matchEntryBuilder = deserializeHeaderToBuilder(message);
    EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder = new EncapEthTypeCaseValueBuilder();
    encapEthTypeCaseValueBuilder.setEncapEthTypeValues(new EncapEthTypeValuesBuilder().setEncapEthType(message.readUnsignedShort()).build());
    matchEntryBuilder.setMatchEntryValue(encapEthTypeCaseValueBuilder.build());
    matchEntryBuilder.setHasMask(false);
    return matchEntryBuilder.build();
}
Also used : EncapEthTypeCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EncapEthTypeCaseValueBuilder) EncapEthTypeValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.type.grouping.EncapEthTypeValuesBuilder) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)

Example 2 with EncapEthTypeCaseValueBuilder

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

the class EncapEthTypeConvertor method convert.

@Override
public MatchEntry convert(Extension extension) {
    Optional<NxmNxEncapEthTypeGrouping> matchGrouping = MatchUtil.ENCAP_ETH_TYPE_RESOLVER.getExtension(extension);
    if (!matchGrouping.isPresent()) {
        throw new CodecPreconditionException(extension);
    }
    Integer value = matchGrouping.get().getNxmNxEncapEthType().getValue();
    EncapEthTypeCaseValueBuilder encapEthTypeCaseValueBuilder = new EncapEthTypeCaseValueBuilder();
    encapEthTypeCaseValueBuilder.setEncapEthTypeValues(new EncapEthTypeValuesBuilder().setEncapEthType(value).build());
    return MatchUtil.createDefaultMatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxEncapEthType.class, Nxm1Class.class, encapEthTypeCaseValueBuilder.build()).build();
}
Also used : NxmNxEncapEthTypeGrouping(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthTypeGrouping) Nxm1Class(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class) CodecPreconditionException(org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException) EncapEthTypeCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EncapEthTypeCaseValueBuilder) EncapEthTypeValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.type.grouping.EncapEthTypeValuesBuilder) NxmNxEncapEthType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.encap.eth.type.grouping.NxmNxEncapEthType)

Aggregations

EncapEthTypeValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.encap.eth.type.grouping.EncapEthTypeValuesBuilder)2 EncapEthTypeCaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EncapEthTypeCaseValueBuilder)2 CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)1 Nxm1Class (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class)1 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)1 NxmNxEncapEthTypeGrouping (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxEncapEthTypeGrouping)1 NxmNxEncapEthType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.encap.eth.type.grouping.NxmNxEncapEthType)1