|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.odata4j.consumer.AbstractODataConsumer
public abstract class AbstractODataConsumer
Useful base class for ODataConsumer
implementations with common functionality.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.odata4j.consumer.ODataConsumer |
---|
ODataConsumer.Builder, ODataConsumer.Dump |
Field Summary |
---|
Fields inherited from interface org.odata4j.consumer.ODataConsumer |
---|
dump |
Constructor Summary | |
---|---|
protected |
AbstractODataConsumer(String serviceRootUri)
|
Method Summary | ||
---|---|---|
OFunctionRequest<OObject> |
callFunction(String functionName)
Call a server-side function (also known as a service operation). |
|
OCreateRequest<OEntity> |
createEntity(String entitySetName)
Creates a new entity in the given entity-set. |
|
OEntityRequest<Void> |
createLink(OEntityId sourceEntity,
String targetNavProp,
OEntityId targetEntity)
Creates a new related entity link between two entities. |
|
OEntityDeleteRequest |
deleteEntity(OEntity entity)
Deletes an existing entity. |
|
OEntityDeleteRequest |
deleteEntity(String entitySetName,
Object keyValue)
Deletes an existing entity. |
|
OEntityDeleteRequest |
deleteEntity(String entitySetName,
OEntityKey key)
Deletes an existing entity. |
|
OEntityRequest<Void> |
deleteLink(OEntityId sourceEntity,
String targetNavProp,
Object... targetKeyValues)
Deletes related entity links between two entities by navigation property. |
|
protected abstract ODataClient |
getClient()
|
|
|
getEntities(Class<T> entityType,
String entitySetHref)
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 entitySetHref)
Gets entities from the given entity-set. |
|
OCountRequest |
getEntitiesCount(String entitySetName)
Returns a single value request which can be extended by query options. |
|
|
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. |
|
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. |
|
OEntityGetRequest<OEntity> |
getEntity(String entitySetName,
Object keyValue)
Gets the entity by entity-set name and entity-key value. |
|
OEntityGetRequest<OEntity> |
getEntity(String entitySetName,
OEntityKey key)
Gets the entity by entity-set name and entity-key. |
|
Enumerable<EntitySetInfo> |
getEntitySets()
Lists all top-level entity-sets for the OData service. |
|
OQueryRequest<OEntityId> |
getLinks(OEntityId sourceEntity,
String targetNavProp)
Gets related entity links for a given source entity by navigation property. |
|
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> |
mergeEntity(String entitySetName,
OEntityKey key,
String entityTag)
|
|
OModifyRequest<OEntity> |
updateEntity(OEntity entity)
Modifies an existing entity using update semantics. |
|
OEntityRequest<Void> |
updateLink(OEntityId sourceEntity,
OEntityId newTargetEntity,
String targetNavProp,
Object... oldTargetKeyValues)
Updates related entity links between two entities by navigation property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractODataConsumer(String serviceRootUri)
Method Detail |
---|
public OFunctionRequest<OObject> callFunction(String functionName)
ODataConsumer
The functioncall-request builder returned can be used to add parameters. Call OQueryRequest.execute()
to issue request.
callFunction
in interface ODataConsumer
functionName
- the function name
public OCreateRequest<OEntity> createEntity(String entitySetName)
ODataConsumer
The create-request builder returned can be used to construct the new entity. Call OCreateRequest.execute()
to issue request.
createEntity
in interface ODataConsumer
entitySetName
- the name of the entity-set
public OEntityRequest<Void> createLink(OEntityId sourceEntity, String targetNavProp, OEntityId targetEntity)
ODataConsumer
Call OEntityRequest.execute()
on the returned request builder to issue request.
createLink
in interface ODataConsumer
sourceEntity
- the entity to start fromtargetNavProp
- the relationship navigation propertytargetEntity
- the entity to use as the target of the relationship
public OEntityDeleteRequest deleteEntity(OEntity entity)
ODataConsumer
The delete-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
deleteEntity
in interface ODataConsumer
entity
- the entity identity
public OEntityDeleteRequest deleteEntity(String entitySetName, Object keyValue)
ODataConsumer
The delete-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
deleteEntity
in interface ODataConsumer
entitySetName
- the entity identity entity-set namekeyValue
- the entity identity key value
public OEntityDeleteRequest deleteEntity(String entitySetName, OEntityKey key)
ODataConsumer
The delete-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
deleteEntity
in interface ODataConsumer
entitySetName
- the entity identity entity-set namekey
- the entity identity key
public OEntityRequest<Void> deleteLink(OEntityId sourceEntity, String targetNavProp, Object... targetKeyValues)
ODataConsumer
Call OEntityRequest.execute()
on the returned request builder to issue request.
deleteLink
in interface ODataConsumer
sourceEntity
- the entity to start fromtargetNavProp
- the relationship navigation propertytargetKeyValues
- the target entity-key, applicable if the navigation property represents a collection
protected abstract ODataClient getClient()
public <T> OQueryRequest<T> getEntities(Class<T> entityType, String entitySetHref)
ODataConsumer
The query-request builder returned can be used for further server-side filtering. Call OQueryRequest.execute()
to issue request.
getEntities
in interface ODataConsumer
T
- the entity representation as a java typeentityType
- the entity representation as a java typeentitySetHref
- the entity-set href
public OQueryRequest<OEntity> getEntities(ORelatedEntitiesLink link)
ODataConsumer
The query-request builder returned can be used for further server-side filtering. Call OQueryRequest.execute()
to issue request.
getEntities
in interface ODataConsumer
link
- the link
public OQueryRequest<OEntity> getEntities(String entitySetHref)
ODataConsumer
The query-request builder returned can be used for further server-side filtering. Call OQueryRequest.execute()
to issue request.
getEntities
in interface ODataConsumer
entitySetHref
- the entity-set href
public OCountRequest getEntitiesCount(String entitySetName)
ODataConsumer
getEntitiesCount
in interface ODataConsumer
entitySetName
- the entity identity entity-set name
public <T> OEntityGetRequest<T> getEntity(Class<T> entityType, String entitySetName, Object keyValue)
ODataConsumer
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
getEntity
in interface ODataConsumer
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> OEntityGetRequest<T> getEntity(Class<T> entityType, String entitySetName, OEntityKey key)
ODataConsumer
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
getEntity
in interface ODataConsumer
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 OEntityGetRequest<OEntity> getEntity(OEntity entity)
ODataConsumer
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
getEntity
in interface ODataConsumer
entity
- an existing entity to use as a template, using its entity-set and entity-key
public OEntityGetRequest<OEntity> getEntity(ORelatedEntityLink link)
ODataConsumer
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
getEntity
in interface ODataConsumer
link
- the link
public OEntityGetRequest<OEntity> getEntity(String entitySetName, Object keyValue)
ODataConsumer
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
getEntity
in interface ODataConsumer
entitySetName
- the name of the entity-setkeyValue
- the entity-key value
public OEntityGetRequest<OEntity> getEntity(String entitySetName, OEntityKey key)
ODataConsumer
The entity-request builder returned can be used for further navigation. Call OEntityRequest.execute()
to issue request.
getEntity
in interface ODataConsumer
entitySetName
- the name of the entity-setkey
- the entity-key
public Enumerable<EntitySetInfo> getEntitySets() throws ODataProducerException
ODataConsumer
getEntitySets
in interface ODataConsumer
ODataProducerException
- error from the producerpublic OQueryRequest<OEntityId> getLinks(OEntityId sourceEntity, String targetNavProp)
ODataConsumer
The entityid-request builder returned can be used for further server-side filtering. Call OQueryRequest.execute()
to issue request.
getLinks
in interface ODataConsumer
sourceEntity
- the entity to start fromtargetNavProp
- the relationship navigation property
public EdmDataServices getMetadata()
ODataConsumer
getMetadata
in interface ODataConsumer
public String getServiceRootUri()
ODataConsumer
e.g. http://services.odata.org/Northwind/Northwind.svc/
getServiceRootUri
in interface ODataConsumer
public OModifyRequest<OEntity> mergeEntity(OEntity entity)
ODataConsumer
The modification-request builder returned can be used to modify the new entity. Call OModifyRequest.execute()
to issue request.
mergeEntity
in interface ODataConsumer
entity
- the entity identity
public OModifyRequest<OEntity> mergeEntity(String entitySetName, Object keyValue)
ODataConsumer
The modification-request builder returned can be used to modify the new entity. Call OModifyRequest.execute()
to issue request.
mergeEntity
in interface ODataConsumer
entitySetName
- the entity identity entity-set namekeyValue
- the entity identity key value
public OModifyRequest<OEntity> mergeEntity(String entitySetName, OEntityKey key)
ODataConsumer
The modification-request builder returned can be used to modify the new entity. Call OModifyRequest.execute()
to issue request.
mergeEntity
in interface ODataConsumer
entitySetName
- the entity identity entity-set namekey
- the entity identity key
public OModifyRequest<OEntity> mergeEntity(String entitySetName, OEntityKey key, String entityTag)
public OModifyRequest<OEntity> updateEntity(OEntity entity)
ODataConsumer
The modification-request builder returned can be used to redefine the new entity. Call OModifyRequest.execute()
to issue request.
updateEntity
in interface ODataConsumer
entity
- the entity identity
public OEntityRequest<Void> updateLink(OEntityId sourceEntity, OEntityId newTargetEntity, String targetNavProp, Object... oldTargetKeyValues)
ODataConsumer
Call OEntityRequest.execute()
on the returned request builder to issue request.
updateLink
in interface ODataConsumer
sourceEntity
- the entity to start fromnewTargetEntity
- the entity to use as the new target of the relationshiptargetNavProp
- the relationship navigation propertyoldTargetKeyValues
- the target entity-key, applicable if the navigation property represents a collection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |