Skip to content

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:

  1. 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();
  1. 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
...
  1. Destroy service when exiting or shutting down the application
service.destroy();

next...

Clone this wiki locally