Class SerializerRegistryImpl

java.lang.Object
org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl
All Implemented Interfaces:
SerializerRegistry

public class SerializerRegistryImpl extends Object implements SerializerRegistry
Stores and handles serializers.
K - MessageTypeKey type
S - returned serializer type
Author:
michal.polkorab, timotej.kubas, giuseppex.petralia@intel.com
  • Constructor Details

    • SerializerRegistryImpl

      public SerializerRegistryImpl()
  • Method Details

    • init

      public void init()
      Description copied from interface: SerializerRegistry
      Serializer registry provisioning.
      Specified by:
      init in interface SerializerRegistry
    • setGroupAddModConfig

      public void setGroupAddModConfig(boolean value)
      Description copied from interface: SerializerRegistry
      Sets whether or not group add mod messages are enabled.
      Specified by:
      setGroupAddModConfig in interface SerializerRegistry
      Parameters:
      value - true if group add mod messages are enabled
    • isGroupAddModEnabled

      public boolean isGroupAddModEnabled()
      Description copied from interface: SerializerRegistry
      Checks if group add mod messages are enabled.
      Specified by:
      isGroupAddModEnabled in interface SerializerRegistry
      Returns:
      true if group add mod messages are enabled
    • getSerializer

      public <K, S extends OFGeneralSerializer> S getSerializer(MessageTypeKey<K> msgTypeKey)
      Gets the encoder for the given message type key.
      Specified by:
      getSerializer in interface SerializerRegistry
      Type Parameters:
      K - input key type
      S - type of resulting serializer
      Parameters:
      msgTypeKey - the message type key
      Returns:
      encoder for current type of message (msgTypeKey)
    • registerSerializer

      public <K> void registerSerializer(MessageTypeKey<K> msgTypeKey, OFGeneralSerializer serializer)
      Description copied from interface: SerializerRegistry
      Registers a serializer.

      Throws IllegalStateException when there is a serializer already registered under given key.

      If the serializer implements SerializerRegistryInjector interface, the serializer is injected with SerializerRegistry instance.

      Specified by:
      registerSerializer in interface SerializerRegistry
      Type Parameters:
      K - serializer key type
      Parameters:
      msgTypeKey - used for serializer lookup
      serializer - serializer implementation
    • unregisterSerializer

      public <K> boolean unregisterSerializer(MessageTypeKey<K> msgTypeKey)
      Description copied from interface: SerializerRegistry
      Unregisters a serializer.
      Specified by:
      unregisterSerializer in interface SerializerRegistry
      Type Parameters:
      K - serializer key type
      Parameters:
      msgTypeKey - used for serializer lookup
      Returns:
      true if serializer was removed, false if no serializer was found under specified key