public class ConnectionAdapterImpl extends Object implements ConnectionFacade
| Modifier and Type | Field and Description |
|---|---|
protected InetSocketAddress |
address |
protected io.netty.channel.Channel |
channel |
protected boolean |
disconnectOccured |
protected org.opendaylight.openflowjava.protocol.impl.core.connection.ChannelOutboundQueue |
output |
protected static com.google.common.cache.RemovalListener<RpcResponseKey,org.opendaylight.openflowjava.protocol.impl.core.connection.ResponseExpectedRpcListener<?>> |
REMOVAL_LISTENER |
protected com.google.common.cache.Cache<RpcResponseKey,org.opendaylight.openflowjava.protocol.impl.core.connection.ResponseExpectedRpcListener<?>> |
responseCache
expiring cache for future rpcResponses.
|
| Constructor and Description |
|---|
ConnectionAdapterImpl(io.netty.channel.Channel channel,
InetSocketAddress address,
boolean useBarrier,
int channelOutboundQueueSize)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<BarrierOutput>> |
barrier(BarrierInput input) |
void |
checkListeners()
Throws exception if any of required listeners is missing.
|
void |
consume(org.opendaylight.yangtools.yang.binding.DataObject message)
Invoked to consume a message.
|
void |
consumeDeviceMessage(org.opendaylight.yangtools.yang.binding.DataObject message)
Method is equivalent to
MessageConsumer.consume(DataObject) to prevent missing method
in every children of AbstractConnectionAdapterStatistics class, because we overriding
original method for StatisticsCounters. |
Future<Boolean> |
disconnect()
Disconnect corresponding switch.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoOutput>> |
echo(EchoInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoReplyOutput>> |
echoReply(EchoReplyInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<ExperimenterOutput>> |
experimenter(ExperimenterInput input)
Send experimenter message to device, reply is not solicitated.
|
protected org.opendaylight.openflowjava.protocol.impl.core.connection.ResponseExpectedRpcListener<?> |
findRpcResponse(RpcResponseKey key)
Return cached RpcListener or
null if not cached. |
void |
fireConnectionReadyNotification()
Notify listener about connection ready-to-use event.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<FlowModOutput>> |
flowMod(FlowModInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetAsyncOutput>> |
getAsync(GetAsyncInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetConfigOutput>> |
getConfig(GetConfigInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetFeaturesOutput>> |
getFeatures(GetFeaturesInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetQueueConfigOutput>> |
getQueueConfig(GetQueueConfigInput input) |
InetSocketAddress |
getRemoteAddress()
Returns the address of the connected switch.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GroupModOutput>> |
groupMod(GroupModInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<HelloOutput>> |
hello(HelloInput input) |
boolean |
isAlive()
Determines if the connection to the switch is alive.
|
boolean |
isAutoRead()
Determines if the channel is configured to auto-read.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MeterModOutput>> |
meterMod(MeterModInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MultipartRequestOutput>> |
multipartRequest(MultipartRequestInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PacketOutOutput>> |
packetOut(PacketOutInput input) |
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PortModOutput>> |
portMod(PortModInput input) |
<T extends OutboundQueueHandler> |
registerOutboundQueueHandler(T handler,
int maxQueueDepth,
long maxBarrierNanos)
Registers a new bypass outbound queue.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<RoleRequestOutput>> |
roleRequest(RoleRequestInput input) |
protected <I extends OfHeader,O extends OfHeader> |
sendToSwitchExpectRpcResultFuture(I input,
Class<O> responseClazz,
String failureInfo)
Sends given message to switch, sending result or switch response will be reported via return value.
|
protected <O extends org.opendaylight.yangtools.yang.binding.DataObject> |
sendToSwitchFuture(Object input,
String failureInfo)
Sends given message to switch, sending result will be reported via return value.
|
void |
setAlienMessageListener(AlienMessageListener alienMessageListener)
Set handler for alien messages received from device.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetAsyncOutput>> |
setAsync(SetAsyncInput input) |
void |
setAutoRead(boolean autoRead)
Sets option for automatic channel reading - if set to false, incoming messages won't be read.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetConfigOutput>> |
setConfig(SetConfigInput input) |
void |
setConnectionReadyListener(ConnectionReadyListener connectionReadyListener)
Set listener for connection became ready-to-use event.
|
void |
setDatapathId(BigInteger datapathId)
Set datapathId for the dpn.
|
void |
setMessageListener(OpenflowProtocolListener messageListener)
Sets the protocol message listener.
|
void |
setPacketInFiltering(boolean enabled)
Set filtering of PacketIn messages.
|
void |
setSystemListener(SystemNotificationsListener systemListener)
Sets the system message listener.
|
com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<TableModOutput>> |
tableMod(TableModInput input) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsumedisconnect, getRemoteAddress, isAlive, isAutoRead, setAutoReadbarrier, echo, echoReply, experimenter, flowMod, getAsync, getConfig, getFeatures, getQueueConfig, groupMod, hello, meterMod, multipartRequest, packetOut, portMod, roleRequest, setAsync, setConfig, tableModprotected static final com.google.common.cache.RemovalListener<RpcResponseKey,org.opendaylight.openflowjava.protocol.impl.core.connection.ResponseExpectedRpcListener<?>> REMOVAL_LISTENER
protected final io.netty.channel.Channel channel
protected final InetSocketAddress address
protected boolean disconnectOccured
protected final org.opendaylight.openflowjava.protocol.impl.core.connection.ChannelOutboundQueue output
protected com.google.common.cache.Cache<RpcResponseKey,org.opendaylight.openflowjava.protocol.impl.core.connection.ResponseExpectedRpcListener<?>> responseCache
public ConnectionAdapterImpl(io.netty.channel.Channel channel,
InetSocketAddress address,
boolean useBarrier,
int channelOutboundQueueSize)
channel - the channel to be set - used for communicationaddress - client address (used only in case of UDP communication,
as there is no need to store address over tcp (stable channel))useBarrier - value is configurable by configSubsytempublic void setMessageListener(OpenflowProtocolListener messageListener)
ConnectionAdaptersetMessageListener in interface ConnectionAdaptermessageListener - here will be pushed all messages from switchpublic void setConnectionReadyListener(ConnectionReadyListener connectionReadyListener)
ConnectionAdaptersetConnectionReadyListener in interface ConnectionAdapterconnectionReadyListener - listens to connection ready eventpublic void setSystemListener(SystemNotificationsListener systemListener)
ConnectionAdaptersetSystemListener in interface ConnectionAdaptersystemListener - here will be pushed all system messages from librarypublic void setAlienMessageListener(AlienMessageListener alienMessageListener)
ConnectionAdaptersetAlienMessageListener in interface ConnectionAdapteralienMessageListener - here will be pushed all alien messages from switchpublic void consumeDeviceMessage(org.opendaylight.yangtools.yang.binding.DataObject message)
MessageConsumer.consume(DataObject) to prevent missing method
in every children of AbstractConnectionAdapterStatistics class, because we overriding
original method for StatisticsCounters.message - from device to processingpublic void checkListeners()
ConnectionAdaptercheckListeners in interface ConnectionAdapterpublic void fireConnectionReadyNotification()
ConnectionAdapterfireConnectionReadyNotification in interface ConnectionAdapterpublic <T extends OutboundQueueHandler> OutboundQueueHandlerRegistration<T> registerOutboundQueueHandler(T handler, int maxQueueDepth, long maxBarrierNanos)
ConnectionAdapterregisterOutboundQueueHandler in interface ConnectionAdapterT - handler typehandler - queue handlermaxQueueDepth - max amount of not confirmed messaged in queue (i.e. edge for barrier message)maxBarrierNanos - regular base for barrier messageOutboundQueueHandlerRegistrationpublic void setPacketInFiltering(boolean enabled)
ConnectionAdaptersetPacketInFiltering in interface ConnectionAdapterenabled - True if PacketIn messages should be filtered, false if they should be reported.public void setDatapathId(BigInteger datapathId)
ConnectionAdaptersetDatapathId in interface ConnectionAdapterdatapathId - of the dpnpublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<FlowModOutput>> flowMod(FlowModInput input)
flowMod in interface OpenflowProtocolServiceprotected <I extends OfHeader,O extends OfHeader> com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<O>> sendToSwitchExpectRpcResultFuture(I input, Class<O> responseClazz, String failureInfo)
input - message to sendresponseClazz - type of responsefailureInfo - describes, what type of message caused failure by sendingRpcResult will contain errors and failed statusRpcResult will be stored in responseCache and wait for particular timeout (
AbstractConnectionAdapter.RPC_RESPONSE_EXPIRATION),
protected <O extends org.opendaylight.yangtools.yang.binding.DataObject> com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<O>> sendToSwitchFuture(Object input, String failureInfo)
input - message to sendfailureInfo - describes, what type of message caused failure by sendingRpcResult without errors and successful status will be returned,RpcResult will contain errors and failed statuspublic void consume(org.opendaylight.yangtools.yang.binding.DataObject message)
MessageConsumerconsume in interface MessageConsumermessage - to processpublic Future<Boolean> disconnect()
ConnectionAdapterdisconnect in interface ConnectionAdapterpublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<BarrierOutput>> barrier(BarrierInput input)
barrier in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoOutput>> echo(EchoInput input)
echo in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoReplyOutput>> echoReply(EchoReplyInput input)
echoReply in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<ExperimenterOutput>> experimenter(ExperimenterInput input)
OpenflowProtocolServiceexperimenter in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetConfigOutput>> getConfig(GetConfigInput input)
getConfig in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetFeaturesOutput>> getFeatures(GetFeaturesInput input)
getFeatures in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetQueueConfigOutput>> getQueueConfig(GetQueueConfigInput input)
getQueueConfig in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GroupModOutput>> groupMod(GroupModInput input)
groupMod in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<HelloOutput>> hello(HelloInput input)
hello in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MeterModOutput>> meterMod(MeterModInput input)
meterMod in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PacketOutOutput>> packetOut(PacketOutInput input)
packetOut in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MultipartRequestOutput>> multipartRequest(MultipartRequestInput input)
multipartRequest in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PortModOutput>> portMod(PortModInput input)
portMod in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<RoleRequestOutput>> roleRequest(RoleRequestInput input)
roleRequest in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetConfigOutput>> setConfig(SetConfigInput input)
setConfig in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<TableModOutput>> tableMod(TableModInput input)
tableMod in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input)
getAsync in interface OpenflowProtocolServicepublic com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetAsyncOutput>> setAsync(SetAsyncInput input)
setAsync in interface OpenflowProtocolServicepublic boolean isAlive()
ConnectionAdapterisAlive in interface ConnectionAdapterpublic boolean isAutoRead()
ConnectionAdapterisAutoRead in interface ConnectionAdapterpublic void setAutoRead(boolean autoRead)
ConnectionAdaptersetAutoRead in interface ConnectionAdapterautoRead - target value to be switched topublic InetSocketAddress getRemoteAddress()
ConnectionAdaptergetRemoteAddress in interface ConnectionAdapterprotected org.opendaylight.openflowjava.protocol.impl.core.connection.ResponseExpectedRpcListener<?> findRpcResponse(RpcResponseKey key)
null if not cached.Copyright © 2020 OpenDaylight. All rights reserved.