Interface ConnectionAdapter
- All Known Subinterfaces:
ConnectionFacade
- All Known Implementing Classes:
ConnectionAdapterImpl
public interface ConnectionAdapter
Manages a switch connection.
- Author:
- mirehak, michal.polkorab
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescription@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<BarrierOutput>>
barrier
(BarrierInput input) Invokebarrier
RPC.void
Throws exception if any of required listeners is missing.Disconnect corresponding switch.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoOutput>>
Invokeecho
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoReplyOutput>>
echoReply
(EchoReplyInput input) Invokeecho-reply
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<ExperimenterOutput>>
experimenter
(ExperimenterInput input) Invokeexperimenter
RPC.void
Notify listener about connection ready-to-use event.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<FlowModOutput>>
flowMod
(FlowModInput input) Invokeflow-mod
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetAsyncOutput>>
getAsync
(GetAsyncInput input) Invokeget-async
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetConfigOutput>>
getConfig
(GetConfigInput input) Invokeget-config
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetFeaturesOutput>>
getFeatures
(GetFeaturesInput input) Invokeget-features
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetQueueConfigOutput>>
Invokeget-queue-config
RPC.Returns the address of the connected switch.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GroupModOutput>>
groupMod
(GroupModInput input) Invokegroup-mod
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<HelloOutput>>
hello
(HelloInput input) Invokehello
RPC.boolean
isAlive()
Determines if the connection to the switch is alive.boolean
Determines if the channel is configured to auto-read.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MeterModOutput>>
meterMod
(MeterModInput input) Invokemeter-mod
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MultipartRequestOutput>>
Invokemultipart-request
RPC.void
onSwitchCertificateIdentified
(@Nullable List<X509Certificate> certificateChain) Notify listener about switch certificate information.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PacketOutOutput>>
packetOut
(PacketOutInput input) Invokepacket-out
RPC.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PortModOutput>>
portMod
(PortModInput input) Invokeport-mod
RPC.<T extends OutboundQueueHandler>
OutboundQueueHandlerRegistration<T>registerOutboundQueueHandler
(T handler, int maxQueueDepth, long maxBarrierNanos) Registers a new bypass outbound queue.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<RoleRequestOutput>>
roleRequest
(RoleRequestInput input) Invokerole-request
RPC.void
setAlienMessageListener
(AlienMessageListener alienMessageListener) Set handler for alien messages received from device.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetAsyncOutput>>
setAsync
(SetAsyncInput input) Invokeset-async
RPC.void
setAutoRead
(boolean autoRead) Sets option for automatic channel reading - if set to false, incoming messages won't be read.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetConfigOutput>>
setConfig
(SetConfigInput input) Invokeset-config
RPC.void
setConnectionReadyListener
(ConnectionReadyListener connectionReadyListener) Set listener for connection became ready-to-use event.void
setDatapathId
(BigInteger datapathId) Set datapathId for the dpn.void
setExecutorService
(ExecutorService executorService) Sets executorService.void
setMessageListener
(ConnectionAdapter.MessageListener messageListener) Sets the protocol message listener.void
setPacketInFiltering
(boolean enabled) Set filtering of PacketIn messages.void
setSystemListener
(ConnectionAdapter.SystemListener systemListener) Sets the system message listener.@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<TableModOutput>>
tableMod
(TableModInput input) Invoketable-mod
RPC.
-
Method Details
-
disconnect
Disconnect corresponding switch.- Returns:
- future set to true, when disconnect completed
-
isAlive
boolean isAlive()Determines if the connection to the switch is alive.- Returns:
- true, if connection to switch is alive
-
getRemoteAddress
InetSocketAddress getRemoteAddress()Returns the address of the connected switch.- Returns:
- address of the remote end - address of a switch if connected
-
setMessageListener
Sets the protocol message listener.- Parameters:
messageListener
- here will be pushed all messages from switch
-
setSystemListener
Sets the system message listener.- Parameters:
systemListener
- here will be pushed all system messages from library
-
setAlienMessageListener
Set handler for alien messages received from device.- Parameters:
alienMessageListener
- here will be pushed all alien messages from switch
-
checkListeners
void checkListeners()Throws exception if any of required listeners is missing. -
fireConnectionReadyNotification
void fireConnectionReadyNotification()Notify listener about connection ready-to-use event. -
onSwitchCertificateIdentified
Notify listener about switch certificate information.- Parameters:
certificateChain
- X509 certificate chain presented by the switch
-
setConnectionReadyListener
Set listener for connection became ready-to-use event.- Parameters:
connectionReadyListener
- listens to connection ready event
-
setAutoRead
void setAutoRead(boolean autoRead) Sets option for automatic channel reading - if set to false, incoming messages won't be read.- Parameters:
autoRead
- target value to be switched to
-
isAutoRead
boolean isAutoRead()Determines if the channel is configured to auto-read.- Returns:
- true, if channel is configured to auto-read
-
registerOutboundQueueHandler
@Beta <T extends OutboundQueueHandler> OutboundQueueHandlerRegistration<T> registerOutboundQueueHandler(T handler, int maxQueueDepth, long maxBarrierNanos) Registers a new bypass outbound queue.- Type Parameters:
T
- handler type- Parameters:
handler
- queue handlermaxQueueDepth
- max amount of not confirmed messaged in queue (i.e. edge for barrier message)maxBarrierNanos
- regular base for barrier message- Returns:
- An
OutboundQueueHandlerRegistration
-
setPacketInFiltering
@Beta void setPacketInFiltering(boolean enabled) Set filtering of PacketIn messages. By default these messages are not filtered.- Parameters:
enabled
- True if PacketIn messages should be filtered, false if they should be reported.
-
setDatapathId
Set datapathId for the dpn.- Parameters:
datapathId
- of the dpn
-
setExecutorService
Sets executorService.- Parameters:
executorService
- for all dpns
-
barrier
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<BarrierOutput>> barrier(BarrierInput input) Invokebarrier
RPC. See alsoBarrier
.- Parameters:
input
- ofbarrier
- Returns:
- output of
barrier
-
echo
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoOutput>> echo(EchoInput input) Invokeecho
RPC. See alsoEcho
.- Parameters:
input
- ofecho
- Returns:
- output of
echo
-
echoReply
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<EchoReplyOutput>> echoReply(EchoReplyInput input) Invokeecho-reply
RPC. See alsoEchoReply
.- Parameters:
input
- ofecho-reply
- Returns:
- output of
echo-reply
-
experimenter
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<ExperimenterOutput>> experimenter(ExperimenterInput input) Invokeexperimenter
RPC. See alsoExperimenter
.- Parameters:
input
- ofexperimenter
- Returns:
- output of
experimenter
-
flowMod
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<FlowModOutput>> flowMod(FlowModInput input) Invokeflow-mod
RPC. See alsoFlowMod
.- Parameters:
input
- offlow-mod
- Returns:
- output of
flow-mod
-
getAsync
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetAsyncOutput>> getAsync(GetAsyncInput input) Invokeget-async
RPC. See alsoGetAsync
.- Parameters:
input
- ofget-async
- Returns:
- output of
get-async
-
getConfig
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetConfigOutput>> getConfig(GetConfigInput input) Invokeget-config
RPC. See alsoGetConfig
.- Parameters:
input
- ofget-config
- Returns:
- output of
get-config
-
getFeatures
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetFeaturesOutput>> getFeatures(GetFeaturesInput input) Invokeget-features
RPC. See alsoGetFeatures
.- Parameters:
input
- ofget-features
- Returns:
- output of
get-features
-
getQueueConfig
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GetQueueConfigOutput>> getQueueConfig(GetQueueConfigInput input) Invokeget-queue-config
RPC. See alsoGetQueueConfig
.- Parameters:
input
- ofget-queue-config
- Returns:
- output of
get-queue-config
-
groupMod
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<GroupModOutput>> groupMod(GroupModInput input) Invokegroup-mod
RPC. See alsoGroupMod
.- Parameters:
input
- ofgroup-mod
- Returns:
- output of
group-mod
-
hello
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<HelloOutput>> hello(HelloInput input) Invokehello
RPC. See alsoHello
.- Parameters:
input
- ofhello
- Returns:
- output of
hello
-
meterMod
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MeterModOutput>> meterMod(MeterModInput input) Invokemeter-mod
RPC. See alsoMeterMod
.- Parameters:
input
- ofmeter-mod
- Returns:
- output of
meter-mod
-
multipartRequest
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<MultipartRequestOutput>> multipartRequest(MultipartRequestInput input) Invokemultipart-request
RPC. See alsoMultipartRequest
.- Parameters:
input
- ofmultipart-request
- Returns:
- output of
multipart-request
-
packetOut
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PacketOutOutput>> packetOut(PacketOutInput input) Invokepacket-out
RPC. See alsoPacketOut
.- Parameters:
input
- ofpacket-out
- Returns:
- output of
packet-out
-
portMod
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<PortModOutput>> portMod(PortModInput input) Invokeport-mod
RPC. See alsoPortMod
.- Parameters:
input
- ofport-mod
- Returns:
- output of
port-mod
-
roleRequest
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<RoleRequestOutput>> roleRequest(RoleRequestInput input) Invokerole-request
RPC. See alsoRoleRequest
.- Parameters:
input
- ofrole-request
- Returns:
- output of
role-request
-
setAsync
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetAsyncOutput>> setAsync(SetAsyncInput input) Invokeset-async
RPC. See alsoSetAsync
.- Parameters:
input
- ofset-async
- Returns:
- output of
set-async
-
setConfig
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<SetConfigOutput>> setConfig(SetConfigInput input) Invokeset-config
RPC. See alsoSetConfig
.- Parameters:
input
- ofset-config
- Returns:
- output of
set-config
-
tableMod
@NonNull com.google.common.util.concurrent.ListenableFuture<org.opendaylight.yangtools.yang.common.RpcResult<TableModOutput>> tableMod(TableModInput input) Invoketable-mod
RPC. See alsoTableMod
.- Parameters:
input
- oftable-mod
- Returns:
- output of
table-mod
-