com.sap.ecm.api

## Class AbstractCmisProxyServlet

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - com.sap.ecm.api.AbstractCmisProxyServlet

- All Implemented Interfaces:
    Serializable, Servlet, ServletConfig

      public abstract class AbstractCmisProxyServlet
      extends HttpServlet

  Abstract CMIS Proxy Servlet.

  This servlet forwards CMIS requests to the SAP HANA Cloud document service.

  Usage:

  - Create a servlet that extends this class.
  - Implement at least the methods `getRepositoryUniqueName()` and `getRepositoryKey()`.
  - If you override the `init(ServletConfig)` method, make sure you call `super.init(ServletConfig)`.
  - Add your servlet to the web.xml.

  Sample web.xml snippet:

       <servlet>
         <servlet-name>cmisproxy</servlet-name>
         <servlet-class>my.app.CMISProxyServlet</servlet-class>
       </servlet>

       <servlet-mapping>
         <servlet-name>cmisproxy</servlet-name>
         <url-pattern>/cmis/*</url-pattern>
       </servlet-mapping>

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractCmisProxyServlet()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `authenticate(HttpServletRequest request, HttpServletResponse response)` Checks the user or the credentials that are included in the request.
    `protected int` | `getConnectTimeout()` Returns the connect timeout in milliseconds.
    `protected String` | `getDestinationName()` Returns the destination name.
    `protected int` | `getReadTimeout()` Returns the read timeout in milliseconds.
    `protected abstract String` | `getRepositoryKey()` Returns the repository key.
    `protected abstract String` | `getRepositoryUniqueName()` Returns the repository unique name.
    `void` | `init(ServletConfig config)`
    `protected boolean` | `readOnlyMode()` Indicates if the proxy should only forward read-only Browser binding requests.
    `protected boolean` | `requireAuthentication()` Indicates if the request must be authenticated.
    `protected void` | `service(HttpServletRequest request, HttpServletResponse response)`
    `protected boolean` | `supportAtomPubBinding()` Indicates if the CMIS AtomPub Binding should be exposed.
    `protected boolean` | `supportBrowserBinding()` Indicates if the CMIS Browser Binding should be exposed.
    `protected boolean` | `supportCMIS_1_0()` Indicates if the CMIS 1.0 endpoints should be exposed.
    `protected boolean` | `supportCMIS_1_1()` Indicates if the CMIS 1.1 endpoints should be exposed.
    `protected boolean` | `supportWebServicesBinding()` Indicates if the CMIS Web Services Binding should be exposed.

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service`

    - ### Methods inherited from class javax.servlet.GenericServlet

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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractCmisProxyServlet

          public AbstractCmisProxyServlet()

  - ### Method Detail

    - #### init

          public void init(ServletConfig config)
                    throws ServletException

      Specified by:
        `init` in interface `Servlet`
      Overrides:
        `init` in class `GenericServlet`
      Throws:
        `ServletException`

    - #### service

          protected void service(HttpServletRequest request,
                     HttpServletResponse response)
                          throws ServletException,
                                 IOException

      Overrides:
        `service` in class `HttpServlet`
      Throws:
        `ServletException`
        `IOException`

    - #### getDestinationName

          protected String getDestinationName()

      Returns the destination name. Default: `null`
      Returns:
        the destination name or `null` for the default destination.

    - #### getRepositoryUniqueName

          protected abstract String getRepositoryUniqueName()

      Returns the repository unique name.
      Returns:
        the repository unique name

    - #### getRepositoryKey

          protected abstract String getRepositoryKey()

      Returns the repository key. If a repository unique name is provided, then this method must not return `null`.
      Returns:
        the repository key

    - #### supportWebServicesBinding

          protected boolean supportWebServicesBinding()

      Indicates if the CMIS Web Services Binding should be exposed. Default: `true`
      Returns:
        `true` if the CMIS Web Services Binding should be exposed, `false` otherwise

    - #### supportAtomPubBinding

          protected boolean supportAtomPubBinding()

      Indicates if the CMIS AtomPub Binding should be exposed. Default: `true`
      Returns:
        `true` if the CMIS AtomPub Binding should be exposed, `false` otherwise

    - #### supportBrowserBinding

          protected boolean supportBrowserBinding()

      Indicates if the CMIS Browser Binding should be exposed. Default: `true`
      Returns:
        `true` if the CMIS Browser Binding should be exposed, `false` otherwise

    - #### supportCMIS_1_0

          protected boolean supportCMIS_1_0()

      Indicates if the CMIS 1.0 endpoints should be exposed. Default: `true`
      Returns:
        `true` if CMIS 1.0 endpoints should be exposed, `false` otherwise

    - #### supportCMIS_1_1

          protected boolean supportCMIS_1_1()

      Indicates if the CMIS 1.1 endpoints should be exposed. Default: `true`
      Returns:
        `true` if CMIS 1.1 endpoints should be exposed, `false` otherwise

    - #### requireAuthentication

          protected boolean requireAuthentication()

      Indicates if the request must be authenticated. If this method returns `true`, the method `authenticate(HttpServletRequest, HttpServletResponse)` is called to handle the authentication of the user. Default: `true`
      Returns:
        `true` if user authentication is required, `false` if anonymous access should be granted

    - #### authenticate

          protected String authenticate(HttpServletRequest request,
                            HttpServletResponse response)
                                 throws LoginException

      Checks the user or the credentials that are included in the request. If this method throws an exception, the request processing is stopped. The default implementation checks if the platform delivered a remote user. If not, it asks for credentials via basic authentication.
      Parameters:
        `request` - the HTTP request object
        `response` - the HTTP response object
      Returns:
        the user id or `null` for anonymous login
      Throws:
        `LoginException` - if the authentication failed

    - #### readOnlyMode

          protected boolean readOnlyMode()

      Indicates if the proxy should only forward read-only Browser binding requests. Default: `false`
      Returns:
        `true` if only read-only request should be forwarded, `false` for full access

    - #### getConnectTimeout

          protected int getConnectTimeout()

      Returns the connect timeout in milliseconds. Default: 30,000 milliseconds

    - #### getReadTimeout

          protected int getReadTimeout()

      Returns the read timeout in milliseconds. Default: 300,000 milliseconds

Copyright © 2016 SAP. All Rights Reserved.