Interface DeserializerExtensionProvider

All Known Subinterfaces:
SwitchConnectionProvider
All Known Implementing Classes:
SwitchConnectionProviderImpl

public interface DeserializerExtensionProvider
Provides methods for deserialization part of extensibility. In case of handling multiple multiple structures of same type (actions, instructions, match entries, ... ) which are differentiated by vendor / experimenter subtype, vendor has to switch / choose between these subtypes.

This has to be done in this way because of experimenter headers, which provide only vendor / experimenter ID. Subtype position may be different for different vendors (or not present at all) - that's why vendor has to handle it in his own implementations.

Author:
michal.polkorab
  • Method Details

    • registerDeserializer

      void registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer)
      Registers deserializer. Throws IllegalStateException when there is a deserializer already registered under given key.

      If the deserializer implements DeserializerRegistryInjector interface, the deserializer is injected with DeserializerRegistry instance.

      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • unregisterDeserializer

      boolean unregisterDeserializer(ExperimenterDeserializerKey key)
      Unregisters custom deserializer.
      Parameters:
      key - used for deserializer lookup
      Returns:
      true if deserializer was removed, false if no deserializer was found under specified key
    • registerActionDeserializer

      void registerActionDeserializer(ExperimenterActionDeserializerKey key, OFGeneralDeserializer deserializer)
      Registers action deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerInstructionDeserializer

      void registerInstructionDeserializer(ExperimenterInstructionDeserializerKey key, OFGeneralDeserializer deserializer)
      Registers instruction deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerMatchEntryDeserializer

      void registerMatchEntryDeserializer(MatchEntryDeserializerKey key, OFGeneralDeserializer deserializer)
      Registers match entry deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerErrorDeserializer

      void registerErrorDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<ErrorMessage> deserializer)
      Registers error message deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerExperimenterMessageDeserializer

      void registerExperimenterMessageDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer)
      Registers experimenter (vendor) message deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerMultipartReplyMessageDeserializer

      void registerMultipartReplyMessageDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer)
      Registers multipart-reply (stats) message deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerMultipartReplyTFDeserializer

      void registerMultipartReplyTFDeserializer(ExperimenterIdDeserializerKey key, OFGeneralDeserializer deserializer)
      Registers multipart-reply table-features message deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerMeterBandDeserializer

      void registerMeterBandDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<MeterBandExperimenterCase> deserializer)
      Registers meter band deserializer (used in multipart-reply meter-config).
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerQueuePropertyDeserializer

      void registerQueuePropertyDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<QueueProperty> deserializer)
      Registers queue property (QUEUE_GET_CONFIG_REPLY message) deserializer.
      Parameters:
      key - used for deserializer lookup
      deserializer - deserializer instance
    • registerDeserializerMapping

      void registerDeserializerMapping(TypeToClassKey key, Class<?> clazz)
      Registers type to class mapping used to assign return type when deserializing message.
      Parameters:
      key - type to class key
      clazz - return class
    • unregisterDeserializerMapping

      boolean unregisterDeserializerMapping(TypeToClassKey key)
      Unregisters type to class mapping used to assign return type when deserializing message.
      Parameters:
      key - type to class key
      Returns:
      true if mapping was successfully removed