Class OaiPmhRepository

java.lang.Object
org.opencastproject.oaipmh.server.OaiPmhRepository
All Implemented Interfaces:
org.osgi.service.cm.ManagedService
Direct Known Subclasses:
DefaultRepository

public abstract class OaiPmhRepository extends Object implements org.osgi.service.cm.ManagedService
An OAI-PMH protocol compliant repository.

Currently supported:

Currently not supported:

  • Constructor Details

    • OaiPmhRepository

      public OaiPmhRepository()
  • Method Details

    • getRepositoryTimeGranularity

      public abstract Granularity getRepositoryTimeGranularity()
    • getRepositoryName

      public abstract String getRepositoryName()
      Display name of the OAI-PMH repository.
    • getRepositoryId

      public abstract String getRepositoryId()
      Repository ID.
    • getPersistence

      public abstract org.opencastproject.oaipmh.persistence.OaiPmhDatabase getPersistence()
    • getAdminEmail

      public abstract String getAdminEmail()
    • updated

      public void updated(Dictionary<String,?> properties) throws org.osgi.service.cm.ConfigurationException
      Parse service configuration file.
      Specified by:
      updated in interface org.osgi.service.cm.ManagedService
      Parameters:
      properties - Service configuration as dictionary
      Throws:
      org.osgi.service.cm.ConfigurationException - If there is a problem within get configuration
    • saveQuery

      public abstract String saveQuery(ResumableQuery query)
      Save a query.
      Returns:
      a resumption token
    • getSavedQuery

      public abstract org.opencastproject.util.data.Option<ResumableQuery> getSavedQuery(String resumptionToken)
      Get a saved query.
    • getResultLimit

      public abstract int getResultLimit()
      Maximum number of items returned by the list queries ListIdentifiers, ListRecords and ListSets.
    • getRepositoryMetadataProviders

      public abstract List<MetadataProvider> getRepositoryMetadataProviders()
      Return a list of available metadata providers. Please do not expose the default provider for the mandatory oai_dc format since this is automatically added when calling getMetadataProviders().
      See Also:
    • currentDate

      public Date currentDate()
      Return the current date. Used in implementation instead of new Date(); to facilitate unit testing.
    • getMetadataProviders

      public final List<MetadataProvider> getMetadataProviders()
      Return a list of all available metadata providers. The oai_dc format is always included.
    • addItem

      public void addItem(org.opencastproject.mediapackage.MediaPackage mp)
      Add an item to the repository.
    • selectVerb

      public XmlGen selectVerb(Params p)
      Create an OAI-PMH response based on the given request params.
    • getMetadataProvider

      public org.opencastproject.util.data.Option<MetadataProvider> getMetadataProvider(String metadataPrefix)
      Return the metadata provider for a given metadata prefix.
    • granulate

      public static Date granulate(Granularity g, Date d)
      "Cut" a date to the repositories supported granularity. Cutting behaves similar to the mathematical floor function.