Class DataRetrievalResponseBase<T>
java.lang.Object
se.liu.ida.hefquin.federation.access.impl.response.DataRetrievalResponseBase<T>
- All Implemented Interfaces:
DataRetrievalResponse<T>
- Direct Known Subclasses:
CachedCardinalityResponseImpl,JSONResponseImpl,RecordsResponseImpl,SolMapsResponseImpl,StringResponseImpl,TPFResponseImpl,TriplesResponseImpl
public abstract class DataRetrievalResponseBase<T>
extends Object
implements DataRetrievalResponse<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDataRetrievalResponseBase(T data, Date requestStartTime) Constructs a response with the given data and request start time.protectedDataRetrievalResponseBase(T data, Date requestStartTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given data, request start time, and error details.protectedDataRetrievalResponseBase(T data, Date requestStartTime, Date retrievalEndTime) Constructs a response with the given data, request start time, and request end time.protectedDataRetrievalResponseBase(T data, Date requestStartTime, Date retrievalEndTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given data, request start time, retrieval end time, and error details. -
Method Summary
Modifier and TypeMethodDescriptionReturns a short textual description of the error, if available.Returns the HTTP status code associated with an error, if any.Returns the timestamp indicating when the data retrieval request was initiated.Returns the data retrieved in response to the corresponding request, or throws UnsupportedOperationDueToRetrievalError if an error occurred during data retrieval.Returns the timestamp indicating when the data retrieval was completed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface se.liu.ida.hefquin.federation.access.DataRetrievalResponse
getRequestDuration, isError
-
Field Details
-
data
-
errorStatusCode
-
errorDescription
-
-
Constructor Details
-
DataRetrievalResponseBase
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 benull)requestStartTime- the time at which the request was initiated (must not benull)
-
DataRetrievalResponseBase
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 benull)requestStartTime- the time at which the request was initiated (must not benull)retrievalEndTime- the time at which the retrieval of this response was completed (must not benull)
-
DataRetrievalResponseBase
protected DataRetrievalResponseBase(T data, Date requestStartTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given data, request start time, and error details. The retrieval end time is automatically set to the current time at the moment of construction.- Parameters:
data- the data contained in this response (must not benull)requestStartTime- the time at which the request was initiated (must not benull)errorStatusCode- the HTTP status code representing an error, ornullif no error occurrederrorDescription- a short description of the error, ornullif no error occurred
-
DataRetrievalResponseBase
protected DataRetrievalResponseBase(T data, Date requestStartTime, Date retrievalEndTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given data, request start time, retrieval end time, and error details.- Parameters:
data- the data contained in this response (must not benull)requestStartTime- the time at which the request was initiated (must not benull)retrievalEndTime- the time at which the retrieval of this response was completed (must not benull)errorStatusCode- the HTTP status code representing an error, ornullif no error occurrederrorDescription- a short description of the error, ornullif no error occurred
-
-
Method Details
-
getRequestStartTime
Returns the timestamp indicating when the data retrieval request was initiated.- Specified by:
getRequestStartTimein interfaceDataRetrievalResponse<T>- Returns:
- the request start time
-
getRetrievalEndTime
Returns the timestamp indicating when the data retrieval was completed.- Specified by:
getRetrievalEndTimein interfaceDataRetrievalResponse<T>- Returns:
- the retrieval end time
-
getErrorStatusCode
Returns the HTTP status code associated with an error, if any.- Specified by:
getErrorStatusCodein interfaceDataRetrievalResponse<T>- Returns:
- the error status code, or
nullif no error occurred
-
getErrorDescription
Returns a short textual description of the error, if available.- Specified by:
getErrorDescriptionin interfaceDataRetrievalResponse<T>- Returns:
- the error description, or
nullif no error occurred
-
getResponseData
Returns the data retrieved in response to the corresponding request, or throws UnsupportedOperationDueToRetrievalError if an error occurred during data retrieval.- Specified by:
getResponseDatain interfaceDataRetrievalResponse<T>- Returns:
- the data retrieved in this response
- Throws:
UnsupportedOperationDueToRetrievalError
-