Class InsertService

java.lang.Object
com.invirgance.convirgance.web.service.InsertService
All Implemented Interfaces:
Service

@Wiring public class InsertService extends Object implements 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 results
 
Use this service when you need to create endpoints for data submission, form processing, or implementing POST/PUT operations in REST APIs.
Author:
jbanes
  • Constructor Details

    • InsertService

      public InsertService()
  • Method Details

    • getParameters

      public List<Parameter> getParameters()
      Gets the list of parameters to extract from the request.
      Returns:
      The parameters list
    • setParameters

      public void setParameters(List<Parameter> parameters)
      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

      public Origin getOrigin()
      Gets the origin of the data to be processed.
      Returns:
      The data origin
    • setOrigin

      public void setOrigin(Origin origin)
      Sets the origin of the data to be processed.
      Parameters:
      origin - The data origin
    • getTransformers

      public List<com.invirgance.convirgance.transform.Transformer> getTransformers()
      Gets the list of transformers to apply to the data.
      Returns:
      The transformers list
    • setTransformers

      public void setTransformers(List<com.invirgance.convirgance.transform.Transformer> transformers)
      Sets the list of transformers to apply to the data.
      Parameters:
      transformers - The transformers list
    • getConsumer

      public Consumer getConsumer()
      Gets the consumer that will persist the processed data.
      Returns:
      The consumer
    • setConsumer

      public void setConsumer(Consumer consumer)
      Sets the consumer that will persist the processed data.
      Parameters:
      consumer - The consumer
    • execute

      public void execute(HttpRequest request, HttpResponse response)
      Executes the insert service, processing and persisting data from the HTTP request.
      Specified by:
      execute in interface Service
      Parameters:
      request - The HTTP request containing the data to process
      response - The HTTP response to write results to
      Throws:
      com.invirgance.convirgance.ConvirganceException - If an error occurs during processing