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 Summary
Modifier and TypeMethodDescriptionvoid
registerActionDeserializer
(ExperimenterActionDeserializerKey key, OFGeneralDeserializer deserializer) Registers action deserializer.void
registerDeserializer
(MessageCodeKey key, OFGeneralDeserializer deserializer) Registers deserializer.void
registerDeserializerMapping
(TypeToClassKey key, Class<?> clazz) Registers type to class mapping used to assign return type when deserializing message.void
registerErrorDeserializer
(ExperimenterIdDeserializerKey key, OFDeserializer<ErrorMessage> deserializer) Registers error message deserializer.void
registerExperimenterMessageDeserializer
(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer) Registers experimenter (vendor) message deserializer.void
registerInstructionDeserializer
(ExperimenterInstructionDeserializerKey key, OFGeneralDeserializer deserializer) Registers instruction deserializer.void
registerMatchEntryDeserializer
(MatchEntryDeserializerKey key, OFGeneralDeserializer deserializer) Registers match entry deserializer.void
registerMeterBandDeserializer
(ExperimenterIdDeserializerKey key, OFDeserializer<MeterBandExperimenterCase> deserializer) Registers meter band deserializer (used in multipart-reply meter-config).void
registerMultipartReplyMessageDeserializer
(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer) Registers multipart-reply (stats) message deserializer.void
registerMultipartReplyTFDeserializer
(ExperimenterIdDeserializerKey key, OFGeneralDeserializer deserializer) Registers multipart-reply table-features message deserializer.void
registerQueuePropertyDeserializer
(ExperimenterIdDeserializerKey key, OFDeserializer<QueueProperty> deserializer) Registers queue property (QUEUE_GET_CONFIG_REPLY message) deserializer.boolean
Unregisters custom deserializer.boolean
Unregisters type to class mapping used to assign return type when deserializing message.
-
Method Details
-
registerDeserializer
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 lookupdeserializer
- deserializer instance
-
unregisterDeserializer
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 lookupdeserializer
- deserializer instance
-
registerInstructionDeserializer
void registerInstructionDeserializer(ExperimenterInstructionDeserializerKey key, OFGeneralDeserializer deserializer) Registers instruction deserializer.- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
registerMatchEntryDeserializer
void registerMatchEntryDeserializer(MatchEntryDeserializerKey key, OFGeneralDeserializer deserializer) Registers match entry deserializer.- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
registerErrorDeserializer
void registerErrorDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<ErrorMessage> deserializer) Registers error message deserializer.- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
registerExperimenterMessageDeserializer
void registerExperimenterMessageDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer) Registers experimenter (vendor) message deserializer.- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
registerMultipartReplyMessageDeserializer
void registerMultipartReplyMessageDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer) Registers multipart-reply (stats) message deserializer.- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
registerMultipartReplyTFDeserializer
void registerMultipartReplyTFDeserializer(ExperimenterIdDeserializerKey key, OFGeneralDeserializer deserializer) Registers multipart-reply table-features message deserializer.- Parameters:
key
- used for deserializer lookupdeserializer
- 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 lookupdeserializer
- deserializer instance
-
registerQueuePropertyDeserializer
void registerQueuePropertyDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<QueueProperty> deserializer) Registers queue property (QUEUE_GET_CONFIG_REPLY message) deserializer.- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
registerDeserializerMapping
Registers type to class mapping used to assign return type when deserializing message.- Parameters:
key
- type to class keyclazz
- return class
-
unregisterDeserializerMapping
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
-