Class BoundedTask

java.lang.Object
overit.geocall.da.DATask
overit.geocall.da.BoundedTask
All Implemented Interfaces:
Serializable, Runnable, Identified, Tool

public abstract class BoundedTask extends DATask
This abstract class, that extends the DATask, must be extended to create a task that performs operation on a request and returns as a result a response that can be validated using an ObjectValidator. If the response will be not valid, the task will throw a DAException.
See Also:
  • Constructor Details

    • BoundedTask

      public BoundedTask()
  • Method Details

    • setRequest

      public final void setRequest(Object r)
      Sets the request
      Parameters:
      r - The Object that defines the request for the task
    • getRequest

      protected final Object getRequest()
      Returns the request
      Returns:
      The Object that represents the request for the task
    • getResponse

      public final Object getResponse()
      Returns the response
      Returns:
      The Object that represents the response for the task
    • setResponse

      protected final void setResponse(Object o) throws DAException
      Throws:
      DAException
    • setResponseBound

      public final void setResponseBound(ObjectValidator bound)
      Sets the ObjectValidator that will be used to validate the task response
      Parameters:
      bound - The ObjectValidator used by the task
    • body

      protected void body() throws DAException, DAValidateException
      Description copied from class: DATask
      Abstract method, that must be implemented, that represent the start point of the task. The method contains the application logic of the specific task.
      Specified by:
      body in class DATask
      Throws:
      DAException - If there is a (blocking) data-access error, a DAException is thrown to the caller
      DAValidateException - If there are error in the data validation phase, a DAValidateException is thrown
    • execute

      public abstract void execute(PooledConnection conn) throws DAException, DAValidateException
      Abstract method, that must be implemented, that represent the start point of the task. The method contains the application logic of the specific task.
      Parameters:
      conn - The PooledConnection that must be used
      Throws:
      DAException - If there is a (blocking) data-access error, a DAException is thrown to the caller
      DAValidateException - If there are error in the data validation phase, a DAValidateException is thrown