Class CDORestServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.eclipse.emf.cdo.server.rest.servlet.jakarta.CDORestServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public final class CDORestServlet extends jakarta.servlet.http.HttpServlet
Jakarta Servlet adapter for the transport-neutral CDO REST service. A servlet container owns this servlet's lifecycle, threads, connectors, authentication filters, and HTTP server. Register it at any customer-selected mapping such as /cdo/*; the service receives the path relative to that mapping and the supplied HTTP headers. The service can use a configured transport-neutral authenticator, and the container's standard principal is available to authenticators that trust servlet authentication.
Author:
Eike Stepper
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Servlet context attribute used by the no-argument constructor to find the programmatically configured service.

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a servlet for registration through a standard servlet container.
    Creates a servlet bound to a service instance, suitable for programmatic registration in an existing HTTP server.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the service bound at initialization, primarily for containers that inspect servlet instances after registration.
    void
     
    protected void
    service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service

    Methods inherited from class jakarta.servlet.GenericServlet

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

    Methods inherited from class Object

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

    • SERVICE_ATTRIBUTE

      public static final String SERVICE_ATTRIBUTE
      Servlet context attribute used by the no-argument constructor to find the programmatically configured service.
  • Constructor Details

    • CDORestServlet

      public CDORestServlet()
      Creates a servlet for registration through a standard servlet container. Before servlet initialization, the surrounding application must place a CDORestService in the servlet context under SERVICE_ATTRIBUTE.
    • CDORestServlet

      public CDORestServlet(CDORestService service)
      Creates a servlet bound to a service instance, suitable for programmatic registration in an existing HTTP server. The service instance remains owned by the caller and can be shared with other adapters.
      Parameters:
      service - the transport-neutral service to receive requests
  • Method Details

    • getRestService

      public CDORestService getRestService()
      Returns the service bound at initialization, primarily for containers that inspect servlet instances after registration.
      Returns:
      the shared transport-neutral service
    • init

      public void init() throws jakarta.servlet.ServletException
      Overrides:
      init in class jakarta.servlet.GenericServlet
      Throws:
      jakarta.servlet.ServletException
    • service

      protected void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
      Overrides:
      service in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException