Class ODataRootLocator
java.lang.Object
org.apache.olingo.odata2.core.rest.ODataRootLocator
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.
/{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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ODataServiceFactorycreateServiceFactoryFromContext(javax.ws.rs.core.Application app, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.ServletConfig servletConfig) inthandleRequest(List<javax.ws.rs.core.PathSegment> pathSegments, String xHttpMethod, String xHttpMethodOverride) Default root behavior which will delegate all paths to a ODataLocator.
-
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 ODataxHttpMethod- HTTP Header X-HTTP-Method for tunneling through POSTxHttpMethodOverride- HTTP Header X-HTTP-Method-Override for tunneling through POST- Returns:
- a locator handling OData protocol
- Throws:
ODataExceptionClassNotFoundExceptionIllegalAccessExceptionInstantiationException
-
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)
-