Package eu.clarin.sru.client
Class SRUScanResponse
- java.lang.Object
-
- eu.clarin.sru.client.SRUScanResponse
-
public final class SRUScanResponse extends Object
A response to a scan request.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<SRUDiagnostic>
getDiagnostics()
Get the diagnostics for this response.int
getDiagnosticsCount()
Get the number of diagnostics in the response.List<SRUExtraResponseData>
getExtraResponseData()
Get the extra response data for this result.<V extends SRUExtraResponseData>
List<V>getExtraResponseData(Class<V> clazz)
Get the extra response data of a specific class for this result.int
getExtraResponseDataCount()
Return the number of extra response data records attached to the response.<V extends SRUExtraResponseData>
VgetFirstExtraResponseData(Class<V> clazz)
Get the first instance of extra response data of a specific class for this result.T
getRequest()
Get the request that produced this response.List<SRUTerm>
getTerms()
Get list of terms matched by the request.int
getTermsCount()
Get the number of terms returned by the request.long
getTimeNetwork()
Get the number of milliseconds this request spend waiting for network operations to finish.long
getTimeProcessing()
Get the number of milliseconds the client was busy processing the results sent from the endpoint.long
getTimeTotal()
Get the total number of milliseconds elapsed for this request.long
getTimeWait()
Get the number of milliseconds this request has been queued before it was processed by the client.long
getTotalBytesTransferred()
Get the total number of bytes transferred for this request.boolean
hasDiagnostics()
Check, if the response contains any diagnostics.boolean
hasExtraResponseData()
Check, if this response has any extra response data attached to the response.<V extends SRUExtraResponseData>
booleanhasExtraResponseData(Class<V> clazz)
Check, if this response has any extra response data of a specific class attached to it.boolean
hasTerms()
Check, if response contains any terms.
-
-
-
Method Detail
-
getTerms
public List<SRUTerm> getTerms()
Get list of terms matched by the request.- Returns:
- a list of terms or
null
if no terms matched the request.
-
hasTerms
public boolean hasTerms()
Check, if response contains any terms.- Returns:
true
of response contains terms,false
otherwise
-
getTermsCount
public int getTermsCount()
Get the number of terms returned by the request.- Returns:
- the number of terms or
0
if none
-
getRequest
public T getRequest()
Get the request that produced this response.- Returns:
- the request
-
getDiagnostics
public List<SRUDiagnostic> getDiagnostics()
Get the diagnostics for this response.- Returns:
- diagnostics for this response or
null
if none
-
hasDiagnostics
public boolean hasDiagnostics()
Check, if the response contains any diagnostics.NB: Surrogate diagnostics are not covered by this.
- Returns:
true
if response contains any diagnostic,false
otherwise
-
getDiagnosticsCount
public int getDiagnosticsCount()
Get the number of diagnostics in the response.NB: Surrogate diagnostics are not covered by this.
- Returns:
- the number of diagnostics or
0
is none
-
getExtraResponseData
public List<SRUExtraResponseData> getExtraResponseData()
Get the extra response data for this result.- Returns:
- get a list of
SRUExtraResponseData
instances for the extra response data from the SRU response ornull
if none are available
-
hasExtraResponseData
public boolean hasExtraResponseData()
Check, if this response has any extra response data attached to the response.- Returns:
true
if extra response is attached,false
otherwise
-
getExtraResponseDataCount
public int getExtraResponseDataCount()
Return the number of extra response data records attached to the response.- Returns:
- the number of records, or
0
is none
-
getExtraResponseData
public <V extends SRUExtraResponseData> List<V> getExtraResponseData(Class<V> clazz)
Get the extra response data of a specific class for this result.- Type Parameters:
V
- the type ofSRUExtraResponseData
to check for- Parameters:
clazz
- the specific class to check for- Returns:
- a list of
SRUExtraResponseData
instances for the extra response data from the SRU response ornull
if none are available
-
getFirstExtraResponseData
public <V extends SRUExtraResponseData> V getFirstExtraResponseData(Class<V> clazz)
Get the first instance of extra response data of a specific class for this result.- Type Parameters:
V
- the type ofSRUExtraResponseData
to check for- Parameters:
clazz
- the specific class to check for- Returns:
- a list of
SRUExtraResponseData
instances for the extra response data from the SRU response ornull
if none are available
-
hasExtraResponseData
public <V extends SRUExtraResponseData> boolean hasExtraResponseData(Class<V> clazz)
Check, if this response has any extra response data of a specific class attached to it.- Type Parameters:
V
- the type ofSRUExtraResponseData
to check for- Parameters:
clazz
- the specific class to check for- Returns:
true
if extra response is attached,false
otherwise
-
getTotalBytesTransferred
public long getTotalBytesTransferred()
Get the total number of bytes transferred for this request.- Returns:
- the total number of bytes or
-1
if not available
-
getTimeTotal
public long getTimeTotal()
Get the total number of milliseconds elapsed for this request.- Returns:
- the total number of milliseconds or
-1
if not available
-
getTimeWait
public long getTimeWait()
Get the number of milliseconds this request has been queued before it was processed by the client.- Returns:
- the number of milliseconds queued or
-1
if not available
-
getTimeNetwork
public long getTimeNetwork()
Get the number of milliseconds this request spend waiting for network operations to finish.- Returns:
- the number of milliseconds spend in waiting on network or
-1
if not available
-
getTimeProcessing
public long getTimeProcessing()
Get the number of milliseconds the client was busy processing the results sent from the endpoint.- Returns:
- the number of milliseconds spend in processing or
-1
if not available
-
-