Class TPFResponseImpl

java.lang.Object
se.liu.ida.hefquin.federation.access.impl.response.DataRetrievalResponseBase<Iterable<Triple>>
se.liu.ida.hefquin.federation.access.impl.response.TPFResponseImpl
All Implemented Interfaces:
DataRetrievalResponse<Iterable<Triple>>, TPFResponse, TriplesResponse

public class TPFResponseImpl extends DataRetrievalResponseBase<Iterable<Triple>> implements TPFResponse
  • Field Details

    • metadataTriples

      protected final List<Triple> metadataTriples
    • cardEstimate

      protected final Integer cardEstimate
    • nextPageURL

      protected final String nextPageURL
  • Constructor Details

    • TPFResponseImpl

      public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, Date requestStartTime)
      Constructs a response with the given matching triples, metadata triples, next page URL, 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:
      matchingTriples - the list of triples matching the request pattern (must not be null)
      metadataTriples - the list of metadata triples (must not be null)
      nextPageURL - the URL for the next page of results, or null if there is none
      requestStartTime - the timestamp when the request started
    • TPFResponseImpl

      public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, Date requestStartTime, Date retrievalEndTime)
      Constructs a response with the given matching triples, metadata triples, next page URL, request start time, and retrieval end time. This constructor assumes no error occurred.
      Parameters:
      matchingTriples - the list of triples matching the request pattern (must not be null)
      metadataTriples - the list of metadata triples (must not be null)
      nextPageURL - the URL for the next page of results, or null if there is none
      requestStartTime - the timestamp when the request started
      retrievalEndTime - the time at which the retrieval of this response was completed (must not be null)
    • TPFResponseImpl

      public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, Date requestStartTime)
      Constructs a response with the given matching triples, metadata triples, next page URL, triple count, 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:
      matchingTriples - the list of triples matching the request pattern (must not be null)
      metadataTriples - the list of metadata triples (must not be null)
      nextPageURL - the URL for the next page of results, or null if there is none
      tripleCount - the triple count
      requestStartTime - the timestamp when the request started
    • TPFResponseImpl

      public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, Date requestStartTime, Date retrievalEndTime)
      Constructs a response with the given matching triples, metadata triples, next page URL, triple count, request start time, and retrieval end time. This constructor assumes no error occurred.
      Parameters:
      matchingTriples - the list of triples matching the request pattern (must not be null)
      metadataTriples - the list of metadata triples (must not be null)
      nextPageURL - the URL for the next page of results, or null if there is none
      tripleCount - the triple count
      requestStartTime - the timestamp when the request started
      retrievalEndTime - the time at which the retrieval of this response was completed (must not be null)
    • TPFResponseImpl

      public TPFResponseImpl(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. *@param errorStatusCode the HTTP status code of the error message (must not be null)
      Parameters:
      errorDescription - a short description of the error (may be null)
      requestStartTime - the time at which the request was initiated (must not be null)
    • TPFResponseImpl

      public TPFResponseImpl(int errorStatusCode, String errorDescription, Date requestStartTime, Date retrievalEndTime)
      Constructs a response for the case that the response was an error message. *@param errorStatusCode the HTTP status code of the error message (must not be null)
      Parameters:
      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)
    • TPFResponseImpl

      public TPFResponseImpl(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)
    • TPFResponseImpl

      public TPFResponseImpl(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