public interface MessageFuture
Services can choose to return pending OpenFlow message results in the form
of message futures. Clients can use these to wait for the results using
various forms of the await methods and then query the future to
determine success or failure.
TODO: elaborate, more docs: cf netty ChannelFuture
MessageFutureBag| Modifier and Type | Interface and Description |
|---|---|
static class |
MessageFuture.Result
Denotes the different states that a message future can be in.
|
| Modifier and Type | Method and Description |
|---|---|
MessageFuture |
await()
Waits for this future to be completed.
|
boolean |
await(long timeoutMs)
Waits for this future to be completed within the specified time limit.
|
MessageFuture |
awaitUninterruptibly()
Waits for this future to be completed without interruption.
|
boolean |
awaitUninterruptibly(long timeoutMs)
Waits for this future to be completed within the specified time limit
without interruption.
|
Throwable |
cause()
Returns the cause of failure if an exception was thrown.
|
OpenflowMessage |
reply()
Returns the reply resulting from the asynchronous request.
|
OpenflowMessage |
request()
Returns the original request message.
|
MessageFuture.Result |
result()
Returns the future's result.
|
boolean |
setFailure(OfmError error)
Marks this future as a failure, attaching the specified error response
message, and notifies all listeners.
|
boolean |
setFailure(Throwable cause)
Marks this future as a failure, caused by the specified exception,
and notifies all listeners.
|
boolean |
setSuccess()
Marks this future as a success (with no expected reply) and notifies
all listeners.
|
boolean |
setSuccess(OpenflowMessage msg)
Marks this future as a success, attaching the specified reply message,
and notifies all listeners.
|
long |
xid()
Returns the xid (message sequence number) associated with this future.
|
long xid()
OpenflowMessage request()
OpenflowMessage reply()
OfmError message.
This will be null if the future has not yet been satisfied.
Throwable cause()
MessageFuture.Result result()
boolean setSuccess()
true is returned if this future is successfully
marked as a success; false is returned if this future was
already marked as either success or failure.true if successfully marked as a success;
false otherwiseboolean setSuccess(OpenflowMessage msg)
true is returned if this future is
successfully marked as a success; false is returned if this
future was already marked as either success or failure.msg - the OpenFlow message reply to the original requesttrue if successfully marked as a success;
false otherwiseIllegalArgumentException - if the message is mutableboolean setFailure(OfmError error)
true is returned if this
future is successfully marked as a success; false is returned
if this future was already marked as either success or failure.error - the OpenFlow error message resulting from the original
requesttrue if successfully marked as a success;
false otherwiseIllegalArgumentException - if the error message is mutableboolean setFailure(Throwable cause)
true is returned if this future is
successfully marked as a success; false is returned if this
future was already marked as either success or failure.cause - the cause of the failuretrue if successfully marked as a success;
false otherwiseMessageFuture await() throws InterruptedException
InterruptedException - if the current thread was interruptedMessageFuture awaitUninterruptibly()
InterruptedExceptions and discards them silently.boolean await(long timeoutMs)
throws InterruptedException
true is returned
if the future was satisfied within the time limit; false is
returned if the timeout expired.timeoutMs - timeout expressed in millisecondstrue if the future was completed within the specified
time limit; false otherwiseInterruptedException - if the current thread was interruptedboolean awaitUninterruptibly(long timeoutMs)
true is returned if the future was satisfied within the time
limit; false is returned if the timeout expired. This method
catches InterruptedExceptions and discards them silently.timeoutMs - timeout expressed in millisecondstrue if the future was completed within the specified
time limit; false otherwiseCopyright © 2014. All Rights Reserved.