Class OutboundQueueProviderImpl
- All Implemented Interfaces:
OutboundQueue
,OutboundQueueHandler
,OutboundQueueProvider
-
Constructor Summary
ConstructorDescriptionOutboundQueueProviderImpl
(org.opendaylight.yangtools.yang.common.Uint8 ofVersion) -
Method Summary
Modifier and TypeMethodDescriptionvoid
commitEntry
(org.opendaylight.yangtools.yang.common.Uint32 xid, OfHeader message, com.google.common.util.concurrent.FutureCallback<OfHeader> callback) Commit the specified offset using a message.void
commitEntry
(org.opendaylight.yangtools.yang.common.Uint32 xid, OfHeader message, com.google.common.util.concurrent.FutureCallback<OfHeader> callback, Function<OfHeader, Boolean> isComplete) Commit the specified offset using a message.createBarrierRequest
(org.opendaylight.yangtools.yang.common.Uint32 xid) Create a newbarrier
message.void
Invoked whenever the underlying queue is refreshed.org.opendaylight.yangtools.yang.common.Uint32
Reserve an entry in the outbound queue.
-
Constructor Details
-
OutboundQueueProviderImpl
public OutboundQueueProviderImpl(org.opendaylight.yangtools.yang.common.Uint8 ofVersion)
-
-
Method Details
-
createBarrierRequest
Description copied from interface:OutboundQueueHandler
Create a newbarrier
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.- Specified by:
createBarrierRequest
in interfaceOutboundQueueHandler
- Parameters:
xid
- XID for the barrier message- Returns:
- New barrier message.
-
onConnectionQueueChanged
Description copied from interface:OutboundQueueHandler
Invoked whenever the underlying queue is refreshed. Implementations should ensure they are talking to the latest queue- Specified by:
onConnectionQueueChanged
in interfaceOutboundQueueHandler
- Parameters:
queue
- New queue instance, null indicates a shutdown, e.g. the queue is no longer available.
-
reserveEntry
public org.opendaylight.yangtools.yang.common.Uint32 reserveEntry()Description copied from interface:OutboundQueue
Reserve an entry in the outbound queue.- Specified by:
reserveEntry
in interfaceOutboundQueue
- Returns:
- XID for the new message, or null if the queue is full
-
commitEntry
public void commitEntry(org.opendaylight.yangtools.yang.common.Uint32 xid, OfHeader message, com.google.common.util.concurrent.FutureCallback<OfHeader> callback) Description copied from interface:OutboundQueue
Commit the specified offset using a message. Specified callback will be invoked once we know how it has resolved, either with a normal response, implied completion via a barrier, or failure (such as connection drop). For multipart responses,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 ofDeviceRequestFailedException
.If the request fails due to local reasons,
FutureCallback.onFailure(Throwable)
will be called with an instance ofOutboundQueueException
. In particular, if this request failed because the device disconnected,OutboundQueueException.DEVICE_DISCONNECTED
will be reported.- Specified by:
commitEntry
in interfaceOutboundQueue
- Parameters:
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.
-
commitEntry
public void commitEntry(org.opendaylight.yangtools.yang.common.Uint32 xid, OfHeader message, com.google.common.util.concurrent.FutureCallback<OfHeader> callback, Function<OfHeader, Boolean> isComplete) Description copied from interface:OutboundQueue
Commit the specified offset using a message. Specified callback will be invoked once we know how it has resolved, either with a normal response, implied completion via a barrier, or failure (such as connection drop). For multipart responses,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 ofDeviceRequestFailedException
.If the request fails due to local reasons,
FutureCallback.onFailure(Throwable)
will be called with an instance ofOutboundQueueException
. In particular, if this request failed because the device disconnected,OutboundQueueException.DEVICE_DISCONNECTED
will be reported.- Specified by:
commitEntry
in interfaceOutboundQueue
- Parameters:
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 complete
-