T
- type of object a success response is represented aspublic interface HttpOperation<T>
execute()
.
Specifying a success-handler via the onSuccess(Consumer)
method is optional.
Specifying an error-handling strategy is also optional, but any error represented
by HttpOperationErrorType
would throw a RollbackException
.
You can specify error-handling via the onError(Consumer)
method.
To ignore errors, use ignoreError()
.
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes the HTTP operation.
|
HttpOperation<T> |
ignoreError()
When specified, any error specified by
HttpOperationErrorType is ignored during HTTP request execution. |
HttpOperation<T> |
onError(Consumer<HttpOperationError> errorHandler)
A function called when an HTTP request execution has failed with one of the
HttpOperationErrorType errors. |
HttpOperation<T> |
onSuccess(Consumer<HttpResponse<T>> successHandler)
A function called when HTTP request execution has completed successfully with an HTTP response status code of 200.
|
HttpOperation<T> onSuccess(Consumer<HttpResponse<T>> successHandler)
successHandler
- function to call during executionHttpOperation<T> onError(Consumer<HttpOperationError> errorHandler)
HttpOperationErrorType
errors.
If neither this function nor ignoreError()
is specified, then RollbackException
is thrown on error.
errorHandler
- function to call during executionHttpOperation<T> ignoreError()
HttpOperationErrorType
is ignored during HTTP request execution.void execute()
Copyright © Veeva Systems 2017–2020. All rights reserved.