Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added Use cases

...

The Olingo2 component utilizes Apache Olingo version 2.0 APIs to interact with OData 2.0 and 3.0 compliant services. It supports reading feeds, delta feeds, entities, simple and complex properties, links, counts, using custom and OData system query parameters. It supports updating entities, properties, and association links. It also supports submitting queries and change requests as a single OData batch operation. 

...

<complex
OData Resource TypeResource URI from resourcePath and keyPredicateIn or Out Body Type
Entity data model$metadata
org.apache.olingo.odata2.api.edm.Edm
Service document/
org.apache.olingo.odata2.api.servicedocument.ServiceDocument
OData feed<entity-set>
org.apache.olingo.odata2.api.ep.feed.ODataFeed
OData entry<entity-set>(<key-predicate>)
org.apache.olingo.odata2.api.ep.entry.ODataEntry
Simple property<entity-set>(<key-predicate>)/<simple-property>Appropriate Java data type as described by Olingo EdmPropertyComplex
Simple property value<entity-set>(<key-predicate>)/<simple-property>/$valueAppropriate Java data type as described by Olingo EdmProperty
Complex property
java.util.Map<String, Object>
Simple property value<entity-set>(<key-predicate>)/<simple<complex-property>/$valueAppropriate Java data type as described by Olingo EdmProperty
java.util.Map<String, Object>
Zero or one association linkLink<entity-set>(<key-predicate>/$link/<one-to-one-entity-set-property>
String
Links
Zero or many association links<entity-set>(<key-predicate>/$link/<one-to-many-entity-set-property>
java.util.List<String>
Count<resource-uri>/$count
java.lang.Long

...

All result message bodies utilize objects provided by the underlying Apache Olingo 2.0 API used by the Olingo2Component. Producer endpoints can specify the option name for incoming message body in the inBody endpoint URI parameter. For endpoints that return an array or collection, a consumer endpoint will map every element to distinct messages, unless consumer.splitResult is set to false.

Use cases

The following route reads top 5 entries from the Manufacturer feed ordered by ascending Name property. 

from("direct:...")
    .setHeader("CamelOlingo2.$top", "5");
    .to("olingo2://read/Manufacturers?orderBy=Name%20asc");

The following route reads Manufacturer entry using the key property value in incoming id header. 

from("direct:...")
    .setHeader("CamelOlingo2.keyPredicate", header("id"))
    .to("olingo2://read/Manufacturers");

The following route creates Manufacturer entry using the Map<String, Object> in body message. 

from("direct:...")
    .to("olingo2://create/Manufacturers");

The following route polls Manufacturer delta feed every 30 seconds. The bean blah updates the bean paramsBean to add an updated !deltatoken property with the value returned in the ODataDeltaFeed result. Since the initial delta token is not known, the consumer endpoint will produce an ODataFeed value the first time, and ODataDeltaFeed on subsequent polls.