| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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)
ODataConsumerThe functioncall-request builder returned can be used to add parameters.  Call OQueryRequest.execute() to issue request.
callFunction in interface ODataConsumerfunctionName - the function name
public OCreateRequest<OEntity> createEntity(String entitySetName)
ODataConsumerThe create-request builder returned can be used to construct the new entity.  Call OCreateRequest.execute() to issue request.
createEntity in interface ODataConsumerentitySetName - the name of the entity-set
public OEntityRequest<Void> createLink(OEntityId sourceEntity,
                                       String targetNavProp,
                                       OEntityId targetEntity)
ODataConsumerCall OEntityRequest.execute() on the returned request builder to issue request.
createLink in interface ODataConsumersourceEntity - the entity to start fromtargetNavProp - the relationship navigation propertytargetEntity - the entity to use as the target of the relationship
public OEntityDeleteRequest deleteEntity(OEntity entity)
ODataConsumerThe delete-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
deleteEntity in interface ODataConsumerentity - the entity identity
public OEntityDeleteRequest deleteEntity(String entitySetName,
                                         Object keyValue)
ODataConsumerThe delete-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
deleteEntity in interface ODataConsumerentitySetName - the entity identity entity-set namekeyValue - the entity identity key value
public OEntityDeleteRequest deleteEntity(String entitySetName,
                                         OEntityKey key)
ODataConsumerThe delete-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
deleteEntity in interface ODataConsumerentitySetName - the entity identity entity-set namekey - the entity identity key
public OEntityRequest<Void> deleteLink(OEntityId sourceEntity,
                                       String targetNavProp,
                                       Object... targetKeyValues)
ODataConsumerCall OEntityRequest.execute() on the returned request builder to issue request.
deleteLink in interface ODataConsumersourceEntity - 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)
ODataConsumerThe query-request builder returned can be used for further server-side filtering.  Call OQueryRequest.execute() to issue request.
getEntities in interface ODataConsumerT - the entity representation as a java typeentityType - the entity representation as a java typeentitySetHref - the entity-set href
public OQueryRequest<OEntity> getEntities(ORelatedEntitiesLink link)
ODataConsumerThe query-request builder returned can be used for further server-side filtering.  Call OQueryRequest.execute() to issue request.
getEntities in interface ODataConsumerlink - the link
public OQueryRequest<OEntity> getEntities(String entitySetHref)
ODataConsumerThe query-request builder returned can be used for further server-side filtering.  Call OQueryRequest.execute() to issue request.
getEntities in interface ODataConsumerentitySetHref - the entity-set href
public OCountRequest getEntitiesCount(String entitySetName)
ODataConsumer
getEntitiesCount in interface ODataConsumerentitySetName - the entity identity entity-set name
public <T> OEntityGetRequest<T> getEntity(Class<T> entityType,
                                          String entitySetName,
                                          Object keyValue)
ODataConsumerThe entity-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
getEntity in interface ODataConsumerT - 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)
ODataConsumerThe entity-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
getEntity in interface ODataConsumerT - 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)
ODataConsumerThe entity-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
getEntity in interface ODataConsumerentity - an existing entity to use as a template, using its entity-set and entity-key
public OEntityGetRequest<OEntity> getEntity(ORelatedEntityLink link)
ODataConsumerThe entity-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
getEntity in interface ODataConsumerlink - the link
public OEntityGetRequest<OEntity> getEntity(String entitySetName,
                                            Object keyValue)
ODataConsumerThe entity-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
getEntity in interface ODataConsumerentitySetName - the name of the entity-setkeyValue - the entity-key value
public OEntityGetRequest<OEntity> getEntity(String entitySetName,
                                            OEntityKey key)
ODataConsumerThe entity-request builder returned can be used for further navigation.  Call OEntityRequest.execute() to issue request.
getEntity in interface ODataConsumerentitySetName - the name of the entity-setkey - the entity-key
public Enumerable<EntitySetInfo> getEntitySets()
                                        throws ODataProducerException
ODataConsumer
getEntitySets in interface ODataConsumerODataProducerException - error from the producer
public OQueryRequest<OEntityId> getLinks(OEntityId sourceEntity,
                                         String targetNavProp)
ODataConsumerThe entityid-request builder returned can be used for further server-side filtering.  Call OQueryRequest.execute() to issue request.
getLinks in interface ODataConsumersourceEntity - the entity to start fromtargetNavProp - the relationship navigation property
public EdmDataServices getMetadata()
ODataConsumer
getMetadata in interface ODataConsumerpublic String getServiceRootUri()
ODataConsumere.g. http://services.odata.org/Northwind/Northwind.svc/
getServiceRootUri in interface ODataConsumerpublic OModifyRequest<OEntity> mergeEntity(OEntity entity)
ODataConsumerThe modification-request builder returned can be used to modify the new entity.  Call OModifyRequest.execute() to issue request.
mergeEntity in interface ODataConsumerentity - the entity identity
public OModifyRequest<OEntity> mergeEntity(String entitySetName,
                                           Object keyValue)
ODataConsumerThe modification-request builder returned can be used to modify the new entity.  Call OModifyRequest.execute() to issue request.
mergeEntity in interface ODataConsumerentitySetName - the entity identity entity-set namekeyValue - the entity identity key value
public OModifyRequest<OEntity> mergeEntity(String entitySetName,
                                           OEntityKey key)
ODataConsumerThe modification-request builder returned can be used to modify the new entity.  Call OModifyRequest.execute() to issue request.
mergeEntity in interface ODataConsumerentitySetName - 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)
ODataConsumerThe modification-request builder returned can be used to redefine the new entity.  Call OModifyRequest.execute() to issue request.
updateEntity in interface ODataConsumerentity - the entity identity
public OEntityRequest<Void> updateLink(OEntityId sourceEntity,
                                       OEntityId newTargetEntity,
                                       String targetNavProp,
                                       Object... oldTargetKeyValues)
ODataConsumerCall OEntityRequest.execute() on the returned request builder to issue request.
updateLink in interface ODataConsumersourceEntity - 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 | ||||||||