Class InsertService
java.lang.Object
com.invirgance.convirgance.web.service.InsertService
- All Implemented Interfaces:
Service
Service implementation for receiving and persisting data from HTTP requests.
InsertService processes data submission operations (typically POST requests) by
extracting data from HTTP requests, applying transformations, and persisting
the results.
The service follows: - Extract parameters from the request - Obtain raw data using an Origin component - Parse the data with an Input processor - Apply optional transformations - Persist the data through a Consumer - Return any generated keys or resultsUse this service when you need to create endpoints for data submission, form processing, or implementing POST/PUT operations in REST APIs.
- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(HttpRequest request, HttpResponse response) Executes the insert service, processing and persisting data from the HTTP request.Gets the consumer that will persist the processed data.com.invirgance.convirgance.input.Input
getInput()
Gets the input parser for the request data.Gets the origin of the data to be processed.Gets the list of parameters to extract from the request.List
<com.invirgance.convirgance.transform.Transformer> Gets the list of transformers to apply to the data.void
setConsumer
(Consumer consumer) Sets the consumer that will persist the processed data.void
setInput
(com.invirgance.convirgance.input.Input input) Sets the input parser for the request data.void
Sets the origin of the data to be processed.void
setParameters
(List<Parameter> parameters) Sets the list of parameters to extract from the request.void
setTransformers
(List<com.invirgance.convirgance.transform.Transformer> transformers) Sets the list of transformers to apply to the data.
-
Constructor Details
-
InsertService
public InsertService()
-
-
Method Details
-
getParameters
Gets the list of parameters to extract from the request.- Returns:
- The parameters list
-
setParameters
Sets the list of parameters to extract from the request.- Parameters:
parameters
- The parameters list
-
getInput
public com.invirgance.convirgance.input.Input getInput()Gets the input parser for the request data.- Returns:
- The input parser
-
setInput
public void setInput(com.invirgance.convirgance.input.Input input) Sets the input parser for the request data.- Parameters:
input
- The input parser
-
getOrigin
Gets the origin of the data to be processed.- Returns:
- The data origin
-
setOrigin
Sets the origin of the data to be processed.- Parameters:
origin
- The data origin
-
getTransformers
Gets the list of transformers to apply to the data.- Returns:
- The transformers list
-
setTransformers
Sets the list of transformers to apply to the data.- Parameters:
transformers
- The transformers list
-
getConsumer
Gets the consumer that will persist the processed data.- Returns:
- The consumer
-
setConsumer
Sets the consumer that will persist the processed data.- Parameters:
consumer
- The consumer
-
execute
Executes the insert service, processing and persisting data from the HTTP request.
-