public interface Operation
Operation implementations need not be thread-safe. However, multiple instances may be in use simultaneously within the same Atom, so any static data should be managed in a thread-safe manner.
Modifier and Type | Method and Description |
---|---|
void |
execute(OperationRequest request,
OperationResponse response)
Executes an operation with the given request, passing results to the given response.
|
void execute(OperationRequest request, OperationResponse response)
Any TrackedData
received as part of a request should eventually be passed into the response. Any data
not passed along will be marked as "failed" by the atom (thus, any thrown exceptions will cause all outstanding
data to be marked as "failed"). There are 4 scenarios for input/output relationships, each of which can be
handled conveniently via the ResponseUtil
utility:
OperationResponse.addResult(com.boomi.connector.api.TrackedData, com.boomi.connector.api.OperationStatus, java.lang.String, java.lang.String, com.boomi.connector.api.Payload)
.OperationResponse.addCombinedResult(java.lang.Iterable<? extends com.boomi.connector.api.TrackedData>, com.boomi.connector.api.OperationStatus, java.lang.String, java.lang.String, com.boomi.connector.api.Payload)
.OperationResponse.addPartialResult(com.boomi.connector.api.TrackedData, com.boomi.connector.api.OperationStatus, java.lang.String, java.lang.String, com.boomi.connector.api.Payload)
until all results have been processed, at which point the input
should be passed to the response as "finished" using OperationResponse.finishPartialResult(com.boomi.connector.api.TrackedData)
.OperationResponse.addEmptyResult(com.boomi.connector.api.TrackedData, com.boomi.connector.api.OperationStatus, java.lang.String, java.lang.String)
.request
- the current request for this operation. this object should be downcast to the request type for
the relevant operation, one of GetRequest
, DeleteRequest
, QueryRequest
or UpdateRequest
(for CREATE,UPDATE, and UPSERT operations).response
- object which should be updated with the results of this operation (see comments above).