public interface DOFOperation
DOFOperation.Get
, DOFOperation.Set
, DOFOperation.Invoke
, DOFOperation.Session
, DOFOperation.Subscribe
, and DOFOperation.Register
.
They all can result in a DOFErrorException
and the first 4 can also result in a DOFProviderException
.
The following describes where these exceptions are passed back to the requestor.
DOFObject.get(org.opendof.core.oal.DOFInterface.Property, int)
DOFObject.beginGet(org.opendof.core.oal.DOFInterface.Property, int)
, then block with DOFOperation.Get.waitResult(int)
DOFObject.beginGet(org.opendof.core.oal.DOFInterface.Property, int)
, then wait for DOFObject.GetOperationListener.getResult(org.opendof.core.oal.DOFOperation.Get, org.opendof.core.oal.DOFProviderInfo, org.opendof.core.oal.DOFValue, org.opendof.core.oal.DOFException)
to be calledDOFOperation.Session.waitSession(int)
(blocking asynchronous).DOFSubscription.Listener
(non-blocking asynchronous).DOFObject.beginGet(org.opendof.core.oal.DOFInterface.Property, int)
,
DOFObject.beginSet(org.opendof.core.oal.DOFInterface.Property, org.opendof.core.oal.DOFValue, int)
,
DOFObject.beginInvoke(org.opendof.core.oal.DOFInterface.Method, int, org.opendof.core.oal.DOFValue...)
,
DOFObject.beginSession(org.opendof.core.oal.DOFInterface, org.opendof.core.oal.DOFInterfaceID)
,
DOFObject.beginProvide(org.opendof.core.oal.DOFInterface, org.opendof.core.oal.DOFObject.Provider)
,
DOFSystem.beginInterest(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterestLevel)
,
DOFSystem.beginQuery(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterfaceID, org.opendof.core.oal.DOFSystem.QueryOperationListener)
,
DOFSystem.createSubscription(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterface.Property, int, org.opendof.core.oal.DOFSubscription.Listener, java.lang.Object)
,
DOFSystem.createRegistration(org.opendof.core.oal.DOFObjectID, org.opendof.core.oal.DOFInterface.Event, org.opendof.core.oal.DOFRegistration.Listener, java.lang.Object)
,
DOFErrorException
,
DOFProviderException
Modifier and Type | Interface and Description |
---|---|
static interface |
DOFOperation.Advertise
Extends DOFOperation with capabilities and data specific to an Advertise operation.
|
static class |
DOFOperation.Bridge
A Bridge allows incoming operations on a connection or server to 'bridge' into a new security scope.
|
static interface |
DOFOperation.Connect
Extends DOFOperation with capabilities and data specific to a opening a DOFConnection.
|
static class |
DOFOperation.Control
The Control class is used with DOFRequestors for controlling the behavior of request operations.
|
static interface |
DOFOperation.Define
Extends DOFOperation with capabilities and data specific to a Define operation.
|
static class |
DOFOperation.Filter
The Filter class provides a way for applications to specify the type of traffic
that can be sent or received on connections, servers, and systems.
|
static interface |
DOFOperation.Get
Extends DOFOperation with capabilities and data specific to a Get operation.
|
static interface |
DOFOperation.Interest
Extends DOFOperation with capabilities and data specific to an Interest operation.
|
static interface |
DOFOperation.Invoke
Extends DOFOperation with capabilities and data specific to an Invoke operation.
|
static interface |
DOFOperation.OperationListener
Base interface for listening to operations.
|
static interface |
DOFOperation.Provide
Extends DOFOperation with capabilities and data specific to a Provide operation.
|
static interface |
DOFOperation.Query
Extends DOFOperation with capabilities and data specific to a Query operation.
|
static interface |
DOFOperation.Register
Extends DOFOperation with capabilities and data specific to a Register operation.
|
static class |
DOFOperation.ResponseLevel
ResponseLevel specifies the level of responses resulting from a request.
|
static interface |
DOFOperation.RetryTime
RetryTime is used to determine when to send the next retry.
|
static interface |
DOFOperation.Session
Extends DOFOperation with capabilities and data specific to a Session operation.
|
static interface |
DOFOperation.Set
Extends DOFOperation with capabilities and data specific to a Set operation.
|
static interface |
DOFOperation.Start
Extends DOFOperation with capabilities and data specific to a starting a DOFServer.
|
static interface |
DOFOperation.Subscribe
Extends DOFOperation with capabilities and data specific to a Subscribe operation.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the operation.
|
void |
checkException()
If this operation has resulted in any exception(s), checkException() will
throw the first exception (since multiple exceptions are possible for some operations),
otherwise, it will return immediately.
|
void |
extend()
Extend the operation.
|
java.lang.Object |
getContext()
Get the operation context.
|
DOFException |
getException()
Return an exception, if any, associated with this operation as a response.
|
int |
getTimeRemaining()
Get the operation time remaining.
|
boolean |
isAcknowledged()
Return whether or not the operation has been acknowledged.
|
boolean |
isCancelled() |
boolean |
isComplete()
Is the operation complete.
|
void |
retry()
Retry the operation.
|
void |
setTimeout(int delay)
Set a new timeout value for the operation.
|
void |
waitAcknowledged(int timeout)
Block the current thread until the operation is acknowledged or has
completed, or until the specified timeout expires.
|
void |
waitComplete()
Block the current thread until the operation has completed.
|
void |
waitComplete(int timeout)
Block the current thread until the operation has completed, or until the
specified timeout expires.
|
void checkException() throws DOFException
DOFException
- if this operation has resulted in any exception(s)DOFException getException()
void cancel()
setTimeout(int)
void waitComplete(int timeout) throws DOFException
DOF.TIMEOUT_NEVER
to use on the operation's timeout value as the maximum wait time. Do not use the same
value as the operation's timeout, since this introduces a race condition.timeout
- Maximum time to wait, in milliseconds, for the operation to complete. Must be > = 0.
DOF.TIMEOUT_NEVER
to block until the
operation completes (when an operation times out, it has completed) without introducing this race
condition.DOFException
- if this operation resulted in an exception.void waitComplete()
void waitAcknowledged(int timeout) throws DOFException
DOF.TIMEOUT_NEVER
to use on the
operation's timeout value as the maximum wait time. Do not use the same
value as the operation's timeout, since this introduces a race condition.
An operation becomes acknowledged when the first response is received.
NOTE: Some operations never receive any responses, so they are never
acknowledged. Examples: beginProvide, beginInterest, and beginQuery.timeout
- Maximum time to wait, in milliseconds, for the operation to be
acknowledged. Must be > = 0. DOF.TIMEOUT_NEVER
to use on the operation's
timeout value as the maximum wait time.DOFException
- if this operation resulted in an exception.void setTimeout(int delay)
DOFOperation.OperationListener.complete(org.opendof.core.oal.DOFOperation, org.opendof.core.oal.DOFException)
to extend the operation. Whether
this is possible or not depends on the specific operation and the state of the system.
delay
- Number of milliseconds from now when the operation should complete. Must be >= 0.
If this parameter is zero then the operation will be cancelled. If it
is positive then the new timeout will be set.cancel()
void retry()
void extend()
int getTimeRemaining()
java.lang.Object getContext()
boolean isAcknowledged()
DOFOperation.OperationListener
-derivative method, it is guaranteed to
be called (at least once) before the operation's state is set to
acknowledged.
NOTE: Some operations never receive any responses, so they are never
acknowledged. Examples: beginProvide, beginInterest, and beginQuery.boolean isComplete()
boolean isCancelled()