Package eu.clarin.sru.client
Class SRUSearchRetrieveResponse
- java.lang.Object
-
- eu.clarin.sru.client.SRUSearchRetrieveResponse
-
public final class SRUSearchRetrieveResponse extends Object
A response to a searchRetrieve request.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<SRUDiagnostic>getDiagnostics()Get the diagnostics for this response.intgetDiagnosticsCount()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.intgetExtraResponseDataCount()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.intgetNextRecordPosition()Get the next record position.intgetNumberOfRecords()Get the number of records.List<SRURecord>getRecords()Get the list of records.intgetRecordsCount()Get the number of records returned by the request.TgetRequest()Get the request that produced this response.StringgetResultSetId()Get the result set id.intgetResultSetIdleTime()Get the result set idle time.longgetTimeNetwork()Get the number of milliseconds this request spend waiting for network operations to finish.longgetTimeProcessing()Get the number of milliseconds the client was busy processing the results sent from the endpoint.longgetTimeTotal()Get the total number of milliseconds elapsed for this request.longgetTimeWait()Get the number of milliseconds this request has been queued before it was processed by the client.longgetTotalBytesTransferred()Get the total number of bytes transferred for this request.booleanhasDiagnostics()Check, if the response contains any diagnostics.booleanhasExtraResponseData()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.booleanhasRecords()Check, if response contains any records.
-
-
-
Method Detail
-
getNumberOfRecords
public int getNumberOfRecords()
Get the number of records.- Returns:
- the number of records or
-1if not available
-
getResultSetId
public String getResultSetId()
Get the result set id.- Returns:
- the result set id or
-1if not available
-
getResultSetIdleTime
public int getResultSetIdleTime()
Get the result set idle time.- Returns:
- the result set idle time or
-1if not available
-
getRecords
public List<SRURecord> getRecords()
Get the list of records.- Returns:
- the list of records or
nullif none
-
hasRecords
public boolean hasRecords()
Check, if response contains any records.- Returns:
trueof response contains records,falseotherwise
-
getRecordsCount
public int getRecordsCount()
Get the number of records returned by the request.- Returns:
- number of records or
0if none
-
getNextRecordPosition
public int getNextRecordPosition()
Get the next record position.- Returns:
- the next record position or
-1if not available
-
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
nullif none
-
hasDiagnostics
public boolean hasDiagnostics()
Check, if the response contains any diagnostics.NB: Surrogate diagnostics are not covered by this.
- Returns:
trueif response contains any diagnostic,falseotherwise
-
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
0is none
-
getExtraResponseData
public List<SRUExtraResponseData> getExtraResponseData()
Get the extra response data for this result.- Returns:
- get a list of
SRUExtraResponseDatainstances for the extra response data from the SRU response ornullif none are available
-
hasExtraResponseData
public boolean hasExtraResponseData()
Check, if this response has any extra response data attached to the response.- Returns:
trueif extra response is attached,falseotherwise
-
getExtraResponseDataCount
public int getExtraResponseDataCount()
Return the number of extra response data records attached to the response.- Returns:
- the number of records, or
0is 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 ofSRUExtraResponseDatato check for- Parameters:
clazz- the specific class to check for- Returns:
- a list of
SRUExtraResponseDatainstances for the extra response data from the SRU response ornullif 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 ofSRUExtraResponseDatato check for- Parameters:
clazz- the specific class to check for- Returns:
- a list of
SRUExtraResponseDatainstances for the extra response data from the SRU response ornullif 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 ofSRUExtraResponseDatato check for- Parameters:
clazz- the specific class to check for- Returns:
trueif extra response is attached,falseotherwise
-
getTotalBytesTransferred
public long getTotalBytesTransferred()
Get the total number of bytes transferred for this request.- Returns:
- the total number of bytes or
-1if not available
-
getTimeTotal
public long getTimeTotal()
Get the total number of milliseconds elapsed for this request.- Returns:
- the total number of milliseconds or
-1if 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
-1if 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
-1if 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
-1if not available
-
-