Package eu.clarin.sru.client
Class SRUSimpleClient
- java.lang.Object
-
- eu.clarin.sru.client.SRUSimpleClient
-
public class SRUSimpleClient extends Object
A simple client to perform SRU operations using callbacks. The application must provide the appropriate callbacks to receive the results of the operations.This client is reusable but not thread-safe: the application may reuse a client object, but it may not be concurrently shared between multiple threads.
This class is modeled after Java's SAX-API.
-
-
Constructor Summary
Constructors Constructor Description SRUSimpleClient(SRUClientConfig config)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexplain(SRUExplainRequest request, SRUExplainHandler handler)Perform a explain operation.voidscan(SRUScanRequest request, SRUScanHandler handler)Perform a scan operation.voidsearchRetrieve(SRUSearchRetrieveRequest request, SRUSearchRetrieveHandler handler)Perform a searchRetrieve operation.
-
-
-
Constructor Detail
-
SRUSimpleClient
public SRUSimpleClient(SRUClientConfig config)
Constructor.- Parameters:
config- the configuration to be used for this client.- Throws:
NullPointerException- if argumentconfigisnullIllegalArgumentException- if an error occurred while registering record data parsers- See Also:
SRUClientConfig
-
-
Method Detail
-
explain
public void explain(SRUExplainRequest request, SRUExplainHandler handler) throws SRUClientException
Perform a explain operation.- Parameters:
request- an instance of aSRUExplainRequestobjecthandler- an instance ofSRUExplainHandlerto receive callbacks when processing the result of this request- Throws:
SRUClientException- if an unrecoverable error occurredNullPointerException- if any required argument isnull- See Also:
SRUExplainRequest,SRUExplainHandler
-
scan
public void scan(SRUScanRequest request, SRUScanHandler handler) throws SRUClientException
Perform a scan operation.- Parameters:
request- an instance of aSRUScanRequestobjecthandler- an instance ofSRUScanHandlerto receive callbacks when processing the result of this request- Throws:
SRUClientException- if an unrecoverable error occurredNullPointerException- if any required argument isnull- See Also:
SRUScanRequest,SRUScanHandler
-
searchRetrieve
public void searchRetrieve(SRUSearchRetrieveRequest request, SRUSearchRetrieveHandler handler) throws SRUClientException
Perform a searchRetrieve operation.- Parameters:
request- an instance of aSRUSearchRetrieveRequestobjecthandler- an instance ofSRUSearchRetrieveHandlerto receive callbacks when processing the result of this request- Throws:
SRUClientException- if an unrecoverable error occurredNullPointerException- if any required argument isnull- See Also:
SRUSearchRetrieveRequest,SRUSearchRetrieveHandler
-
-