Class OaiPmhServer

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.opencastproject.oaipmh.server.OaiPmhServer
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, OaiPmhServerInfo

public final class OaiPmhServer extends javax.servlet.http.HttpServlet implements OaiPmhServerInfo
The OAI-PMH server. Backed by an arbitrary amount of OAI-PMH repositories.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.osgi.service.component.ComponentContext cc)
    OSGi component activation.
    void
     
    protected void
    doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
     
    protected void
    doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
     
    Return the mount point of the server, e.g.
    boolean
    Check if the requested repo exists.
    void
    modified(org.osgi.service.component.ComponentContext cc)
     
    repositoryId(javax.servlet.http.HttpServletRequest req, String mountPoint)
    Retrieve the repository id from the requested path.
    void
    OSGi DI.
    void
    OSGi DI.
    void
    OSGi DI.
    void
    updated(Dictionary<String,?> properties)
    Called by the ConfigurationAdmin service.

    Methods inherited from class javax.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OaiPmhServer

      public OaiPmhServer()
  • Method Details

    • setRepository

      public void setRepository(OaiPmhRepository r)
      OSGi DI.
    • unsetRepository

      public void unsetRepository(OaiPmhRepository r)
      OSGi DI.
    • setSecurityService

      public void setSecurityService(SecurityService securityService)
      OSGi DI.
    • activate

      public void activate(org.osgi.service.component.ComponentContext cc) throws org.osgi.service.cm.ConfigurationException
      OSGi component activation.
      Throws:
      org.osgi.service.cm.ConfigurationException
    • modified

      public void modified(org.osgi.service.component.ComponentContext cc) throws org.osgi.service.cm.ConfigurationException
      Throws:
      org.osgi.service.cm.ConfigurationException
    • deactivate

      public void deactivate()
    • updated

      public void updated(Dictionary<String,?> properties) throws org.osgi.service.cm.ConfigurationException
      Called by the ConfigurationAdmin service. This method actually sets up the server.
      Throws:
      org.osgi.service.cm.ConfigurationException
    • doGet

      protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
      Overrides:
      doGet in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • doPost

      protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
      Overrides:
      doPost in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • repositoryId

      public static Optional<String> repositoryId(javax.servlet.http.HttpServletRequest req, String mountPoint)
      Retrieve the repository id from the requested path.
      Parameters:
      req - the HTTP request
      mountPoint - the base path of the OAI-PMH server, e.g. /oaipmh
    • hasRepo

      public boolean hasRepo(String id)
      Description copied from interface: OaiPmhServerInfo
      Check if the requested repo exists.
      Specified by:
      hasRepo in interface OaiPmhServerInfo
    • getMountPoint

      public String getMountPoint()
      Description copied from interface: OaiPmhServerInfo
      Return the mount point of the server, e.g. /oaipmh. This is not the full base url like http://localhost:8080/oaipmh but only the path.
      Specified by:
      getMountPoint in interface OaiPmhServerInfo