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 Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
registerActionSerializer(ActionSerializerKey<?> key, OFGeneralSerializer serializer)
Registers an action serializer.void
registerExperimenterMessageSerializer(ExperimenterIdSerializerKey<? extends ExperimenterDataOfChoice> key, OFSerializer<? extends ExperimenterDataOfChoice> serializer)
Registers an experimenter (vendor) message serializer.void
registerInstructionSerializer(InstructionSerializerKey<?> key, OFGeneralSerializer serializer)
Registers an instruction serializer.<C extends OxmClassBase,F extends MatchField>
voidregisterMatchEntrySerializer(MatchEntrySerializerKey<C,F> key, OFGeneralSerializer serializer)
Registers a match entry serializer.void
registerMeterBandSerializer(ExperimenterIdMeterSubTypeSerializerKey<MeterBandExperimenterCase> key, OFSerializer<MeterBandExperimenterCase> serializer)
Registers a meter band serializer (used in meter-mod messages).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 functionvoid
registerMultipartRequestSerializer(ExperimenterIdSerializerKey<? extends ExperimenterDataOfChoice> key, OFSerializer<? extends ExperimenterDataOfChoice> serializer)
Registers a multipart-request (stats-request) serializer.void
registerMultipartRequestTFSerializer(ExperimenterIdSerializerKey<TableFeatureProperties> key, OFGeneralSerializer serializer)
Registers a multipart-request table-features serializer.<K> void
registerSerializer(MessageTypeKey<K> key, OFGeneralSerializer serializer)
Registers a custom serializer.boolean
unregisterSerializer(ExperimenterSerializerKey key)
Unregisters a custom serializer.
-
-
-
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 lookupserializer
- 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 lookupserializer
- serializer implementation
-
registerInstructionSerializer
void registerInstructionSerializer(InstructionSerializerKey<?> key, OFGeneralSerializer serializer)
Registers an instruction serializer.- Parameters:
key
- used for serializer lookupserializer
- 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 typeF
- match field type- Parameters:
key
- used for serializer lookupserializer
- serializer implementation
-
registerExperimenterMessageSerializer
void registerExperimenterMessageSerializer(ExperimenterIdSerializerKey<? extends ExperimenterDataOfChoice> key, OFSerializer<? extends ExperimenterDataOfChoice> serializer)
Registers an experimenter (vendor) message serializer.- Parameters:
key
- used for serializer lookupserializer
- serializer implementation
-
registerMultipartRequestSerializer
void registerMultipartRequestSerializer(ExperimenterIdSerializerKey<? extends ExperimenterDataOfChoice> key, OFSerializer<? extends ExperimenterDataOfChoice> serializer)
Registers a multipart-request (stats-request) serializer.- Parameters:
key
- used for serializer lookupserializer
- serializer implementation
-
registerMultipartRequestTFSerializer
void registerMultipartRequestTFSerializer(ExperimenterIdSerializerKey<TableFeatureProperties> key, OFGeneralSerializer serializer)
Registers a multipart-request table-features serializer.- Parameters:
key
- used for serializer lookupserializer
- 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 functionRegisters a meter band serializer (used in meter-mod messages).- Parameters:
key
- used for serializer lookupserializer
- serializer implementation
-
registerMeterBandSerializer
void registerMeterBandSerializer(ExperimenterIdMeterSubTypeSerializerKey<MeterBandExperimenterCase> key, OFSerializer<MeterBandExperimenterCase> serializer)
Registers a meter band serializer (used in meter-mod messages).- Parameters:
key
- used for serializer lookupserializer
- serializer implementation
-
-