org.fcrepo.oai.sample
Class SampleOAIProvider

java.lang.Object
  extended by org.fcrepo.oai.sample.SampleOAIProvider
All Implemented Interfaces:
Constants, OAIProvider

public class SampleOAIProvider
extends Object
implements Constants, OAIProvider

A sample implementation of OAIProvider for testing and demonstration purposes.

Author:
Chris Wilper

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.fcrepo.common.Constants
Constants.FedoraHome
 
Field Summary
 
Fields inherited from interface org.fcrepo.common.Constants
ACCESS, ACTION, API, ATOM_APIM1_0, ATOM_ZIP1_1, ATOM1_1, AUDIT, AUDIT1_0, BATCH_MODIFY, BATCH_MODIFY1_1, BE_SECURITY, BE_SECURITY1_0, BINDING_SPEC, DATASTREAM, DC, DISSEMINATOR, DS_COMPOSITE_MODEL, DS_COMPOSITE_MODEL1_0, DS_INPUT_SPEC1_0, DS_INPUT_SPEC1_1, ENVIRONMENT, FCFG, FEDORA, FEDORA_APP_CONTEXT_NAME, FEDORA_DEFAULT_APP_CONTEXT, FEDORA_HOME, FOXML, FOXML1_0, FOXML1_0_LEGACY, FOXML1_1, HTTP_REQUEST, MANAGEMENT, METHOD_MAP, METS, METS_EXT, METS_EXT1_0, METS_EXT1_0_LEGACY, METS_EXT1_1, MODEL, MULGARA, OAI_DC, OAI_DC2_0, OAI_FRIENDS, OAI_FRIENDS2_0, OAI_IDENTIFIER, OAI_IDENTIFIER2_0, OAI_PMH, OAI_PMH2_0, OAI_PROV, OAI_PROV2_0, OBJ_DATASTREAMS1_0, OBJ_HISTORY1_0, OBJ_ITEMS1_0, OBJ_METHODS1_0, OBJ_PROFILE1_0, OBJ_VALIDATION1_0, OBJECT, OLD_XLINK, PID_LIST1_0, RDF, RDF_XSD, RECOVERY, RELS_EXT, RELS_EXT1_0, RELS_INT1_0, REPO_DESC1_0, RESOURCE, SDEF, SDEF_METHOD_MAP1_0, SDEP, SDEP_METHOD_MAP1_0, SDEP_METHOD_MAP1_1, SERVICE_PROFILE, SOAP, SOAP_ENC, SUBJECT, TYPES, VIEW, WSDL, WSDL_HTTP, WSDL_MIME, XACML_POLICY, XACML_POLICY1_0, XLINK, XML_XSD, XMLNS, XSI
 
Constructor Summary
SampleOAIProvider()
           
 
Method Summary
 Set getAdminEmails()
          Get the email addresses of administrators of the repository.
 String getBaseURL(String protocol, String port)
          Get the HTTP endpoint for the OAI-PMH interface.
 DateGranularitySupport getDateGranularitySupport()
          Get the finest harvesting granularity supported by the repository.
 DeletedRecordSupport getDeletedRecordSupport()
          Get the manner in which the repository supports the notion of deleted records.
 Set getDescriptions()
          Get XML descriptions of the repository.
 Date getEarliestDatestamp()
          Get a Date (in UTC) that is the guaranteed lower limit of all datestamps recording changes, modifications, or deletions in the repository.
 List getHeaders(Date from, Date until, String metadataPrefix, String set)
          Just like getRecords, but returns Header objects.
 List getHeaders(String resumptionToken)
          Get the remaining portion of a set of Headers.
 long getMaxHeaders()
          Get the maximum number of headers that are returned at a time.
 long getMaxRecords()
          Get the maximum number of records that are returned at a time.
 long getMaxSets()
          Get the maximum number of sets that are returned at a time.
 Set getMetadataFormats(String id)
          Get the MetadataFormats supported across the repository or for an individual item in the repository.
 String getProtocolVersion()
          Get the version of the OAI-PMH supported by the repository.
 Record getRecord(String identifier, String metadataPrefix)
          Get an individual metadata record from the repository.
 List getRecords(Date from, Date until, String metadataPrefix, String set)
          Get the Records in the repository matching the given criteria.
 List getRecords(String resumptionToken)
          Get the remaining portion of a set of Records.
 String getRepositoryName()
          Get a human readable name for the repository.
 List getSets()
          Get the setSpecs, setNames, and setDescriptions of sets in the repository.
 List getSets(String resumptionToken)
          Get the remaining portion of a set of Sets.
 Set getSupportedCompressionEncodings()
          Get the compression encodings supported by the repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleOAIProvider

