Class ODataRootLocator

java.lang.Object
org.apache.olingo.odata2.core.rest.ODataRootLocator

@Path("/") public class ODataRootLocator extends Object
Default OData root locator responsible to handle the whole path and delegate all calls to a sub locator:

/{odata path} e.g. http://host:port/webapp/odata.svc/$metadata
All path segments defined by a servlet mapping belong to the odata uri.

This behavior can be changed:

/{custom path}{odata path} e.g. http://host:port/webapp/bmw/odata.svc/$metadata
The first segment defined by a servlet mapping belong to customer context and the following segments are OData specific.

  • Constructor Details

    • ODataRootLocator

      public ODataRootLocator()
  • Method Details

    • handleRequest

      @Path("/{pathSegments: .*}") public Object handleRequest(@Encoded @PathParam("pathSegments") List<javax.ws.rs.core.PathSegment> pathSegments, @HeaderParam("X-HTTP-Method") String xHttpMethod, @HeaderParam("X-HTTP-Method-Override") String xHttpMethodOverride) throws ODataException, ClassNotFoundException, InstantiationException, IllegalAccessException
      Default root behavior which will delegate all paths to a ODataLocator.
      Parameters:
      pathSegments - URI path segments - all segments have to be OData
      xHttpMethod - HTTP Header X-HTTP-Method for tunneling through POST
      xHttpMethodOverride - HTTP Header X-HTTP-Method-Override for tunneling through POST
      Returns:
      a locator handling OData protocol
      Throws:
      ODataException
      ClassNotFoundException
      IllegalAccessException
      InstantiationException
    • getServiceFactory

      public ODataServiceFactory getServiceFactory()
    • getPathSplit

      public int getPathSplit()
    • createServiceFactoryFromContext

      public static ODataServiceFactory createServiceFactoryFromContext(javax.ws.rs.core.Application app, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.ServletConfig servletConfig)