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 protected
SRUExplainResult(SRUDiagnosticList diagnostics)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDiagnostic(String uri)
Add a non surrogate diagnostic to the response.protected void
addDiagnostic(String uri, String details)
Add a non surrogate diagnostic to the response.protected void
addDiagnostic(String uri, String details, String message)
Add a non surrogate diagnostic to the response.void
close()
Release this result and free any associated resources.boolean
hasExtraResponseData()
Check, if extra response data should be serialized for this request.void
writeExtraResponseData(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 ornull
message
- 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:
true
if 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
- theXMLStreamException
instance 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
close
on a result object that is already closed is a no-op.
-
-