Package com.boomi.connector.util
Class SizeLimitedUpdateOperation
- java.lang.Object
-
- com.boomi.connector.util.ContextualOperation
-
- com.boomi.connector.util.BaseOperation
-
- com.boomi.connector.util.BaseUpdateOperation
-
- com.boomi.connector.util.SizeLimitedUpdateOperation
-
- All Implemented Interfaces:
Operation
- Direct Known Subclasses:
SizeLimitedBatchJsonOperation
,SizeLimitedJsonOperation
public abstract class SizeLimitedUpdateOperation extends BaseUpdateOperation
BaseUpdateOperation
extension that filters input data that is "too large". Implementations of this class are free to load SINGLE documents into memory. This provides no protection against loading ALL documents into memory. The filter limit is 1 MB by default and can be overwritten withMAX_SIZE_CONTAINER_PROP_KEY
container property if set. Inputs that exceed the limit will be filtered out and marked as an application error. It's still best practice to use a proper in memory parser instead of converting every stream to a string or byte[]. Atom owners can setMAX_SIZE_CONTAINER_PROP_KEY
toDEFAULT_IGNORE_MAX_SIZE_VALUE
to ignore filtering based on input data size and let ALL documents thru.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SizeLimitedUpdateOperation(OperationContext context)
Creates a new instance using the provided context.protected
SizeLimitedUpdateOperation(BaseConnection<OperationContext> connection)
Creates a new instance using the provided connection.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
executeSizeLimitedUpdate(UpdateRequest request, OperationResponse response)
Execute the implementation update logicprotected void
executeUpdate(UpdateRequest request, OperationResponse response)
Creates a filteredUpdateRequest
that does not include any documents that exceed the size limit.protected String
getSizeExceededMessage()
Returns the status message for excluded inputs.protected String
getSizeExceededStatusCode()
Returns the status code for excluded.protected boolean
includeSizeExceededPayload()
Indicates if the input document should be echoed as the application error payload.-
Methods inherited from class com.boomi.connector.util.BaseUpdateOperation
execute
-
Methods inherited from class com.boomi.connector.util.ContextualOperation
getConnection, getContext
-
-
-
-
Constructor Detail
-
SizeLimitedUpdateOperation
protected SizeLimitedUpdateOperation(BaseConnection<OperationContext> connection)
Creates a new instance using the provided connection.
-
SizeLimitedUpdateOperation
protected SizeLimitedUpdateOperation(OperationContext context)
Creates a new instance using the provided context.
-
-
Method Detail
-
executeUpdate
protected final void executeUpdate(UpdateRequest request, OperationResponse response)
Creates a filteredUpdateRequest
that does not include any documents that exceed the size limit. The filtered request is passed toexecuteSizeLimitedUpdate(UpdateRequest, OperationResponse)
implementation.- 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 typeresponse
- response given toBaseUpdateOperation.execute(com.boomi.connector.api.OperationRequest, com.boomi.connector.api.OperationResponse)
-
executeSizeLimitedUpdate
protected abstract void executeSizeLimitedUpdate(UpdateRequest request, OperationResponse response)
Execute the implementation update logic- Parameters:
request
- the filtered requestresponse
- the operation response
-
getSizeExceededStatusCode
protected String getSizeExceededStatusCode()
Returns the status code for excluded. By default, returnsDEFAULT_STATUS_CODE
.- Returns:
- the status code
-
getSizeExceededMessage
protected String getSizeExceededMessage()
Returns the status message for excluded inputs. By default, returnsDEFAULT_STATUS_MESSAGE
.- Returns:
- the status message
-
includeSizeExceededPayload
protected boolean includeSizeExceededPayload()
Indicates if the input document should be echoed as the application error payload. By default, returns false. When false, a null payload is used. The payload will contain metadata either way.- Returns:
- true if the payload should be included, false otherwise
-
-