Class DeserializerRegistryImpl
- java.lang.Object
-
- org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializerRegistryImpl
-
- All Implemented Interfaces:
DeserializerRegistry
public class DeserializerRegistryImpl extends Object implements DeserializerRegistry
Stores and registers deserializers.- Author:
- michal.polkorab
-
-
Constructor Summary
Constructors Constructor Description DeserializerRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends OFGeneralDeserializer>
TgetDeserializer(MessageCodeKey key)
Gets the deserializer for the given key.void
init()
Decoder table provisioning.void
registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer)
Registers a deserializer.boolean
unregisterDeserializer(MessageCodeKey key)
Unregisters a deserializer.
-
-
-
Method Detail
-
init
public void init()
Decoder table provisioning.- Specified by:
init
in interfaceDeserializerRegistry
-
getDeserializer
public <T extends OFGeneralDeserializer> T getDeserializer(MessageCodeKey key)
Description copied from interface:DeserializerRegistry
Gets the deserializer for the given key.- Specified by:
getDeserializer
in interfaceDeserializerRegistry
- Type Parameters:
T
- type of particular deserializer- Parameters:
key
- used for deserializer lookup- Returns:
- deserializer found
-
registerDeserializer
public void registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer)
Description copied from interface:DeserializerRegistry
Registers a 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.- Specified by:
registerDeserializer
in interfaceDeserializerRegistry
- Parameters:
key
- used for deserializer lookupdeserializer
- deserializer instance
-
unregisterDeserializer
public boolean unregisterDeserializer(MessageCodeKey key)
Description copied from interface:DeserializerRegistry
Unregisters a deserializer.- Specified by:
unregisterDeserializer
in interfaceDeserializerRegistry
- Parameters:
key
- used for deserializer lookup- Returns:
- true if deserializer was removed, false if no deserializer was found under specified key
-
-