Package com.boomi.connector.api
Interface Operation
-
- All Known Implementing Classes:
BadInputStreamSampleOperation
,BaseDeleteOperation
,BaseGetOperation
,BaseOperation
,BaseQueryOperation
,BaseUpdateOperation
,CustomJsonRequestOperation
,CustomJsonResponseOperation
,DirectInputStreamSampleOperation
,ImportableFieldsOperation
,OpenAPIDslOperation
,OpenAPIOperation
,OutputStreamSampleOperation
,OverrideableFieldOperation
,RestOperation
,SizeBasedRoutingOperation
,SizeLimitedBatchJsonOperation
,SizeLimitedJsonOperation
,SizeLimitedUpdateOperation
,SplitJsonResponseOperation
,WSExecuteOperation
public interface Operation
An Operation is used to run an actual connector operation on a service. The execution of the get/query implementations should not modify any data within the service (they should be repeatable/cacheable operations).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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
execute(OperationRequest request, OperationResponse response)
Executes an operation with the given request, passing results to the given response.
-
-
-
Method Detail
-
execute
void execute(OperationRequest request, OperationResponse response)
Executes an operation with the given request, passing results to the given 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 theResponseUtil
utility:- Single Input(TrackedData) -> Single Output(Payload) - the common scenario where each input results in
a single output. Each input TrackedData will be passed to the response with the relevant output using
OperationResponse.addResult(com.boomi.connector.api.TrackedData, com.boomi.connector.api.OperationStatus, java.lang.String, java.lang.String, com.boomi.connector.api.Payload)
. - Multiple Inputs(TrackedData) -> Single Output(Payload) - this scenario generally results from
operations which take batches of input and return a single result status. Since multiple inputs are responsible
for the single output, they should all be passed together to the response with the relevant output using
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)
. - Single Input(TrackedData) -> Multiple Outputs(Payload) - this scenario generally results from query
type operations where a single query returns many results. Since the same input is responsible for many outputs,
the outputs should be passed to the response as a "partial" result using
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" usingOperationResponse.finishPartialResult(com.boomi.connector.api.TrackedData)
. - Single/Multiple Inputs(TrackedData) -> No Output(Payload) - this scenario may result from operations
which return no response, such as a GET request with an id for which no object exists. Each input TrackedData
should be passed to the response using
OperationResponse.addEmptyResult(com.boomi.connector.api.TrackedData, com.boomi.connector.api.OperationStatus, java.lang.String, java.lang.String)
.
- Parameters:
request
- the current request for this operation. this object should be downcast to the request type for the relevant operation, one ofGetRequest
,DeleteRequest
,QueryRequest
orUpdateRequest
(for CREATE,UPDATE, and UPSERT operations).response
- object which should be updated with the results of this operation (see comments above).
- Single Input(TrackedData) -> Single Output(Payload) - the common scenario where each input results in
a single output. Each input TrackedData will be passed to the response with the relevant output using
-
-