public class MessageBatchFuture extends DataPathMessageFuture
future
for a batch of flow-mod messages sent to
a specific datapath. Instances are created with the static method:
List<OfmFlowMod> flows = ...; DataPathId dpid = ...; MessageBatchFuture batchFuture = MessageBatchFuture.createBatchFuture(flows, dpid);A barrier request is generated on the caller's behalf and assigned as the principal message. Waiting on the batchFuture is the same as waiting on the future for the barrier request. Once it is satisfied (and the waiter unblocked), the result for the batch will reflect the aggregate state of all messages associated with the batch.
MessageFuture.Result
cause, reply, request, xid
Modifier and Type | Method and Description |
---|---|
static MessageBatchFuture |
createBatchFuture(List<OfmFlowMod> flows,
DataPathId dpid)
Creates and returns a message batch future for the given messages
destined for the specified datapath.
|
List<DataPathMessageFuture> |
getFailedFutures()
Returns the futures for the flow mods that failed.
|
List<DataPathMessageFuture> |
getFlowFutures()
Returns the futures for the flow mods associated with this batch.
|
List<String> |
reconcileFlowFutures()
Invoked by the caller once they have confirmation that the barrier
request has been satisfied with a barrier response.
|
MessageFuture.Result |
result()
Returns the future's result.
|
protected void |
satisfied()
Invoked when the future is satisfied.
|
String |
toDebugString()
Returns a multi-line string representation of this batch of
futures.
|
String |
toString() |
dpid
await, await, awaitUninterruptibly, awaitUninterruptibly, cause, problemString, reply, request, setFailure, setFailure, setFailureTimeout, setSuccess, setSuccess, xid
public MessageFuture.Result result()
MessageFuture
result
in interface MessageFuture
result
in class DefaultMessageFuture
protected void satisfied()
DefaultMessageFuture
satisfied
in class DefaultMessageFuture
public String toString()
toString
in class DefaultMessageFuture
public List<DataPathMessageFuture> getFlowFutures()
public List<DataPathMessageFuture> getFailedFutures()
public String toDebugString()
public List<String> reconcileFlowFutures()
This method processes the flow-mod futures and generates an error string (suitable for logging) for each failed future. If all went well, an empty list will be returned, indicating no errors.
This method also sets the aggregate result for the batch.
public static MessageBatchFuture createBatchFuture(List<OfmFlowMod> flows, DataPathId dpid)
flows
- the batch of flows to senddpid
- the target datapathNullPointerException
- if either parameter is nullIllegalArgumentException
- if flows list is emptyCopyright © 2015. All Rights Reserved.