|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odata4j.consumer.ODataConsumer
public class ODataConsumer
ODataConsumer
is the client-side interface to an OData service.
Use create(String)
or one of the other static factory methods to connect to an existing OData service.
Nested Class Summary | |
---|---|
static class |
ODataConsumer.Dump
Sends http request and/or response information to standard out. |
Field Summary | |
---|---|
static ODataConsumer.Dump |
dump
Sends http request and/or response information to standard out. |
Method Summary | ||
---|---|---|
static ODataConsumer |
create(FormatType preferredType,
String serviceRootUri)
|
|
static ODataConsumer |
create(FormatType preferredType,
String serviceRootUri,
OClientBehavior... behaviors)
|
|
static ODataConsumer |
create(String serviceRootUri)
Creates a new consumer for the given OData service uri. |
|
static ODataConsumer |
create(String serviceRootUri,
OClientBehavior... behaviors)
Creates a new consumer for the given OData service uri, adding one or more client behaviors. |
|
OCreateRequest<OEntity> |
createEntity(String entitySetName)
Creates a new entity in the given entity-set. |
|
OEntityRequest<Void> |
deleteEntity(OEntity entity)
Deletes an existing entity. |
|
OEntityRequest<Void> |
deleteEntity(String entitySetName,
Object keyValue)
Deletes an existing entity. |
|
OEntityRequest<Void> |
deleteEntity(String entitySetName,
OEntityKey key)
Deletes an existing entity. |
|
|
getEntities(Class<T> entityType,
String entitySetName)
Gets entities from the given entity-set. |
|
OQueryRequest<OEntity> |
getEntities(ORelatedEntitiesLink link)
Gets entities referred to by the given related-entities link. |
|
OQueryRequest<OEntity> |
getEntities(String entitySetName)
Gets entities from the given entity-set. |
|
|
getEntity(Class<T> entityType,
String entitySetName,
Object keyValue)
Gets the entity by entity-set name and entity-key value. |
|
|
getEntity(Class<T> entityType,
String entitySetName,
OEntityKey key)
Gets the entity by entity-set name and entity-key. |
|
OEntityRequest<OEntity> |
getEntity(OEntity entity)
Gets the latest version of an entity using the given entity as a template. |
|
OEntityRequest<OEntity> |
getEntity(ORelatedEntityLink link)
Gets the entity referred to by the given related entity link. |
|
OEntityRequest<OEntity> |
getEntity(String entitySetName,
Object keyValue)
Gets the entity by entity-set name and entity-key value. |
|
OEntityRequest<OEntity> |
getEntity(String entitySetName,
OEntityKey key)
Gets the entity by entity-set name and entity-key. |
|
Enumerable<String> |
getEntitySets()
Lists the names of all top-level entity-sets for the OData service. |
|
EdmDataServices |
getMetadata()
Gets the OData service metadata. |
|
String |
getServiceRootUri()
Gets the OData service uri. |
|
OModifyRequest<OEntity> |
mergeEntity(OEntity entity)
Modifies an existing entity using merge semantics. |
|
OModifyRequest<OEntity> |
mergeEntity(String entitySetName,
Object keyValue)
Modifies an existing entity using merge semantics. |
|
OModifyRequest<OEntity> |
mergeEntity(String entitySetName,
OEntityKey key)
Modifies an existing entity using merge semantics. |
|
OModifyRequest<OEntity> |
updateEntity(OEntity entity)
Modifies an existing entity using update semantics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ODataConsumer.Dump dump
Method Detail |
---|
public static ODataConsumer create(FormatType preferredType, String serviceRootUri)
public static ODataConsumer create(FormatType preferredType, String serviceRootUri, OClientBehavior... behaviors)
public static ODataConsumer create(String serviceRootUri)
serviceRootUri
- the service uri e.g. http://services.odata.org/Northwind/Northwind.svc/
public static ODataConsumer create(String serviceRootUri, OClientBehavior... behaviors)
serviceRootUri
- the service uri e.g. http://services.odata.org/Northwind/Northwind.svc/
behaviors
- one or more client behaviors
public OCreateRequest<OEntity> createEntity(String entitySetName)
The create-request builder returned can be used to construct the new entity. Call OCreateRequest.execute()
to issue request.
entitySetName
- the name of the entity-set
public OEntityRequest<Void> deleteEntity(OEntity entity)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
entity
- the entity identity
public OEntityRequest<Void> deleteEntity(String entitySetName, Object keyValue)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
entitySetName
- the entity identity entity-set namekeyValue
- the entity identity key value
public OEntityRequest<Void> deleteEntity(String entitySetName, OEntityKey key)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
entitySetName
- the entity identity entity-set namekey
- the entity identity key
public <T> OQueryRequest<T> getEntities(Class<T> entityType, String entitySetName)
The query-request builder returned can be used for further server-side filtering. Call OQueryRequest.execute()
or simply iterate to issue request.
T
- the entity representation as a java typeentityType
- the entity representation as a java typeentitySetName
- the entity-set name
public OQueryRequest<OEntity> getEntities(ORelatedEntitiesLink link)
The query-request builder returned can be used for further server-side filtering. Call OQueryRequest.execute()
or simply iterate to issue request.
link
- the link
public OQueryRequest<OEntity> getEntities(String entitySetName)
The query-request builder returned can be used for further server-side filtering. Call OQueryRequest.execute()
or simply iterate to issue request.
entitySetName
- the entity-set name
public <T> OEntityRequest<T> getEntity(Class<T> entityType, String entitySetName, Object keyValue)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
T
- the entity representation as a java typeentityType
- the entity representation as a java typeentitySetName
- the name of the entity-setkeyValue
- the entity-key value
public <T> OEntityRequest<T> getEntity(Class<T> entityType, String entitySetName, OEntityKey key)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
T
- the entity representation as a java typeentityType
- the entity representation as a java typeentitySetName
- the name of the entity-setkey
- the entity-key
public OEntityRequest<OEntity> getEntity(OEntity entity)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
entity
- an existing entity to use as a template, using its entity-set and entity-key
public OEntityRequest<OEntity> getEntity(ORelatedEntityLink link)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
link
- the link
public OEntityRequest<OEntity> getEntity(String entitySetName, Object keyValue)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
entitySetName
- the name of the entity-setkeyValue
- the entity-key value
public OEntityRequest<OEntity> getEntity(String entitySetName, OEntityKey key)
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
entitySetName
- the name of the entity-setkey
- the entity-key
public Enumerable<String> getEntitySets()
public EdmDataServices getMetadata()
public String getServiceRootUri()
e.g. http://services.odata.org/Northwind/Northwind.svc/
public OModifyRequest<OEntity> mergeEntity(OEntity entity)
The modification-request builder returned can be used to modify the new entity. Call OModifyRequest.execute()
to issue request.
entity
- the entity identity
public OModifyRequest<OEntity> mergeEntity(String entitySetName, Object keyValue)
The modification-request builder returned can be used to modify the new entity. Call OModifyRequest.execute()
to issue request.
entitySetName
- the entity identity entity-set namekeyValue
- the entity identity key value
public OModifyRequest<OEntity> mergeEntity(String entitySetName, OEntityKey key)
The modification-request builder returned can be used to modify the new entity. Call OModifyRequest.execute()
to issue request.
entitySetName
- the entity identity entity-set namekey
- the entity identity key
public OModifyRequest<OEntity> updateEntity(OEntity entity)
The modification-request builder returned can be used to redefine the new entity. Call OModifyRequest.execute()
to issue request.
entity
- the entity identity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |