Class CardinalityResponseImpl
java.lang.Object
se.liu.ida.hefquin.engine.federation.access.impl.response.CardinalityResponseImpl
- All Implemented Interfaces:
 CardinalityResponse,DataRetrievalResponse<Integer>
- Direct Known Subclasses:
 CardinalityResponseImplWithoutCardinality
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final DataRetrievalRequestprotected final DataRetrievalResponse<?>  - 
Constructor Summary
ConstructorsConstructorDescriptionCardinalityResponseImpl(DataRetrievalResponse<?> wrappedResponse, DataRetrievalRequest request, int cardinality) Constructs a cardinality response that wraps the given data retrieval response and associates it with a request and a cardinality value. - 
Method Summary
Modifier and TypeMethodDescriptionReturns a short description of the error from the wrapped response, if available.Returns the error status code from the wrapped response, if any.Returns the federation member associated with the wrapped response.Returns the data retrieval request associated with this response.Returns the duration between the request start and the retrieval end time, as reported by the wrapped response.Returns the timestamp indicating when the original request was initiated.Returns the cardinality value as the response data.Returns the timestamp indicating when the retrieval of the wrapped response completed.Returns the original data retrieval response that this object wraps.booleanisError()Indicates whether an error occurred during data retrieval, based on the wrapped response.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.engine.federation.access.CardinalityResponse
getCardinality 
- 
Field Details
- 
wrappedResponse
 - 
request
 - 
cardinality
protected final int cardinality 
 - 
 - 
Constructor Details
- 
CardinalityResponseImpl
public CardinalityResponseImpl(DataRetrievalResponse<?> wrappedResponse, DataRetrievalRequest request, int cardinality) Constructs a cardinality response that wraps the given data retrieval response and associates it with a request and a cardinality value.- Parameters:
 wrappedResponse- the wrapped data retrieval response (must not be null)request- the original data retrieval request (must not be null)cardinality- the cardinality of the request
 
 - 
 - 
Method Details
- 
getWrappedResponse
Returns the original data retrieval response that this object wraps.- Returns:
 - the wrapped 
DataRetrievalResponseinstance 
 - 
getFederationMember
Returns the federation member associated with the wrapped response.- Specified by:
 getFederationMemberin interfaceDataRetrievalResponse<Integer>- Returns:
 - the corresponding federation member
 
 - 
getRequest
Returns the data retrieval request associated with this response.- Specified by:
 getRequestin interfaceDataRetrievalResponse<Integer>- Returns:
 - the associated 
DataRetrievalRequest 
 - 
getRequestStartTime
Returns the timestamp indicating when the original request was initiated.- Specified by:
 getRequestStartTimein interfaceDataRetrievalResponse<Integer>- Returns:
 - the request start time
 
 - 
getRetrievalEndTime
Returns the timestamp indicating when the retrieval of the wrapped response completed.- Specified by:
 getRetrievalEndTimein interfaceDataRetrievalResponse<Integer>- Returns:
 - the retrieval end time
 
 - 
getRequestDuration
Returns the duration between the request start and the retrieval end time, as reported by the wrapped response.- Specified by:
 getRequestDurationin interfaceDataRetrievalResponse<Integer>- Returns:
 - the total duration of the request
 
 - 
isError
public boolean isError()Indicates whether an error occurred during data retrieval, based on the wrapped response.- Specified by:
 isErrorin interfaceDataRetrievalResponse<Integer>- Returns:
 trueif an error occurred. otherwisefalse
 - 
getErrorStatusCode
Returns the error status code from the wrapped response, if any.- Specified by:
 getErrorStatusCodein interfaceDataRetrievalResponse<Integer>- Returns:
 - the HTTP status code representing the error, or 
nullif no error occurred 
 - 
getErrorDescription
Returns a short description of the error from the wrapped response, if available.- Specified by:
 getErrorDescriptionin interfaceDataRetrievalResponse<Integer>- Returns:
 - the error description, or 
nullif no error occurred 
 - 
getResponseData
Returns the cardinality value as the response data. If the wrapped response indicates an error, this method throws an exception instead of returning a value.- Specified by:
 getResponseDatain interfaceDataRetrievalResponse<Integer>- Returns:
 - the cardinality value
 - Throws:
 UnsupportedOperationDueToRetrievalError- if the wrapped response indicates an error
 
 -