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.
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.
|
String |
problemString()
Returns a string description of the problem if there was one.
|
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 |
setFailureTimeout()
Marks this future as a failure, caused by a timeout, 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.
String problemString()
OfmError
reply from
the switch, or the exception thrown (if the send failed), if the future
was satisfied as a failure; otherwise it will be the string
"(none)"
.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 failure; 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 failure;
false
otherwiseIllegalArgumentException
- if the error message is mutableboolean setFailure(Throwable cause)
true
is returned if this future is
successfully marked as a failure; 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 failure;
false
otherwiseboolean setFailureTimeout()
true
is returned if this future is successfully
marked as a failure; false
is returned if this future was
already marked as either success or failure.true
if successfully marked as a failure;
false
otherwiseMessageFuture await() throws InterruptedException
InterruptedException
- if the current thread was interruptedMessageFuture awaitUninterruptibly()
InterruptedException
s 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 InterruptedException
s and discards them silently.timeoutMs
- timeout expressed in millisecondstrue
if the future was completed within the specified
time limit; false
otherwiseCopyright © 2015. All Rights Reserved.