public abstract class

AbstractODataConsumer

extends Object
implements ODataConsumer
java.lang.Object
   ↳ org.odata4j.consumer.AbstractODataConsumer
Known Direct Subclasses

Summary

Fields
private String serviceRootUri
[Expand]
Inherited Fields
From interface org.odata4j.consumer.ODataConsumer
Protected Constructors
AbstractODataConsumer(String serviceRootUri)
Public Methods
OQueryRequest<OEntity> getEntities(String entitySetHref)
Gets entities from the given entity-set.
OQueryRequest<OEntity> getEntities(ORelatedEntitiesLink link)
Gets entities referred to by the given related-entities link.
OEntityGetRequest<OEntity> getEntity(String entitySetName, OEntityKey key)
Gets the entity by entity-set name and entity-key.
OEntityGetRequest<OEntity> getEntity(OEntity entity)
Gets the latest version of an entity using the given entity as a template.
OEntityGetRequest<OEntity> getEntity(ORelatedEntityLink link)
Gets the entity referred to by the given related entity link.
<T> OEntityGetRequest<T> getEntity(Class<T> entityType, String entitySetName, Object keyValue)
Gets the entity by entity-set name and entity-key value.
OEntityGetRequest<OEntity> getEntity(String entitySetName, Object keyValue)
Gets the entity by entity-set name and entity-key value.
String getServiceRootUri()
Gets the OData service uri.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.odata4j.consumer.ODataConsumer

Fields

private String serviceRootUri

Protected Constructors

protected AbstractODataConsumer (String serviceRootUri)

Parameters
serviceRootUri

Public Methods

public OQueryRequest<OEntity> getEntities (String entitySetHref)

Gets entities from the given entity-set.

The query-request builder returned can be used for further server-side filtering. Call execute() or simply iterate to issue request.

Parameters
entitySetHref The entity-set href
Returns
  • a new query-request builder

public OQueryRequest<OEntity> getEntities (ORelatedEntitiesLink link)

Gets entities referred to by the given related-entities link.

The query-request builder returned can be used for further server-side filtering. Call execute() or simply iterate to issue request.

Parameters
link The link
Returns
  • a new query-request builder

public OEntityGetRequest<OEntity> getEntity (String entitySetName, OEntityKey key)

Gets the entity by entity-set name and entity-key.

The entity-request builder returned can be used for further navigation. Call execute() to issue request.

Parameters
entitySetName The name of the entity-set
key The entity-key
Returns
  • a new entity-request builder

public OEntityGetRequest<OEntity> getEntity (OEntity entity)

Gets the latest version of an entity using the given entity as a template.

The entity-request builder returned can be used for further navigation. Call execute() to issue request.

Parameters
entity An existing entity to use as a template, using its entity-set and entity-key
Returns
  • a new entity-request builder

public OEntityGetRequest<OEntity> getEntity (ORelatedEntityLink link)

Gets the entity referred to by the given related entity link.

The entity-request builder returned can be used for further navigation. Call execute() to issue request.

Parameters
link The link
Returns
  • a new entity-request builder

public OEntityGetRequest<T> getEntity (Class<T> entityType, String entitySetName, Object keyValue)

Gets the entity by entity-set name and entity-key value. The entity will be represented as the given java-type.

The entity-request builder returned can be used for further navigation. Call execute() to issue request.

Parameters
entityType The entity representation as a java type
entitySetName The name of the entity-set
keyValue The entity-key value
Returns
  • a new entity-request builder

public OEntityGetRequest<OEntity> getEntity (String entitySetName, Object keyValue)

Gets the entity by entity-set name and entity-key value.

The entity-request builder returned can be used for further navigation. Call execute() to issue request.

Parameters
entitySetName The name of the entity-set
keyValue The entity-key value
Returns
  • a new entity-request builder

public String getServiceRootUri ()

Gets the OData service uri.

e.g. http://services.odata.org/Northwind/Northwind.svc/

Returns
  • the service uri