public abstract class BaseOperation extends ContextualOperation implements Operation
Operation
. Stores the OperationContext for later access during the
operation execution.Modifier | Constructor and Description |
---|---|
protected |
BaseOperation(BaseConnection conn) |
protected |
BaseOperation(OperationContext context) |
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.
|
getConnection, getContext
protected BaseOperation(OperationContext context)
protected BaseOperation(BaseConnection conn)
public void execute(OperationRequest request, OperationResponse response)
Operation
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)
.execute
in interface Operation
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).