Class TPFResponseImpl
java.lang.Object
se.liu.ida.hefquin.engine.federation.access.impl.response.DataRetrievalResponseBase<Iterable<Triple>>
se.liu.ida.hefquin.engine.federation.access.impl.response.TPFResponseImpl
- All Implemented Interfaces:
DataRetrievalResponse<Iterable<Triple>>
,TPFResponse
,TriplesResponse
public class TPFResponseImpl
extends DataRetrievalResponseBase<Iterable<Triple>>
implements TPFResponse
-
Field Summary
FieldsFields inherited from class se.liu.ida.hefquin.engine.federation.access.impl.response.DataRetrievalResponseBase
data, errorDescription, errorStatusCode
-
Constructor Summary
ConstructorsConstructorDescriptionTPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, and request start time.TPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, request start time, and error details.TPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, request start time, and retrieval end time.TPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, request start time, retrieval end time, and error details.TPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, and request start time.TPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, int errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, request start time, and error details.TPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, request start time, and retrieval end time.TPFResponseImpl
(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, request start time, retrieval end time, and error details. -
Method Summary
Modifier and TypeMethodDescriptionReturns the cardinality estimate provided as metadata in the given TPF response.Returns an iterator over all metadata triples contained in the given TPF response.Returns the URL via which the next page of the TPF can be requested.Returns an iterator over the matched triples in the TPF response.Returns an iterator over all triples contained in the TPF response, concatenating the payload and metadata into a single iterable.Returnstrue
if the metadata of the given TPF response indicates that this response is the last page of matching triples.Methods inherited from class se.liu.ida.hefquin.engine.federation.access.impl.response.DataRetrievalResponseBase
getErrorDescription, getErrorStatusCode, getFederationMember, getRequest, getRequestStartTime, getRetrievalEndTime
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface se.liu.ida.hefquin.engine.federation.access.DataRetrievalResponse
getErrorDescription, getErrorStatusCode, getFederationMember, getRequest, getRequestDuration, getRequestStartTime, getRetrievalEndTime, isError
Methods inherited from interface se.liu.ida.hefquin.engine.federation.access.TPFResponse
getMetadataSize, getPayloadSize, getSize
-
Field Details
-
metadataTriples
-
cardEstimate
-
nextPageURL
-
-
Constructor Details
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, 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, ornull
if there is nonefm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request started
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, 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, ornull
if there is nonefm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request startedretrievalEndTime
- the time at which the retrieval of this response was completed (must not benull
)
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, 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, ornull
if there is nonetripleCount
- the triple countfm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request started
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, 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, ornull
if there is nonetripleCount
- the triple countfm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request startedretrievalEndTime
- the time at which the retrieval of this response was completed (must not benull
)
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, int errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, request start time, and error details. The retrieval end time is automatically set to the current time at the moment of construction.- 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, ornull
if there is nonefm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request startederrorStatusCode
- the HTTP status code representing an error, ornull
if no error occurrederrorDescription
- a short description of the error, ornull
if no error occurred
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, federation member, request, request start time, retrieval end time, and error details.- 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, ornull
if there is nonefm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request startedretrievalEndTime
- the time at which the retrieval of this response was completed (must not benull
)errorStatusCode
- the HTTP status code representing an error, ornull
if no error occurrederrorDescription
- a short description of the error, ornull
if no error occurred
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, request start time, and error details. The retrieval end time is automatically set to the current time at the moment of construction.- 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, ornull
if there is nonetripleCount
- the triple countfm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request startederrorStatusCode
- the HTTP status code representing an error, ornull
if no error occurrederrorDescription
- a short description of the error, ornull
if no error occurred
-
TPFResponseImpl
public TPFResponseImpl(List<Triple> matchingTriples, List<Triple> metadataTriples, String nextPageURL, int tripleCount, FederationMember fm, DataRetrievalRequest request, Date requestStartTime, Date retrievalEndTime, Integer errorStatusCode, String errorDescription) Constructs a response with the given matching triples, metadata triples, next page URL, triple count, federation member, request, request start time, retrieval end time, and error details.- 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, ornull
if there is nonetripleCount
- the triple countfm
- the federation member from which the data was retrievedrequest
- the original data retrieval requestrequestStartTime
- the timestamp when the request startedretrievalEndTime
- the time at which the retrieval of this response was completed (must not benull
)errorStatusCode
- the HTTP status code representing an error, ornull
if no error occurrederrorDescription
- a short description of the error, ornull
if no error occurred
-
-
Method Details
-
getMetadata
Description copied from interface:TPFResponse
Returns an iterator over all metadata triples contained in the given TPF response.- Specified by:
getMetadata
in interfaceTPFResponse
-
isLastPage
Description copied from interface:TPFResponse
Returnstrue
if the metadata of the given TPF response indicates that this response is the last page of matching triples. Returnsnull
of there is no metadata related to paging.- Specified by:
isLastPage
in interfaceTPFResponse
-
getNextPageURL
Description copied from interface:TPFResponse
Returns the URL via which the next page of the TPF can be requested. Returnsnull
of no such URL is mentioned in the metadata.- Specified by:
getNextPageURL
in interfaceTPFResponse
-
getCardinalityEstimate
Description copied from interface:TPFResponse
Returns the cardinality estimate provided as metadata in the given TPF response. Returnsnull
if there is no metadata with a cardinality estimate.- Specified by:
getCardinalityEstimate
in interfaceTPFResponse
-
getResponseData
Returns an iterator over all triples contained in the TPF response, concatenating the payload and metadata into a single iterable.- Specified by:
getResponseData
in interfaceDataRetrievalResponse<Iterable<Triple>>
- Overrides:
getResponseData
in classDataRetrievalResponseBase<Iterable<Triple>>
- Returns:
- the data retrieved in this response
- Throws:
UnsupportedOperationDueToRetrievalError
-
getPayload
Returns an iterator over the matched triples in the TPF response.- Specified by:
getPayload
in interfaceTPFResponse
- Throws:
UnsupportedOperationDueToRetrievalError
-