dk.statsbiblioteket.doms.summa.oai
Class Client

java.lang.Object
  extended by dk.statsbiblioteket.doms.summa.oai.Client

public class Client
extends java.lang.Object

Client to send and receive oai Requests and Responses.

Version:
summaStorage-0.2 - build date 01/29/2007 11:57
See Also:
Request, Response

Nested Class Summary
private  class Client.MonitoredInputStream
          A special input stream that disconnects an underlying HttpURLConnection when closed.
 
Field Summary
private  java.lang.String base
           
private  Log log
           
 
Constructor Summary
Client(java.lang.String oaiBaseUrl)
          Create a new OAI client and configure it for a given oai provider.
 
Method Summary
private  IdentifyResponse getIdentity()
           
private  Client.MonitoredInputStream getInputStream(Request rq)
           
 Response submit(Request rq)
          Send an OAI request to the configured oai service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final Log log

base

private java.lang.String base
Constructor Detail

Client

public Client(java.lang.String oaiBaseUrl)
Create a new OAI client and configure it for a given oai provider.

Parameters:
oaiBaseUrl - the base url of the oai service. fx "http://localhost:8200/oaiprovider".
Method Detail

submit

public Response submit(Request rq)
                throws java.io.IOException
Send an OAI request to the configured oai service. Closing the input stream of the returned Response will also disconnect the underlying HttpURLConnection.

Parameters:
rq -
Returns:
Throws:
java.io.IOException

getInputStream

private Client.MonitoredInputStream getInputStream(Request rq)
                                            throws java.io.IOException
Throws:
java.io.IOException

getIdentity

private IdentifyResponse getIdentity()
                              throws java.io.IOException
Throws:
java.io.IOException