public static interface DOFObject.Provider extends DOFOperation.OperationListener
DOFObject.invoke(org.opendof.core.oal.DOFInterface.Method, java.util.List<org.opendof.core.oal.DOFValue>, int)
, the provider's invoke(org.opendof.core.oal.DOFOperation.Provide, org.opendof.core.oal.DOFRequest.Invoke, org.opendof.core.oal.DOFInterface.Method, java.util.List<org.opendof.core.oal.DOFValue>)
method is called
so that it can execute the method and respond to the requestor.Modifier and Type | Method and Description |
---|---|
void |
get(DOFOperation.Provide operation,
DOFRequest.Get request,
DOFInterface.Property property)
Process a get request.
|
void |
invoke(DOFOperation.Provide operation,
DOFRequest.Invoke request,
DOFInterface.Method method,
java.util.List<DOFValue> parameters)
Process an invoke request.
|
void |
register(DOFOperation.Provide operation,
DOFRequest.Register request,
DOFInterface.Event event)
Process a register request.
|
void |
registerComplete(DOFOperation.Provide operation,
DOFRequest.Register request,
DOFInterface.Event event)
Called when an event handler is unregistered.
|
void |
session(DOFOperation.Provide operation,
DOFRequest.Session request,
DOFObject object,
DOFInterfaceID interfaceID,
DOFObjectID sessionID,
DOFInterfaceID sessionType)
A new session is requested.
|
void |
sessionComplete(DOFOperation.Provide operation,
DOFRequest.Session request,
DOFObject object,
DOFInterfaceID interfaceID,
DOFObjectID sessionID,
DOFInterfaceID sessionType)
Session is complete and can be removed.
|
void |
set(DOFOperation.Provide operation,
DOFRequest.Set request,
DOFInterface.Property property,
DOFValue value)
Process a set request.
|
void |
subscribe(DOFOperation.Provide operation,
DOFRequest.Subscribe request,
DOFInterface.Property property,
int minPeriod)
Process a subscribe request.
|
void |
subscribeComplete(DOFOperation.Provide operation,
DOFRequest.Subscribe request,
DOFInterface.Property property)
Called when a property subscription is complete (it is unsubscribed
from).
|
complete
void get(DOFOperation.Provide operation, DOFRequest.Get request, DOFInterface.Property property)
DOFOperation.Get
or a
DOFOperation.Subscribe
. If called from Subscribe, request
will be a
DOFRequest.SubscribeGet
, and any DOFProviderException thrown will be converted to a
DOFErrorException
(DOFErrorException.APPLICATION_ERROR
).
NOTE: You MUST call one of the DOFRequest.Get.respond(org.opendof.core.oal.DOFValue)
methods when
you have finished processing the request. The request is kept in a "pending" status until one of these calls
is made. This means that you may spawn a thread which could finish processing this request after returning
from this method.operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the request. This will never be null. Call one of the
DOFRequest.Get.respond(org.opendof.core.oal.DOFValue)
methods to return results or to throw exceptions.
DOFProviderException should be thrown for any error condition that is defined as an
exception in the DOFInterface.
DOFErrorException should be thrown for any error condition that falls outside of the
exceptions defined in the DOFInterface.property
- The property on which the 'Get' was requested. This will never be null.DOFRequest.Get.respond(DOFValue)
,
DOFRequest.Get.respond(DOFProviderException)
,
DOFRequest.Get.respond(DOFErrorException)
,
DOFObject.GetOperationListener
,
DOFOperation
void set(DOFOperation.Provide operation, DOFRequest.Set request, DOFInterface.Property property, DOFValue value)
DOFObject.changed(DOFInterface.Property)
to update subscriptions.
The library does this automatically.
NOTE: You MUST call one of the DOFRequest.Set.respond()
methods when you
have finished processing the request. The request is kept in a "pending" status until one of these calls is
made. This means that you may spawn a thread which could finish processing this request after returning from
this method.operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the request. This will never be null. Call one of the
DOFRequest.Get.respond(org.opendof.core.oal.DOFValue)
methods to indicate 'Set' complete or to throw exceptions.
DOFProviderException should be thrown for any error condition that is defined as an
exception in the DOFInterface.
DOFErrorException should be thrown for any error condition that falls outside of the
exceptions defined in the DOFInterface.property
- The property on which the 'Set' was requested. This will never be null.value
- The value to assign to the property. This will never be null.DOFRequest.Set.respond()
,
DOFRequest.Set.respond(DOFProviderException)
,
DOFRequest.Set.respond(DOFErrorException)
,
DOFObject.SetOperationListener
,
DOFOperation
void invoke(DOFOperation.Provide operation, DOFRequest.Invoke request, DOFInterface.Method method, java.util.List<DOFValue> parameters)
DOFRequest.Invoke.respond(org.opendof.core.oal.DOFValue...)
methods when
you have finished processing the request. The request is kept in a "pending" status until one of these
calls is made. This means that you may spawn a thread which could finish processing this request after
returning from this method.operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the request. This will never be null. Call one of the
DOFRequest.Get.respond(org.opendof.core.oal.DOFValue)
methods to return results or to throw exceptions.
DOFProviderException should be thrown for any error condition that is defined as an
exception in the DOFInterface.
DOFErrorException should be thrown for any error condition that falls outside of the
exceptions defined in the DOFInterface.method
- The method being invoked. This will never be null.parameters
- The method's parameter list. This will never be null.DOFRequest.Invoke.respond(DOFValue...)
,
DOFRequest.Invoke.respond(java.util.List)
,
DOFRequest.Invoke.respond(DOFProviderException)
,
DOFRequest.Invoke.respond(DOFErrorException)
,
DOFObject.InvokeOperationListener
,
DOFOperation
void subscribe(DOFOperation.Provide operation, DOFRequest.Subscribe request, DOFInterface.Property property, int minPeriod)
DOFRequest.Subscribe.respond()
methods when
you have finished processing the request. The request is kept in a "pending" status until one of these calls
is made. This means that you may spawn a thread which could finish processing this request after returning
from this method.operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the subscribe request. This will never be null. Use this to return, indicating that the 'subscribe' is accepted
(use request.respond()
) or to throw exceptions (use
request.respond(...)
).
DOFErrorException should be thrown for any error condition that falls outside of the
exceptions defined in the DOFInterface, the subscribe is not supported for the property, or the
minPeriod is unacceptable.property
- The property being subscribed to. This will never be null.minPeriod
- The minimum time, in milliseconds, that should elapse between property update notifications.DOFRequest.Subscribe.respond(DOFErrorException)
,
DOFSubscription.Listener
,
DOFOperation
void subscribeComplete(DOFOperation.Provide operation, DOFRequest.Subscribe request, DOFInterface.Property property)
operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the subscribe request. This will never be null.property
- The property being unsubscribed from. This will never be null.void register(DOFOperation.Provide operation, DOFRequest.Register request, DOFInterface.Event event)
DOFRequest.Set.respond()
methods when
you have finished processing the request. The request is kept in a "pending" status until one of these calls
is made. This means that you may spawn a thread which could finish processing this request after returning
from this method.operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the register request. This will never be null. Use this to return, indicating that the 'register' is accepted
(use request.respond()
) or to throw exceptions (use
request.respond(...)
).
DOFErrorException should be thrown for any error condition that falls outside of the
exceptions defined in the DOFInterface, or the register is not supported for the event.event
- The event that a handler is being registered on. This will never be null.DOFRegistration.Listener
,
DOFOperation
void registerComplete(DOFOperation.Provide operation, DOFRequest.Register request, DOFInterface.Event event)
operation
- Information about the corresponding provide operation. This will never be null.request
- information about the register request. This will never be null.event
- The event associated with the handler which has been unregistered. This will never be null.void session(DOFOperation.Provide operation, DOFRequest.Session request, DOFObject object, DOFInterfaceID interfaceID, DOFObjectID sessionID, DOFInterfaceID sessionType)
DOFRequest.Session.respond()
methods when
you have finished processing the request. The request is kept in a "pending" status until one of these calls
is made. This means that you may spawn a thread which could finish processing this request after returning
from this method.operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the request. This will never be null. Use this to Use this to return, indicating that the
Session has been initiated (use request.respond()
) or to throw exceptions (use
request.respond(...)
).
DOFProviderException should be thrown for any error condition that is defined as an
exception in the DOFInterface.
DOFErrorException should be thrown for any error condition that falls outside of the
exceptions defined in the DOFInterface.object
- The object the session is being requested on. This will never be null.interfaceID
- Any interfaceID that the specific provider must be currently providing in order to receive this request. This will never be null.sessionID
- The session object identifier. This uniquely identifies the session and includes a Session Attribute chosen by the requestor.
A DOFObject may be created directly from this id to provide interfaces on the session. This will never be null.sessionType
- The requested session type (a DOFInterfaceID
), defining the purpose and contract for the session. This interface should typically be provided on the session
(possibly in addition to others), but no specific behavior is required. This will never be null.DOFRequest.Session.respond(DOFErrorException)
,
DOFObject.SessionOperationListener
,
DOFOperation
void sessionComplete(DOFOperation.Provide operation, DOFRequest.Session request, DOFObject object, DOFInterfaceID interfaceID, DOFObjectID sessionID, DOFInterfaceID sessionType)
operation
- Information about the corresponding provide operation. This will never be null.request
- Information about the request. This will never be null.object
- The object the session was requested on. This will never be null.interfaceID
- The interfaceID the session was requested on. This will never be null.sessionID
- The session object identifier. This will never be null.sessionType
- The session type. This will never be null.