Interface SerializerExtensionProvider

  • All Known Subinterfaces:
    SwitchConnectionProvider
    All Known Implementing Classes:
    SwitchConnectionProviderImpl

    public interface SerializerExtensionProvider
    Provides methods for serialization part of extensibility. In case of handling 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 unknown augmentations - that's why vendor has to handle it in his own implementations.

    Author:
    michal.polkorab
    • Method Detail

      • registerSerializer

        <K> void registerSerializer​(MessageTypeKey<K> key,
                                    OFGeneralSerializer serializer)
        Registers a custom 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.

        Type Parameters:
        K - serializer key type
        Parameters:
        key - used for serializer lookup
        serializer - serializer implementation
      • unregisterSerializer

        boolean unregisterSerializer​(ExperimenterSerializerKey key)
        Unregisters a custom serializer.
        Parameters:
        key - used for serializer lookup
        Returns:
        true if serializer was removed, false if no serializer was found under specified key
      • registerActionSerializer

        void registerActionSerializer​(ActionSerializerKey<?> key,
                                      OFGeneralSerializer serializer)
        Registers an action serializer.
        Parameters:
        key - used for serializer lookup
        serializer - serializer implementation
      • registerInstructionSerializer

        void registerInstructionSerializer​(InstructionSerializerKey<?> key,
                                           OFGeneralSerializer serializer)
        Registers an instruction serializer.
        Parameters:
        key - used for serializer lookup
        serializer - serializer implementation
      • registerMatchEntrySerializer

        <C extends OxmClassBase,​F extends MatchField> void registerMatchEntrySerializer​(MatchEntrySerializerKey<C,​F> key,
                                                                                              OFGeneralSerializer serializer)
        Registers a match entry serializer.
        Type Parameters:
        C - oxm type
        F - match field type
        Parameters:
        key - used for serializer lookup
        serializer - serializer implementation
      • registerMeterBandSerializer

        @Deprecated
        void registerMeterBandSerializer​(ExperimenterIdSerializerKey<MeterBandExperimenterCase> key,
                                         OFSerializer<MeterBandExperimenterCase> serializer)
        Deprecated.
        Since we use ExperimenterIdMeterSubTypeSerializerKey as MeterBandSerializer's key, in order to avoid the occurrence of an error,we should discard this function
        Registers a meter band serializer (used in meter-mod messages).
        Parameters:
        key - used for serializer lookup
        serializer - serializer implementation