Class AbstractMatchEntrySerializer<E,M>

java.lang.Object
org.opendaylight.openflowplugin.impl.protocol.serialization.match.AbstractMatchEntrySerializer<E,M>
Type Parameters:
E - Match entry type
M - Match entry mask type, use Void a mask is not applicable
All Implemented Interfaces:
MatchEntrySerializer
Direct Known Subclasses:
AbstractExperimenterMatchEntrySerializer, AbstractIpv4PrefixEntrySerializer, AbstractMacAddressFilterEntrySerializer, AbstractPortNumberWithMaskEntrySerilizer, AbstractPrimitiveEntrySerializer, Ipv4DestinationEntrySerializer, Ipv4SourceEntrySerializer, Ipv6DestinationEntrySerializer, Ipv6ExtHeaderEntrySerializer, Ipv6LabelEntrySerializer, Ipv6SourceEntrySerializer, MetadataEntrySerializer, PbbEntrySerializer, TunnelIdEntrySerializer, VlanVidEntrySerializer

public abstract class AbstractMatchEntrySerializer<E,M> extends Object implements MatchEntrySerializer
Abstract base class for conveniently implementing MatchEntrySerializer.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static final class 
    Utility AbstractMatchEntrySerializer.HeaderWriter optimized for cases where the header does not depend on the actual entry content beyond presence/absence of a mask.
    protected static class 
    Base class supporting writing out a particular match entry's header.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractMatchEntrySerializer(int oxmClassCode, int oxmFieldCode, int valueLength)
     
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract @Nullable E
    Extract the corresponding entry from a match.
    protected abstract @Nullable M
    extractEntryMask(@NonNull E entry)
    Extract the mask contained in an entry.
    protected abstract void
    serializeEntry(@NonNull E entry, @Nullable M mask, @NonNull io.netty.buffer.ByteBuf outBuffer)
    Extract the corresponding entry from a match.
    final void
    serializeIfPresent(Match match, io.netty.buffer.ByteBuf outBuffer)
    Serialize this match entry if it is present in the match.
    protected static void
    writeIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address, io.netty.buffer.ByteBuf outBuffer)
    Serialize Ipv4 address to bytes.
    protected static void
    writeIpv4Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer)
    Serialize Ipv4 prefix (address and mask).
    protected static void
    writeIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address address, io.netty.buffer.ByteBuf outBuffer)
    Serialize Ipv6 address to bytes.
    protected static void
    writeIpv6Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer)
    Serialize Ipv6 prefix (address and mask).
    protected static void
    writeMacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress address, io.netty.buffer.ByteBuf outBuffer)
    Serialize Mac address to bytes.
    protected static void
    writeMask(byte[] mask, io.netty.buffer.ByteBuf outBuffer, int length)
    Serialize byte mask to bytes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractMatchEntrySerializer

      protected AbstractMatchEntrySerializer(AbstractMatchEntrySerializer.HeaderWriter<E,M> headerWriter)
    • AbstractMatchEntrySerializer

      protected AbstractMatchEntrySerializer(int oxmClassCode, int oxmFieldCode, int valueLength)
  • Method Details

    • serializeIfPresent

      public final void serializeIfPresent(Match match, io.netty.buffer.ByteBuf outBuffer)
      Description copied from interface: MatchEntrySerializer
      Serialize this match entry if it is present in the match.
      Specified by:
      serializeIfPresent in interface MatchEntrySerializer
      Parameters:
      match - Openflow match
      outBuffer - output buffer
    • writeMask

      protected static void writeMask(byte[] mask, io.netty.buffer.ByteBuf outBuffer, int length)
      Serialize byte mask to bytes. checking for mask length.
      Parameters:
      mask - byte mask
      outBuffer - output buffer
      length - mask length
    • writeIpv4Address

      protected static void writeIpv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address, io.netty.buffer.ByteBuf outBuffer)
      Serialize Ipv4 address to bytes.
      Parameters:
      address - Ipv4 address
      outBuffer - output buffer
    • writeIpv6Address

      protected static void writeIpv6Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address address, io.netty.buffer.ByteBuf outBuffer)
      Serialize Ipv6 address to bytes.
      Parameters:
      address - Ipv6 address
      outBuffer - output buffer
    • writeMacAddress

      protected static void writeMacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress address, io.netty.buffer.ByteBuf outBuffer)
      Serialize Mac address to bytes.
      Parameters:
      address - Mac address
      outBuffer - output buffer
    • writeIpv4Prefix

      protected static void writeIpv4Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer)
      Serialize Ipv4 prefix (address and mask).
      Parameters:
      prefix - Ipv4 prefix
      outBuffer - output buffer
    • writeIpv6Prefix

      protected static void writeIpv6Prefix(@NonNull org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix prefix, @Nullable Integer mask, @NonNull io.netty.buffer.ByteBuf outBuffer)
      Serialize Ipv6 prefix (address and mask).
      Parameters:
      prefix - Ipv6 prefix
      outBuffer - output buffer
    • extractEntry

      protected abstract @Nullable E extractEntry(Match match)
      Extract the corresponding entry from a match.
      Parameters:
      match - Openflow match
      Returns:
      Entry, null if not present
    • extractEntryMask

      protected abstract @Nullable M extractEntryMask(@NonNull E entry)
      Extract the mask contained in an entry.
      Parameters:
      entry - entry to examine
      Returns:
      Mask, null if not present
    • serializeEntry

      protected abstract void serializeEntry(@NonNull E entry, @Nullable M mask, @NonNull io.netty.buffer.ByteBuf outBuffer)
      Extract the corresponding entry from a match.
      Parameters:
      entry - entry to serialize
      mask - mask as extracted from entry
      outBuffer - output buffer