public class DefaultMessageFuture extends Object implements MessageFuture
MessageFuture.MessageFuture.Result| Constructor and Description |
|---|
DefaultMessageFuture(OpenflowMessage request)
Constructs a default message future for the given request.
|
| 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.
|
String |
toString() |
long |
xid()
Returns the xid (message sequence number) associated with this future.
|
public DefaultMessageFuture(OpenflowMessage request)
request - the out-bound request associated with this futureIllegalArgumentException - if the xid is 0 or negativepublic long xid()
MessageFuturexid in interface MessageFuturepublic OpenflowMessage request()
MessageFuturerequest in interface MessageFuturepublic OpenflowMessage reply()
MessageFutureOfmError message.
This will be null if the future has not yet been satisfied.
reply in interface MessageFuturepublic Throwable cause()
MessageFuturecause in interface MessageFuturepublic MessageFuture.Result result()
MessageFutureresult in interface MessageFuturepublic boolean setSuccess()
MessageFuturetrue 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.setSuccess in interface MessageFuturetrue if successfully marked as a success;
false otherwisepublic boolean setSuccess(OpenflowMessage msg)
MessageFuturetrue 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.setSuccess in interface MessageFuturemsg - the OpenFlow message reply to the original requesttrue if successfully marked as a success;
false otherwisepublic boolean setFailure(OfmError error)
MessageFuturetrue 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.setFailure in interface MessageFutureerror - the OpenFlow error message resulting from the original
requesttrue if successfully marked as a success;
false otherwisepublic boolean setFailure(Throwable cause)
MessageFuturetrue 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.setFailure in interface MessageFuturecause - the cause of the failuretrue if successfully marked as a success;
false otherwisepublic MessageFuture await() throws InterruptedException
MessageFutureawait in interface MessageFutureInterruptedException - if the current thread was interruptedpublic MessageFuture awaitUninterruptibly()
MessageFutureInterruptedExceptions and discards them silently.awaitUninterruptibly in interface MessageFuturepublic boolean await(long timeoutMs)
throws InterruptedException
MessageFuturetrue is returned
if the future was satisfied within the time limit; false is
returned if the timeout expired.await in interface MessageFuturetimeoutMs - timeout expressed in millisecondstrue if the future was completed within the specified
time limit; false otherwiseInterruptedException - if the current thread was interruptedpublic boolean awaitUninterruptibly(long timeoutMs)
MessageFuturetrue 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.awaitUninterruptibly in interface MessageFuturetimeoutMs - timeout expressed in millisecondstrue if the future was completed within the specified
time limit; false otherwiseCopyright © 2014. All Rights Reserved.