public SampleOAIProvider()
Method Detail

getRepositoryName

public String getRepositoryName()
Description copied from interface: OAIProvider
Get a human readable name for the repository.

Specified by:
getRepositoryName in interface OAIProvider
Returns:
the repository name.

getBaseURL

public String getBaseURL(String protocol,
                         String port)
Description copied from interface: OAIProvider
Get the HTTP endpoint for the OAI-PMH interface.

Specified by:
getBaseURL in interface OAIProvider
Returns:
the base URL.

getProtocolVersion

public String getProtocolVersion()
Description copied from interface: OAIProvider
Get the version of the OAI-PMH supported by the repository.

Specified by:
getProtocolVersion in interface OAIProvider
Returns:
the protocol version number.

getEarliestDatestamp

public Date getEarliestDatestamp()
Description copied from interface: OAIProvider
Get a Date (in UTC) that is the guaranteed lower limit of all datestamps recording changes, modifications, or deletions in the repository. A repository must not use datestamps lower than this.

Specified by:
getEarliestDatestamp in interface OAIProvider
Returns:
the earliest datetime stamp.

getDeletedRecordSupport

public DeletedRecordSupport getDeletedRecordSupport()
Description copied from interface: OAIProvider
Get the manner in which the repository supports the notion of deleted records.

Specified by:
getDeletedRecordSupport in interface OAIProvider
Returns:
manner in which repository supports the notion of deletion.

getDateGranularitySupport

public DateGranularitySupport getDateGranularitySupport()
Description copied from interface: OAIProvider
Get the finest harvesting granularity supported by the repository.

Specified by:
getDateGranularitySupport in interface OAIProvider
Returns:
the finest harvesting granularity supported by the repository.

getAdminEmails

public Set getAdminEmails()
Description copied from interface: OAIProvider
Get the email addresses of administrators of the repository. This set must contain at least one item.

Specified by:
getAdminEmails in interface OAIProvider
Returns:
the email addresses of administrators of the repository.

getSupportedCompressionEncodings

public Set getSupportedCompressionEncodings()
Description copied from interface: OAIProvider
Get the compression encodings supported by the repository. This set may be empty. Recommended values are those in RFC 2616 Section 14.11

Specified by:
getSupportedCompressionEncodings in interface OAIProvider
Returns:
the compression encodings supported by the repository.

getDescriptions

public Set getDescriptions()
Description copied from interface: OAIProvider
Get XML descriptions of the repository. Each Set element must be a String containing a description according to some W3C schema, where the xsi:schemaLocation attribute is used on the root element. See http://www.openarchives.org/OAI/2.0/guidelines.htm for guidelines regarding these repository-level descriptions.

Specified by:
getDescriptions in interface OAIProvider
Returns:
XML descriptions of the repository.

getRecord

public Record getRecord(String identifier,
                        String metadataPrefix)
                 throws IDDoesNotExistException
Description copied from interface: OAIProvider
Get an individual metadata record from the repository.

Specified by:
getRecord in interface OAIProvider
Parameters:
identifier - the record identifier.
metadataPrefix - the metadata prefix identifier.
Returns:
an individual metadata record from the repository.
Throws:
IDDoesNotExistException

getRecords

public List getRecords(Date from,
                       Date until,
                       String metadataPrefix,
                       String set)
Description copied from interface: OAIProvider
Get the Records in the repository matching the given criteria. Any of the arguments (except metadataPrefix) may be null, indicating "any". If the size of the returned list is over getMaxRecords(), the last element is a resumptionToken (a String) which can be used to get the rest of the list.

