Interface | Description |
---|---|
ODataCallback |
Common OData callback interface.
|
ODataDebugCallback | |
ODataDebugResponseWrapperCallback |
Debug handler.
|
ODataService |
Root interface for a custom OData service.
|
Class | Description |
---|---|
ODataServiceFactory |
Creates instance of custom OData service.
|
ODataServiceVersion |
This class is a container for the supported ODataServiceVersions.
|
OData Library is a protocol implementation of the OData V2.0 standard. For details of this standard see odata.org.
This API is intended to implement an OData service. An OData service consists of a metadata provider implementation and an OData processor implementation.
An OData service can be exposed by a web application. For the runntime one JAX-RS implementation is needed and the core implementation library of this API. Apache CXF for example is one such JAX-RS implementation.
Entry point to the service is a JAX-RS servlet. At this servlet init parameters for a
ODataServiceFactory
is configured. The parameter javax.ws.rs.Application
is a default by JAX-RS and has to be present
always.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Example OData Service</display-name>
<servlet>
<servlet-name>MyODataServlet</servlet-name>
<servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>org.apache.olingo.odata2.core.rest.app.ODataApplication</param-value>
</init-param>
<init-param>
<param-name>org.apache.olingo.odata2.service.factory</param-name>
<param-value>com.sample.service.MyServiceFactory</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyODataServlet</servlet-name>
<url-pattern>/MyService.svc/*</url-pattern>
</servlet-mapping>
</web-app>
This factory produces the service, a metadata provider and the data processor. The provider, typically
a derivative of the class EdmProvider
provides the metadata of the service. The processor implements a
variety of service interfaces, and provides the data of the service. The processor is typically
a derivative of the class ODataSingleProcessor
which can be used together with the class
ODataSingleService
.
Copyright © 2013-2017 The Apache Software Foundation. All Rights Reserved.