Package com.boomi.common.rest
Class RestOperation
- java.lang.Object
-
- com.boomi.connector.util.ContextualOperation
-
- com.boomi.connector.util.BaseOperation
-
- com.boomi.connector.util.BaseUpdateOperation
-
- com.boomi.common.rest.RestOperation
-
- All Implemented Interfaces:
Operation
- Direct Known Subclasses:
OpenAPIOperation
public class RestOperation extends BaseUpdateOperation
-
-
Constructor Summary
Constructors Constructor Description RestOperation(RestOperationConnection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
executeUpdate(UpdateRequest request, OperationResponse operation)
Actual implementation of this CREATE, UPDATE, or UPSERT Operation.RestOperationConnection
getConnection()
Returns the base connection that was either provided or created when this instance was created.protected HttpEntity
getEntity(ObjectData data)
Returns the request HTTP Entity to be send to the service.protected Iterable<Map.Entry<String,String>>
getHeaders(ObjectData data)
Returns a list of Headers, defined using custom operation properties (key-value pairs), to include in the Request Headers on request execution.protected Iterable<Map.Entry<String,String>>
getParameters(ObjectData data)
Returns a list of Query Parameters to append to the final URI.protected String
getPath(ObjectData data)
protected boolean
isRequestBodyRequired()
Returns true if the RequestBody is mandatory for request execution.-
Methods inherited from class com.boomi.connector.util.BaseUpdateOperation
execute
-
Methods inherited from class com.boomi.connector.util.ContextualOperation
getContext
-
-
-
-
Constructor Detail
-
RestOperation
public RestOperation(RestOperationConnection connection)
-
-
Method Detail
-
executeUpdate
protected final void executeUpdate(UpdateRequest request, OperationResponse operation)
Description copied from class:BaseUpdateOperation
Actual implementation of this CREATE, UPDATE, or UPSERT Operation.- Specified by:
executeUpdate
in classBaseUpdateOperation
- Parameters:
request
- request given toBaseUpdateOperation.execute(com.boomi.connector.api.OperationRequest, com.boomi.connector.api.OperationResponse)
, downcast to the correct typeoperation
- response given toBaseUpdateOperation.execute(com.boomi.connector.api.OperationRequest, com.boomi.connector.api.OperationResponse)
-
getPath
protected String getPath(ObjectData data)
-
getParameters
protected Iterable<Map.Entry<String,String>> getParameters(ObjectData data)
Returns a list of Query Parameters to append to the final URI.- Parameters:
data
- incoming request object data.- Returns:
- List of Query Entries
-
getHeaders
protected Iterable<Map.Entry<String,String>> getHeaders(ObjectData data)
Returns a list of Headers, defined using custom operation properties (key-value pairs), to include in the Request Headers on request execution.- Parameters:
data
- incoming request object data.- Returns:
- List of Header Entries
-
getEntity
protected HttpEntity getEntity(ObjectData data) throws IOException
Returns the request HTTP Entity to be send to the service.- Parameters:
data
-- Returns:
- the HTTP Entity
- Throws:
IOException
-
getConnection
public RestOperationConnection getConnection()
Description copied from class:ContextualOperation
Returns the base connection that was either provided or created when this instance was created.- Overrides:
getConnection
in classContextualOperation
- Returns:
- the base connection
-
isRequestBodyRequired
protected boolean isRequestBodyRequired()
Returns true if the RequestBody is mandatory for request execution. Override this method if your connector requires the request body / payload.- Returns:
- the requestBody required value.
-
-