1 | /** |
---|
2 | * This software is copyright (c) 2011-2013 by |
---|
3 | * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
4 | * This is free software. You can redistribute it |
---|
5 | * and/or modify it under the terms described in |
---|
6 | * the GNU General Public License v3 of which you |
---|
7 | * should have received a copy. Otherwise you can download |
---|
8 | * it from |
---|
9 | * |
---|
10 | * http://www.gnu.org/licenses/gpl-3.0.txt |
---|
11 | * |
---|
12 | * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) |
---|
13 | * |
---|
14 | * @license http://www.gnu.org/licenses/gpl-3.0.txt |
---|
15 | * GNU General Public License v3 |
---|
16 | */ |
---|
17 | package eu.clarin.sru.client; |
---|
18 | |
---|
19 | import java.util.List; |
---|
20 | |
---|
21 | import javax.xml.stream.XMLStreamException; |
---|
22 | import javax.xml.stream.XMLStreamReader; |
---|
23 | |
---|
24 | |
---|
25 | /** |
---|
26 | * Receive notifications to the response of a <em>explain</em> request. |
---|
27 | * |
---|
28 | * @see SRUExplainRequest |
---|
29 | * @see <a href="http://www.loc.gov/standards/sru/specs/explain.html">SRU Explain Operation</a> |
---|
30 | */ |
---|
31 | public interface SRUExplainHandler { |
---|
32 | |
---|
33 | /** |
---|
34 | * Receive notification of diagnostics. |
---|
35 | * |
---|
36 | * @param diagnostics |
---|
37 | * a list of {@link SRUDiagnostic} |
---|
38 | * @throws SRUClientException |
---|
39 | * any SRU exception, possibly wrapping another exception |
---|
40 | * @see SRUDiagnostic |
---|
41 | */ |
---|
42 | public void onDiagnostics(List<SRUDiagnostic> diagnostics) |
---|
43 | throws SRUClientException; |
---|
44 | |
---|
45 | |
---|
46 | /** |
---|
47 | * Receive notification of request statistics. |
---|
48 | * |
---|
49 | * @param totalBytesTransferred |
---|
50 | * the total number of bytes transferred while receiving the |
---|
51 | * response |
---|
52 | * @param millisTotal |
---|
53 | * the total time spend processing the request |
---|
54 | * @param millisNetwork |
---|
55 | * the time spend performing network operations |
---|
56 | * @param millisProcessing |
---|
57 | * the time spend processing the response |
---|
58 | */ |
---|
59 | public void onRequestStatistics(int totalBytesTransferred, |
---|
60 | long millisTotal, long millisNetwork, long millisProcessing); |
---|
61 | |
---|
62 | |
---|
63 | /** |
---|
64 | * Receive notification of extra response data. |
---|
65 | * |
---|
66 | * @param reader |
---|
67 | * a {@link XMLStreamReader} to parse the extra response data |
---|
68 | * @throws XMLStreamException |
---|
69 | * an error occurred while parsing the response |
---|
70 | * @throws SRUClientException |
---|
71 | * any SRU exception, possibly wrapping another exception |
---|
72 | * @see <a href="http://www.loc.gov/standards/sru/specs/extra-data.html">SRU |
---|
73 | * Extra Data / Extensions</a> |
---|
74 | */ |
---|
75 | public void onExtraResponseData(XMLStreamReader reader) |
---|
76 | throws XMLStreamException, SRUClientException; |
---|
77 | |
---|
78 | } // interface SRUExplainHandler |
---|