Package eu.clarin.sru.server
Interface SRUSearchEngine
-
- All Known Implementing Classes:
SRUSearchEngineBase
public interface SRUSearchEngine
Interface for connecting the SRU protocol implementation to an actual search engine.Implementing the
explain(SRUServerConfig, SRURequest, SRUDiagnosticList)
andscan(SRUServerConfig, SRURequest, SRUDiagnosticList)
is optional, but implementingsearch(SRUServerConfig, SRURequest, SRUDiagnosticList)
is mandatory.The implementation of these methods must be thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SRUExplainResult
explain(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics)
Handle an explain operation.SRUScanResultSet
scan(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics)
Handle a scan operation.SRUSearchResultSet
search(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics)
Handle a searchRetrieve operation.
-
-
-
Method Detail
-
explain
SRUExplainResult explain(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics) throws SRUException
Handle an explain operation. Implementing this method is optional, but is required, if the writeExtraResponseData block of the SRU response needs to be filled. The arguments for this operation are provides by theSRURequest
object.The implementation of this method must be thread-safe.
- Parameters:
config
- theSRUEndpointConfig
object that contains the endpoint configurationrequest
- theSRURequest
object that contains the request made to the endpointdiagnostics
- theSRUDiagnosticList
object for storing non-fatal diagnostics- Returns:
- a
SRUExplainResult
object ornull
if the search engine does not want to provide writeExtraResponseData - Throws:
SRUException
- if an fatal error occurred- See Also:
SRUExplainResult
-
search
SRUSearchResultSet search(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics) throws SRUException
Handle a searchRetrieve operation. Implementing this method is mandatory. The arguments for this operation are provides by theSRURequest
object.The implementation of this method must be thread-safe.
- Parameters:
config
- theSRUEndpointConfig
object that contains the endpoint configurationrequest
- theSRURequest
object that contains the request made to the endpointdiagnostics
- theSRUDiagnosticList
object for storing non-fatal diagnostics- Returns:
- a
SRUSearchResultSet
object - Throws:
SRUException
- if an fatal error occurred- See Also:
SRURequest
,SRUExplainResult
-
scan
SRUScanResultSet scan(SRUServerConfig config, SRURequest request, SRUDiagnosticList diagnostics) throws SRUException
Handle a scan operation. Implementing this method is optional. If you don't need to handle the scan operation, just returnnull
and the SRU server will return the appropiate diagnostic to the client. The arguments for this operation are provides by theSRURequest
object.The implementation of this method must be thread-safe.
- Parameters:
config
- theSRUEndpointConfig
object that contains the endpoint configurationrequest
- theSRURequest
object that contains the request made to the endpointdiagnostics
- theSRUDiagnosticList
object for storing non-fatal diagnostics- Returns:
- a
SRUScanResultSet
object ornull
if this operation is not supported by this search engine - Throws:
SRUException
- if an fatal error occurred- See Also:
SRUExplainResult
-
-