public class SwitchConnectionProviderImpl extends Object implements SwitchConnectionProvider, ConnectionInitializer
MatchEntrySerializerKey
parameter representing oxm_class (see specification)MatchEntrySerializerKey
parameter representing oxm_field (see specification)Constructor and Description |
---|
SwitchConnectionProviderImpl(@Nullable ConnectionConfiguration connConfig,
OpenflowDiagStatusProvider openflowDiagStatusProvider) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ConnectionConfiguration |
getConfiguration()
Returns the connection configuration.
|
ServerFacade |
getServerFacade() |
void |
initiateConnection(String host,
int port)
Initiates connection towards device.
|
void |
registerActionDeserializer(ExperimenterActionDeserializerKey key,
OFGeneralDeserializer deserializer)
Registers action deserializer.
|
void |
registerActionSerializer(ActionSerializerKey<?> key,
OFGeneralSerializer serializer)
Registers an action serializer.
|
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 |
registerExperimenterMessageSerializer(ExperimenterIdSerializerKey<? extends ExperimenterDataOfChoice> key,
OFSerializer<? extends ExperimenterDataOfChoice> serializer)
Registers an experimenter (vendor) message serializer.
|
void |
registerInstructionDeserializer(ExperimenterInstructionDeserializerKey key,
OFGeneralDeserializer deserializer)
Registers instruction deserializer.
|
void |
registerInstructionSerializer(InstructionSerializerKey<?> key,
OFGeneralSerializer serializer)
Registers an instruction serializer.
|
void |
registerMatchEntryDeserializer(MatchEntryDeserializerKey key,
OFGeneralDeserializer deserializer)
Registers match entry deserializer.
|
<C extends OxmClassBase,F extends MatchField> |
registerMatchEntrySerializer(MatchEntrySerializerKey<C,F> key,
OFGeneralSerializer serializer)
Registers a match entry serializer.
|
void |
registerMeterBandDeserializer(ExperimenterIdDeserializerKey key,
OFDeserializer<MeterBandExperimenterCase> deserializer)
Registers meter band deserializer (used in multipart-reply meter-config).
|
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 have used ExperimenterIdMeterSubTypeSerializerKey as MeterBandSerializer's key, in order
to avoid the occurrence of an error, we should discard this function.
|
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 |
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.
|
void |
registerQueuePropertyDeserializer(ExperimenterIdDeserializerKey key,
OFDeserializer<QueueProperty> deserializer)
Registers queue property (QUEUE_GET_CONFIG_REPLY message) deserializer.
|
<K> void |
registerSerializer(MessageTypeKey<K> key,
OFGeneralSerializer serializer)
Registers a custom serializer.
|
void |
setSwitchConnectionHandler(SwitchConnectionHandler switchConnectionHandler)
Sets the SwitchConnectionHandler.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
shutdown()
Stop listening to switches.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
startup()
Start listening to switches, but please don't forget to do
SwitchConnectionProvider.setSwitchConnectionHandler(SwitchConnectionHandler) first. |
boolean |
unregisterDeserializer(ExperimenterDeserializerKey key)
Unregisters custom deserializer.
|
boolean |
unregisterDeserializerMapping(TypeToClassKey key)
Unregisters type to class mapping used to assign return type when deserializing message.
|
boolean |
unregisterSerializer(ExperimenterSerializerKey key)
Unregisters a custom serializer.
|
public SwitchConnectionProviderImpl(@Nullable ConnectionConfiguration connConfig, OpenflowDiagStatusProvider openflowDiagStatusProvider)
public void setSwitchConnectionHandler(SwitchConnectionHandler switchConnectionHandler)
SwitchConnectionProvider
setSwitchConnectionHandler
in interface SwitchConnectionProvider
switchConnectionHandler
- instance being informed when new switch connectspublic com.google.common.util.concurrent.ListenableFuture<Boolean> shutdown()
SwitchConnectionProvider
shutdown
in interface SwitchConnectionProvider
public com.google.common.util.concurrent.ListenableFuture<Boolean> startup()
SwitchConnectionProvider
SwitchConnectionProvider.setSwitchConnectionHandler(SwitchConnectionHandler)
first.startup
in interface SwitchConnectionProvider
public ServerFacade getServerFacade()
public void close()
close
in interface AutoCloseable
public boolean unregisterSerializer(ExperimenterSerializerKey key)
SerializerExtensionProvider
unregisterSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookuppublic boolean unregisterDeserializer(ExperimenterDeserializerKey key)
DeserializerExtensionProvider
unregisterDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookuppublic void registerActionSerializer(ActionSerializerKey<?> key, OFGeneralSerializer serializer)
SerializerExtensionProvider
registerActionSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookupserializer
- serializer implementationpublic void registerActionDeserializer(ExperimenterActionDeserializerKey key, OFGeneralDeserializer deserializer)
DeserializerExtensionProvider
registerActionDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerInstructionSerializer(InstructionSerializerKey<?> key, OFGeneralSerializer serializer)
SerializerExtensionProvider
registerInstructionSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookupserializer
- serializer implementationpublic void registerInstructionDeserializer(ExperimenterInstructionDeserializerKey key, OFGeneralDeserializer deserializer)
DeserializerExtensionProvider
registerInstructionDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic <C extends OxmClassBase,F extends MatchField> void registerMatchEntrySerializer(MatchEntrySerializerKey<C,F> key, OFGeneralSerializer serializer)
SerializerExtensionProvider
registerMatchEntrySerializer
in interface SerializerExtensionProvider
C
- oxm typeF
- match field typekey
- used for serializer lookupserializer
- serializer implementationpublic void registerMatchEntryDeserializer(MatchEntryDeserializerKey key, OFGeneralDeserializer deserializer)
DeserializerExtensionProvider
registerMatchEntryDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerErrorDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<ErrorMessage> deserializer)
DeserializerExtensionProvider
registerErrorDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerExperimenterMessageDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer)
DeserializerExtensionProvider
registerExperimenterMessageDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerMultipartReplyMessageDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<? extends ExperimenterDataOfChoice> deserializer)
DeserializerExtensionProvider
registerMultipartReplyMessageDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerMultipartReplyTFDeserializer(ExperimenterIdDeserializerKey key, OFGeneralDeserializer deserializer)
DeserializerExtensionProvider
registerMultipartReplyTFDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerQueuePropertyDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<QueueProperty> deserializer)
DeserializerExtensionProvider
registerQueuePropertyDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerMeterBandDeserializer(ExperimenterIdDeserializerKey key, OFDeserializer<MeterBandExperimenterCase> deserializer)
DeserializerExtensionProvider
registerMeterBandDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerExperimenterMessageSerializer(ExperimenterIdSerializerKey<? extends ExperimenterDataOfChoice> key, OFSerializer<? extends ExperimenterDataOfChoice> serializer)
SerializerExtensionProvider
registerExperimenterMessageSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookupserializer
- serializer implementationpublic void registerMultipartRequestSerializer(ExperimenterIdSerializerKey<? extends ExperimenterDataOfChoice> key, OFSerializer<? extends ExperimenterDataOfChoice> serializer)
SerializerExtensionProvider
registerMultipartRequestSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookupserializer
- serializer implementationpublic void registerMultipartRequestTFSerializer(ExperimenterIdSerializerKey<TableFeatureProperties> key, OFGeneralSerializer serializer)
SerializerExtensionProvider
registerMultipartRequestTFSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookupserializer
- serializer implementation@Deprecated public void registerMeterBandSerializer(ExperimenterIdSerializerKey<MeterBandExperimenterCase> key, OFSerializer<MeterBandExperimenterCase> serializer)
registerMeterBandSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookupserializer
- serializer implementationpublic void registerMeterBandSerializer(ExperimenterIdMeterSubTypeSerializerKey<MeterBandExperimenterCase> key, OFSerializer<MeterBandExperimenterCase> serializer)
SerializerExtensionProvider
registerMeterBandSerializer
in interface SerializerExtensionProvider
key
- used for serializer lookupserializer
- serializer implementationpublic void initiateConnection(String host, int port)
ConnectionInitializer
initiateConnection
in interface ConnectionInitializer
host
- - host IPport
- - port numberpublic ConnectionConfiguration getConfiguration()
SwitchConnectionProvider
getConfiguration
in interface SwitchConnectionProvider
public <K> void registerSerializer(MessageTypeKey<K> key, OFGeneralSerializer serializer)
SerializerExtensionProvider
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.
registerSerializer
in interface SerializerExtensionProvider
K
- serializer key typekey
- used for serializer lookupserializer
- serializer implementationpublic void registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer)
DeserializerExtensionProvider
If the deserializer implements DeserializerRegistryInjector
interface,
the deserializer is injected with DeserializerRegistry instance.
registerDeserializer
in interface DeserializerExtensionProvider
key
- used for deserializer lookupdeserializer
- deserializer instancepublic void registerDeserializerMapping(TypeToClassKey key, Class<?> clazz)
DeserializerExtensionProvider
registerDeserializerMapping
in interface DeserializerExtensionProvider
key
- type to class keyclazz
- return classpublic boolean unregisterDeserializerMapping(TypeToClassKey key)
DeserializerExtensionProvider
unregisterDeserializerMapping
in interface DeserializerExtensionProvider
key
- type to class keyCopyright © 2020 OpenDaylight. All rights reserved.