Specified by:
getRecords in interface OAIProvider
Parameters:
from - the beginning date of the date range.
until - the ending date of the date range.
metadataPrefix - the metadata prefix.
set - the set of criteria
Returns:
the Records in the repository matching the given criteria.

getRecords

public List getRecords(String resumptionToken)
                throws BadResumptionTokenException
Description copied from interface: OAIProvider
Get the remaining portion of a set of Records. If the size of the returned list is over getMaxRecords(), the last element is another resumptionToken (a String) which can be used to get the rest of the list.

Specified by:
getRecords in interface OAIProvider
Parameters:
resumptionToken - a string that can be used to get the rest of the list.
Returns:
the remaining portion of a set of Records.
Throws:
BadResumptionTokenException

getHeaders

public List getHeaders(Date from,
                       Date until,
                       String metadataPrefix,
                       String set)
Description copied from interface: OAIProvider
Just like getRecords, but returns Header objects. If the size of the returned list is over getMaxHeaders(), the last element is a resumptionToken (a String) which can be used to get the rest of the list.

Specified by:
getHeaders in interface OAIProvider
Parameters:
from - the beginning date range.
until - the end of the date range.
metadataPrefix - the metadata prefix.
set - the set of criteria.
Returns:
the remaining portion of a set of Header objects.

getHeaders

public List getHeaders(String resumptionToken)
                throws BadResumptionTokenException
Description copied from interface: OAIProvider
Get the remaining portion of a set of Headers. If the size of the returned list is over getMaxHeaders() the last element is another resumptionToken (a String) which can be used to get the rest of the list.

Specified by:
getHeaders in interface OAIProvider
Parameters:
resumptionToken - a string that can be used to get the rest of the list.
Returns:
the remaining portion of a set of Headers.
Throws:
BadResumptionTokenException

getSets

public List getSets()
Description copied from interface: OAIProvider
Get the setSpecs, setNames, and setDescriptions of sets in the repository. Each set has a setSpec, a name, and zero or more descriptions, held by a SetInfo object. If the size of the returned list is over getMaxSets(), the last element is a resumptionToken (a String) which can be used to get the rest of the list.

Specified by:
getSets in interface OAIProvider
Returns:
the setSpecs, setNames, and setDescriptions of sets in the repository.

getSets

public List getSets(String resumptionToken)
             throws BadResumptionTokenException
Description copied from interface: OAIProvider
Get the remaining portion of a set of Sets. If the size of the returned list is over getMaxSets(), the last element is another resumptionToken (a String) which can be used to get the rest of the list.

Specified by:
getSets in interface OAIProvider
Parameters:
resumptionToken - a string that can be used to get the rest of the list.
Returns:
the remaining portion of a set of Sets.
Throws:
BadResumptionTokenException

getMetadataFormats

public Set getMetadataFormats(String id)
Description copied from interface: OAIProvider
Get the MetadataFormats supported across the repository or for an individual item in the repository.

Specified by:
getMetadataFormats in interface OAIProvider
Parameters:
id - The item identifier, or null, meaning "the entire repository"
Returns:
the set of metadata formats supported by the repository.

getMaxSets

public long getMaxSets()
Description copied from interface: OAIProvider
Get the maximum number of sets that are returned at a time. A negative value signifies no maximum.

Specified by:
getMaxSets in interface OAIProvider
Returns:
the maximum number of sets that are returned at a time.

getMaxRecords

public long getMaxRecords()
Description copied from interface: OAIProvider
Get the maximum number of records that are returned at a time. A negative value signifies no maximum.

Specified by:
getMaxRecords in interface OAIProvider
Returns:
the maximum number of records that are returned at a time.

getMaxHeaders

public long getMaxHeaders()
Description copied from interface: OAIProvider
Get the maximum number of headers that are returned at a time. A negative value signifies no maximum.

Specified by:
getMaxHeaders in interface OAIProvider
Returns:
the maximum number of headers that are returned at a time.


Copyright © 2012 DuraSpace. All Rights Reserved.