org.fedoracommons.funapi.pmh
Class AbstractPmhResolver

java.lang.Object
  extended by org.fedoracommons.funapi.pmh.AbstractPmhResolver
All Implemented Interfaces:
ObjectResolver
Direct Known Subclasses:
DSpacePmhResolver, FedoraPmhResolver

public abstract class AbstractPmhResolver
extends java.lang.Object
implements ObjectResolver

Since:
0.1
Version:
$Id: AbstractPmhResolver.java 33 2008-10-25 19:31:36Z pangloss $
Author:
Edwin Shin

Constructor Summary
AbstractPmhResolver()
           
 
Method Summary
 UnapiFormats getFormats()
          Provide the object formats which should be supported for all objects available through the unAPI service.
 UnapiFormats getFormats(java.lang.String id)
          Provide a list of object formats available from the unAPI service for the object identified by id.
protected  org.apache.commons.httpclient.HttpClient getHttpClient()
           
 UnapiObject getObject(java.lang.String id, java.lang.String format)
          Return an UnapiObject representing the object specified by id in the format specified by format.
protected abstract  java.lang.String getPassword()
           
protected abstract  java.net.URL getPmhBaseUrl()
           
protected abstract  java.lang.String getPmhId(java.lang.String id)
           
protected abstract  java.lang.String getUsername()
           
protected  void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
           
protected  void setHttpMethod(org.apache.commons.httpclient.HttpMethod httpMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPmhResolver

public AbstractPmhResolver()
Method Detail

getFormats

public UnapiFormats getFormats()
                        throws UnapiException
Description copied from interface: ObjectResolver
Provide the object formats which should be supported for all objects available through the unAPI service.

Specified by:
getFormats in interface ObjectResolver
Returns:
UnapiFormats representing the object formats supported for all objects.
Throws:
UnapiException

getFormats

public UnapiFormats getFormats(java.lang.String id)
                        throws UnapiException
Description copied from interface: ObjectResolver
Provide a list of object formats available from the unAPI service for the object identified by id. It is similar to the getFormats response, but the returned UnapiFormats object must have the requested id set.

Specified by:
getFormats in interface ObjectResolver
Returns:
UnapiFormats representing the object formats supported for the requested object.
Throws:
UnapiException

getObject

public UnapiObject getObject(java.lang.String id,
                             java.lang.String format)
                      throws UnapiException
Description copied from interface: ObjectResolver

Return an UnapiObject representing the object specified by id in the format specified by format.

Implementations should throw an IdentifierException for requests for an identifier that is not available on the server. Implementations should throw a FormatException for requests for an identifier that is available on the server in a format that is not available for that identifier.

Specified by:
getObject in interface ObjectResolver
Returns:
UnapiObject
Throws:
UnapiException

getHttpClient

protected org.apache.commons.httpclient.HttpClient getHttpClient()

setHttpClient

protected void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)

setHttpMethod

protected void setHttpMethod(org.apache.commons.httpclient.HttpMethod httpMethod)

getPmhId

protected abstract java.lang.String getPmhId(java.lang.String id)
Parameters:
id - an unAPI identifier
Returns:
the corresponding OAI-PMH identifier

getPmhBaseUrl

protected abstract java.net.URL getPmhBaseUrl()
Returns:
The base URL of the OAI-PMH service, e.g. http://localhost:8080/oai/request.

getUsername

protected abstract java.lang.String getUsername()
Returns:
The username, if any, required to access the OAI-PMH service.

getPassword

protected abstract java.lang.String getPassword()
Returns:
The password, if any, required to access the OAI-PMH service.


Copyright © 2008 Fedora Commons, Inc.. All Rights Reserved.