Package eu.clarin.sru.client
Interface SRUSearchRetrieveHandler
-
- All Known Subinterfaces:
SRUDefaultHandler
- All Known Implementing Classes:
SRUDefaultHandlerAdapter
public interface SRUSearchRetrieveHandlerReceive notifications to the response of a searchRetrieve request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonDiagnostics(List<SRUDiagnostic> diagnostics)Receive notification of diagnostics.voidonExtraRecordData(String identifier, int position, XMLStreamReader reader)Receive notification of extra record data.voidonExtraResponseData(XMLStreamReader reader)Receive notification of extra response data.voidonFinishRecords(int nextRecordPosition)Receive notifications of the end of the enumeration of records in the response.voidonRecord(String identifier, int position, SRURecordData data)Receive notification of a record in the result set.voidonRequestStatistics(int totalBytesTransferred, long millisTotal, long millisNetwork, long millisProcessing)Receive notification of request statistics.voidonStartRecords(int numberOfRecords, String resultSetId, int resultSetIdleTime)Receive notifications of the start of the enumeration of records in the response.voidonSurrogateRecord(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- aXMLStreamReaderto 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 SRUClientExceptionReceive notifications of the start of the enumeration of records in the response.- Parameters:
numberOfRecords- the number of records or-1if not availableresultSetId- the result set id ornullif not availableresultSetIdleTime- the result set idle time or-1if not available- Throws:
SRUClientException- any SRU exception, possibly wrapping another exception
-
onFinishRecords
void onFinishRecords(int nextRecordPosition) throws SRUClientExceptionReceive notifications of the end of the enumeration of records in the response.- Parameters:
nextRecordPosition- the next record position or-1if 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 ornullif not availableposition- position of the record in the result set or-1if 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 ornullif not availableposition- position of the record in the result set or-1if 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 ornullif not availableposition- position of the record in the result set or-1if not availablereader- aXMLStreamReaderto parse the extra term data- Throws:
XMLStreamException- an error occurred while parsing the responseSRUClientException- any SRU exception, possibly wrapping another exception
-
-