public class OutboundQueueProviderImpl extends Object implements OutboundQueueProvider
Constructor and Description |
---|
OutboundQueueProviderImpl(short ofVersion) |
Modifier and Type | Method and Description |
---|---|
void |
commitEntry(Long xid,
OfHeader message,
com.google.common.util.concurrent.FutureCallback<OfHeader> callback)
Commit the specified offset using a message.
|
void |
commitEntry(Long xid,
OfHeader message,
com.google.common.util.concurrent.FutureCallback<OfHeader> callback,
Function<OfHeader,Boolean> isComplete)
Commit the specified offset using a message.
|
BarrierInput |
createBarrierRequest(Long xid)
Create a new
barrier message. |
void |
onConnectionQueueChanged(OutboundQueue queue)
Invoked whenever the underlying queue is refreshed.
|
Long |
reserveEntry()
Reserve an entry in the outbound queue.
|
@Nonnull public BarrierInput createBarrierRequest(@Nonnull Long xid)
OutboundQueueHandler
barrier
message. This callback is invoked
when the queue is being flushed to the switch. The barrier ensures that any
outstanding requests are detected as either completed or failed.createBarrierRequest
in interface OutboundQueueHandler
xid
- XID for the barrier messagepublic void onConnectionQueueChanged(OutboundQueue queue)
OutboundQueueHandler
onConnectionQueueChanged
in interface OutboundQueueHandler
queue
- New queue instance, null indicates a shutdown, e.g. the queue
is no longer available.public Long reserveEntry()
OutboundQueue
reserveEntry
in interface OutboundQueue
public void commitEntry(Long xid, OfHeader message, com.google.common.util.concurrent.FutureCallback<OfHeader> callback)
OutboundQueue
FutureCallback.onSuccess(Object)
will be invoked
multiple times as the corresponding responses arrive. If the request is completed
with a response, the object reported will be non-null. If the request's completion
is implied by a barrier, the object reported will be null.
If this request fails on the remote device, FutureCallback.onFailure(Throwable)
will be called with an instance of DeviceRequestFailedException
.
If the request fails due to local reasons, FutureCallback.onFailure(Throwable)
will be called with an instance of OutboundQueueException
. In particular, if
this request failed because the device disconnected, OutboundQueueException.DEVICE_DISCONNECTED
will be reported.
commitEntry
in interface OutboundQueue
xid
- Previously-reserved XIDmessage
- Message which should be sent out, or null if the reservation
should be cancelled.callback
- Callback to be invoked, or null if no callback should be invoked.public void commitEntry(Long xid, OfHeader message, com.google.common.util.concurrent.FutureCallback<OfHeader> callback, Function<OfHeader,Boolean> isComplete)
OutboundQueue
FutureCallback.onSuccess(Object)
will be invoked
multiple times as the corresponding responses arrive. If the request is completed
with a response, the object reported will be non-null. If the request's completion
is implied by a barrier, the object reported will be null.
If this request fails on the remote device, FutureCallback.onFailure(Throwable)
will be called with an instance of DeviceRequestFailedException
.
If the request fails due to local reasons, FutureCallback.onFailure(Throwable)
will be called with an instance of OutboundQueueException
. In particular, if
this request failed because the device disconnected, OutboundQueueException.DEVICE_DISCONNECTED
will be reported.
commitEntry
in interface OutboundQueue
xid
- Previously-reserved XIDmessage
- Message which should be sent out, or null if the reservation
should be cancelled.callback
- Callback to be invoked, or null if no callback should be invoked.isComplete
- Function to determine if OfHeader is processing is completeCopyright © 2020 OpenDaylight. All rights reserved.