Package eu.clarin.sru.server
Class SRUExplainResult
- java.lang.Object
-
- eu.clarin.sru.server.SRUExplainResult
-
public abstract class SRUExplainResult extends Object
A result set of an explain operation. A database implementation may use it implement extensions to the SRU protocol, i.e. providing extraResponseData.This class needs to be implemented for the target data source.
- See Also:
- SRU Explain Operation
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSRUExplainResult(SRUDiagnosticList diagnostics)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDiagnostic(String uri)Add a non surrogate diagnostic to the response.protected voidaddDiagnostic(String uri, String details)Add a non surrogate diagnostic to the response.protected voidaddDiagnostic(String uri, String details, String message)Add a non surrogate diagnostic to the response.voidclose()Release this result and free any associated resources.booleanhasExtraResponseData()Check, if extra response data should be serialized for this request.voidwriteExtraResponseData(XMLStreamWriter writer)Serialize extra response data for this request.
-
-
-
Constructor Detail
-
SRUExplainResult
protected SRUExplainResult(SRUDiagnosticList diagnostics)
Constructor.- Parameters:
diagnostics- an instance of a SRUDiagnosticList- See Also:
SRUDiagnosticList
-
-
Method Detail
-
addDiagnostic
protected final void addDiagnostic(String uri, String details, String message)
Add a non surrogate diagnostic to the response.- Parameters:
uri- the diagnostic's identifying URIdetails- supplementary information available, often in a format specified by the diagnostic ornullmessage- human readable message to display to the end user ornull
-
addDiagnostic
protected final void addDiagnostic(String uri, String details)
Add a non surrogate diagnostic to the response.- Parameters:
uri- the diagnostic's identifying URIdetails- supplementary information available, often in a format specified by the diagnostic ornull
-
addDiagnostic
protected final void addDiagnostic(String uri)
Add a non surrogate diagnostic to the response.- Parameters:
uri- the diagnostic's identifying URI
-
hasExtraResponseData
public boolean hasExtraResponseData()
Check, if extra response data should be serialized for this request. Default implementation is provided for convince and always returnsfalse.- Returns:
trueif extra response data should be serialized.- See Also:
writeExtraResponseData(XMLStreamWriter)
-
writeExtraResponseData
public void writeExtraResponseData(XMLStreamWriter writer) throws XMLStreamException
Serialize extra response data for this request.- Parameters:
writer- theXMLStreamExceptioninstance to be used- Throws:
XMLStreamException- an error occurred while serializing the result- See Also:
hasExtraResponseData()
-
close
public void close()
Release this result and free any associated resources.This method must not throw any exceptions
Calling the method
closeon a result object that is already closed is a no-op.
-
-