Interface SerializerRegistry
-
- All Known Implementing Classes:
SerializerRegistryImpl
public interface SerializerRegistry
- Author:
- michal.polkorab
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <K,S extends OFGeneralSerializer>
SgetSerializer(MessageTypeKey<K> msgTypeKey)
Gets the serializer for the given type.void
init()
Serializer registry provisioning.boolean
isGroupAddModEnabled()
Checks if group add mod messages are enabled.<K> void
registerSerializer(MessageTypeKey<K> key, OFGeneralSerializer serializer)
Registers a serializer.void
setGroupAddModConfig(boolean isGroupAddModEnabled)
Sets whether or not group add mod messages are enabled.<K> boolean
unregisterSerializer(MessageTypeKey<K> key)
Unregisters a serializer.
-
-
-
Method Detail
-
init
void init()
Serializer registry provisioning.
-
getSerializer
<K,S extends OFGeneralSerializer> S getSerializer(MessageTypeKey<K> msgTypeKey)
Gets the serializer for the given type.- Type Parameters:
K
- input key typeS
- type of resulting serializer- Parameters:
msgTypeKey
- lookup key- Returns:
- serializer or NullPointerException if no serializer was found
-
registerSerializer
<K> void registerSerializer(MessageTypeKey<K> key, OFGeneralSerializer serializer)
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.- Type Parameters:
K
- serializer key type- Parameters:
key
- used for serializer lookupserializer
- serializer implementation
-
unregisterSerializer
<K> boolean unregisterSerializer(MessageTypeKey<K> key)
Unregisters a serializer.- Type Parameters:
K
- serializer key type- Parameters:
key
- used for serializer lookup- Returns:
- true if serializer was removed, false if no serializer was found under specified key
-
isGroupAddModEnabled
boolean isGroupAddModEnabled()
Checks if group add mod messages are enabled.- Returns:
- true if group add mod messages are enabled
-
setGroupAddModConfig
void setGroupAddModConfig(boolean isGroupAddModEnabled)
Sets whether or not group add mod messages are enabled.- Parameters:
isGroupAddModEnabled
- true if group add mod messages are enabled
-
-