Package eu.clarin.sru.client
Interface SRUSearchRetrieveHandler
-
- All Known Subinterfaces:
SRUDefaultHandler
- All Known Implementing Classes:
SRUDefaultHandlerAdapter
public interface SRUSearchRetrieveHandler
Receive notifications to the response of a searchRetrieve request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onDiagnostics(List<SRUDiagnostic> diagnostics)
Receive notification of diagnostics.void
onExtraRecordData(String identifier, int position, XMLStreamReader reader)
Receive notification of extra record data.void
onExtraResponseData(XMLStreamReader reader)
Receive notification of extra response data.void
onFinishRecords(int nextRecordPosition)
Receive notifications of the end of the enumeration of records in the response.void
onRecord(String identifier, int position, SRURecordData data)
Receive notification of a record in the result set.void
onRequestStatistics(int totalBytesTransferred, long millisTotal, long millisNetwork, long millisProcessing)
Receive notification of request statistics.void
onStartRecords(int numberOfRecords, String resultSetId, int resultSetIdleTime)
Receive notifications of the start of the enumeration of records in the response.void
onSurrogateRecord(String identifier, int position, SRUDiagnostic data)
Receive notification of a surrogate record in the result set.
-
-
-
Method Detail
-
onDiagnostics
void onDiagnostics(List<SRUDiagnostic> diagnostics) throws SRUClientException
Receive notification of diagnostics.- Parameters:
diagnostics
- a list ofSRUDiagnostic
- Throws:
SRUClientException
- any SRU exception, possibly wrapping another exception- See Also:
SRUDiagnostic
-
onRequestStatistics
void onRequestStatistics(int totalBytesTransferred, long millisTotal, long millisNetwork, long millisProcessing)
Receive notification of request statistics.- Parameters:
totalBytesTransferred
- the total number of bytes transferred while receiving the responsemillisTotal
- the total time spend processing the requestmillisNetwork
- the time spend performing network operationsmillisProcessing
- the time spend processing the response
-
onExtraResponseData
void onExtraResponseData(XMLStreamReader reader) throws XMLStreamException, SRUClientException
Receive notification of extra response data.- Parameters:
reader
- aXMLStreamReader
to parse the extra response data- Throws:
XMLStreamException
- an error occurred while parsing the responseSRUClientException
- any SRU exception, possibly wrapping another exception- See Also:
- SRU Extra Data / Extensions
-
onStartRecords
void onStartRecords(int numberOfRecords, String resultSetId, int resultSetIdleTime) throws SRUClientException
Receive notifications of the start of the enumeration of records in the response.- Parameters:
numberOfRecords
- the number of records or-1
if not availableresultSetId
- the result set id ornull
if not availableresultSetIdleTime
- the result set idle time or-1
if not available- Throws:
SRUClientException
- any SRU exception, possibly wrapping another exception
-
onFinishRecords
void onFinishRecords(int nextRecordPosition) throws SRUClientException
Receive notifications of the end of the enumeration of records in the response.- Parameters:
nextRecordPosition
- the next record position or-1
if not available- Throws:
SRUClientException
- any SRU exception, possibly wrapping another exception
-
onRecord
void onRecord(String identifier, int position, SRURecordData data) throws SRUClientException
Receive notification of a record in the result set.- Parameters:
identifier
- identifier of the record ornull
if not availableposition
- position of the record in the result set or-1
if not availabledata
- the parsed record data- Throws:
SRUClientException
- any SRU exception, possibly wrapping another exception- See Also:
SRURecordData
,SRURecordDataParser
-
onSurrogateRecord
void onSurrogateRecord(String identifier, int position, SRUDiagnostic data) throws SRUClientException
Receive notification of a surrogate record in the result set.- Parameters:
identifier
- identifier of the record ornull
if not availableposition
- position of the record in the result set or-1
if not availabledata
- the surrogate record data, i.e. a diagnostic- Throws:
SRUClientException
- any SRU exception, possibly wrapping another exception- See Also:
SRUDiagnostic
-
onExtraRecordData
void onExtraRecordData(String identifier, int position, XMLStreamReader reader) throws XMLStreamException, SRUClientException
Receive notification of extra record data.- Parameters:
identifier
- identifier of the record ornull
if not availableposition
- position of the record in the result set or-1
if not availablereader
- aXMLStreamReader
to parse the extra term data- Throws:
XMLStreamException
- an error occurred while parsing the responseSRUClientException
- any SRU exception, possibly wrapping another exception
-
-