Class SerializerRegistryImpl
- java.lang.Object
-
- org.opendaylight.openflowjava.protocol.impl.serialization.SerializerRegistryImpl
-
- All Implemented Interfaces:
SerializerRegistry
public class SerializerRegistryImpl extends Object implements SerializerRegistry
- Author:
- michal.polkorab, timotej.kubas, giuseppex.petralia@intel.com
-
-
Constructor Summary
Constructors Constructor Description SerializerRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,S extends OFGeneralSerializer>
SgetSerializer(MessageTypeKey<K> msgTypeKey)
Gets the encoder for the given message type key.void
init()
Serializer registry provisioning.boolean
isGroupAddModEnabled()
Checks if group add mod messages are enabled.<K> void
registerSerializer(MessageTypeKey<K> msgTypeKey, OFGeneralSerializer serializer)
Registers a serializer.void
setGroupAddModConfig(boolean value)
Sets whether or not group add mod messages are enabled.<K> boolean
unregisterSerializer(MessageTypeKey<K> msgTypeKey)
Unregisters a serializer.
-
-
-
Method Detail
-
init
public void init()
Description copied from interface:SerializerRegistry
Serializer registry provisioning.- Specified by:
init
in interfaceSerializerRegistry
-
setGroupAddModConfig
public void setGroupAddModConfig(boolean value)
Description copied from interface:SerializerRegistry
Sets whether or not group add mod messages are enabled.- Specified by:
setGroupAddModConfig
in interfaceSerializerRegistry
- Parameters:
value
- true if group add mod messages are enabled
-
isGroupAddModEnabled
public boolean isGroupAddModEnabled()
Description copied from interface:SerializerRegistry
Checks if group add mod messages are enabled.- Specified by:
isGroupAddModEnabled
in interfaceSerializerRegistry
- Returns:
- true if group add mod messages are enabled
-
getSerializer
public <K,S extends OFGeneralSerializer> S getSerializer(MessageTypeKey<K> msgTypeKey)
Gets the encoder for the given message type key.- Specified by:
getSerializer
in interfaceSerializerRegistry
- Type Parameters:
K
- input key typeS
- type of resulting serializer- Parameters:
msgTypeKey
- the message type key- Returns:
- encoder for current type of message (msgTypeKey)
-
registerSerializer
public <K> void registerSerializer(MessageTypeKey<K> msgTypeKey, OFGeneralSerializer serializer)
Description copied from interface:SerializerRegistry
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.- Specified by:
registerSerializer
in interfaceSerializerRegistry
- Type Parameters:
K
- serializer key type- Parameters:
msgTypeKey
- used for serializer lookupserializer
- serializer implementation
-
unregisterSerializer
public <K> boolean unregisterSerializer(MessageTypeKey<K> msgTypeKey)
Description copied from interface:SerializerRegistry
Unregisters a serializer.- Specified by:
unregisterSerializer
in interfaceSerializerRegistry
- Type Parameters:
K
- serializer key type- Parameters:
msgTypeKey
- used for serializer lookup- Returns:
- true if serializer was removed, false if no serializer was found under specified key
-
-