Class DataRetrievalResponseBase<T>

java.lang.Object
se.liu.ida.hefquin.federation.access.impl.response.DataRetrievalResponseBase<T>
All Implemented Interfaces:
DataRetrievalResponse<T>
Direct Known Subclasses:
CachedCardinalityResponse, CardinalityResponseImpl, JSONResponseImpl, RecordsResponseImpl, SolMapsResponseImpl, StringResponseImpl, TPFResponseImpl

public class DataRetrievalResponseBase<T> extends Object implements DataRetrievalResponse<T>
  • Field Details

    • data

      protected final T data
    • errorStatusCode

      protected final Integer errorStatusCode
    • errorDescription

      protected final String errorDescription
    • exception

      protected final Exception exception
    • requestStartTime

      protected final Date requestStartTime
    • retrievalEndTime

      protected final Date retrievalEndTime
  • Constructor Details

    • DataRetrievalResponseBase

      protected DataRetrievalResponseBase(T data, Date requestStartTime)
      Constructs a response with the given data and request start time. The retrieval end time is automatically set to the current time at the moment of construction. This constructor assumes no error occurred.
      Parameters:
      data - the data contained in this response (must not be null)
      requestStartTime - the time at which the request was initiated (must not be null)
    • DataRetrievalResponseBase

      protected DataRetrievalResponseBase(T data, Date requestStartTime, Date retrievalEndTime)
      Constructs a response with the given data, request start time, and request end time. This constructor assumes no error occurred.
      Parameters:
      data - the data contained in this response (must not be null)
      requestStartTime - the time at which the request was initiated (must not be null)
      retrievalEndTime - the time at which the retrieval of this response was completed (must not be null)
    • DataRetrievalResponseBase

      protected DataRetrievalResponseBase(int errorStatusCode, String errorDescription, Date requestStartTime)
      Constructs a response for the case that the response was an error message. The retrieval end time is automatically set to the current time at the moment of construction.
      Parameters:
      errorStatusCode - the HTTP status code of the error message (must not be null)
      errorDescription - a short description of the error (may be null)
      requestStartTime - the time at which the request was initiated (must not be null)
    • DataRetrievalResponseBase

      protected DataRetrievalResponseBase(int errorStatusCode, String errorDescription, Date requestStartTime, Date retrievalEndTime)
      Constructs a response for the case that the response was an error message.
      Parameters:
      errorStatusCode - the HTTP status code of the error message (must not be null)
      errorDescription - a short description of the error (may be null)
      requestStartTime - the time at which the request was initiated (must not be null)
      retrievalEndTime - the time at which the retrieval of this response was completed (must not be null)
    • DataRetrievalResponseBase

      protected DataRetrievalResponseBase(Exception exception, Date requestStartTime)
      Constructs a defective response for the case that an exception was thrown when producing the response. The retrieval end time is automatically set to the current time at the moment of construction.
      Parameters:
      exception - the exception (must not be null)
      requestStartTime - the time at which the request was initiated (must not be null)
    • DataRetrievalResponseBase

      protected DataRetrievalResponseBase(Exception exception, Date requestStartTime, Date retrievalEndTime)
      Constructs a defective response for the case that an exception was thrown when producing the response.
      Parameters:
      exception - the exception (must not be null)
      requestStartTime - the time at which the request was initiated (must not be null)
      retrievalEndTime - the time at which the creation of this response resulted in an exception (must not be null)
  • Method Details