-
Notifications
You must be signed in to change notification settings - Fork 0
Service
Piotr Andzel edited this page Apr 5, 2019
·
3 revisions
Service is a component capable of accepting OAI-PMH requests and producing responses.
In order to process requests it needs a concrete instance of the ContentProvider
class. Person implementing server based on the 'Service' module is responsible of providing custom concrete version of the ContentProvider.
ContentProvider serves as a proxy to the catalog.
Example of the workflow:
- Create instance of the service
// create instance of the content provider
ContentProvider contentProvider = new CustomContentProvider();
// create instance of the service
Service service = new Service(contentProvider);
// initialize service
service.construct();
- Process an OAI-PMH request
// retrieve a 'query' part from the HTTP request
...
// process request
String responseString = service.execute(queryString);
// ship 'responseString' back to the caller
...
- Destroy service when exiting or shutting down the application
service.destroy();