org.odata4j.consumer
Class AbstractODataClient

java.lang.Object
  extended by org.odata4j.consumer.AbstractODataClient
All Implemented Interfaces:
ODataClient
Direct Known Subclasses:
ODataCxfClient

public abstract class AbstractODataClient
extends Object
implements ODataClient

Useful base class for ODataClient implementations with common functionality.


Constructor Summary
protected AbstractODataClient(FormatType formatType)
           
 
Method Summary
 ODataClientResponse callFunction(ODataClientRequest request)
           
 ODataClientResponse createEntity(ODataClientRequest request)
           
 void createLink(ODataClientRequest request)
           
 Entry createRequestEntry(EdmEntitySet entitySet, OEntityKey entityKey, List<OProperty<?>> props, List<OLink> links)
           
 void deleteEntity(ODataClientRequest request)
           
 void deleteLink(ODataClientRequest request)
           
protected abstract  ODataClientResponse doRequest(FormatType reqType, ODataClientRequest request, Response.StatusType... expectedResponseStatus)
           
 Iterable<AtomCollectionInfo> getCollections(ODataClientRequest request)
           
 ODataClientResponse getEntities(ODataClientRequest request)
           
 ODataClientResponse getEntity(ODataClientRequest request)
           
 FormatType getFormatType()
           
 Iterable<SingleLink> getLinks(ODataClientRequest request)
           
 EdmDataServices getMetadata(ODataClientRequest request)
           
protected abstract  XMLEventReader2 toXml(ODataClientResponse response)
           
 void updateEntity(ODataClientRequest request)
           
 void updateLink(ODataClientRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.odata4j.consumer.ODataClient
getFeedReader, requestBody
 

Constructor Detail

AbstractODataClient

protected AbstractODataClient(FormatType formatType)
Method Detail

callFunction

public ODataClientResponse callFunction(ODataClientRequest request)
                                 throws ODataProducerException
Specified by:
callFunction in interface ODataClient
Throws:
ODataProducerException

createEntity

public ODataClientResponse createEntity(ODataClientRequest request)
                                 throws ODataProducerException
Specified by:
createEntity in interface ODataClient
Throws:
ODataProducerException

createLink

public void createLink(ODataClientRequest request)
                throws ODataProducerException
Specified by:
createLink in interface ODataClient
Throws:
ODataProducerException

createRequestEntry

public Entry createRequestEntry(EdmEntitySet entitySet,
                                OEntityKey entityKey,
                                List<OProperty<?>> props,
                                List<OLink> links)
Specified by:
createRequestEntry in interface ODataClient

deleteEntity

public void deleteEntity(ODataClientRequest request)
                  throws ODataProducerException
Specified by:
deleteEntity in interface ODataClient
Throws:
ODataProducerException

deleteLink

public void deleteLink(ODataClientRequest request)
                throws ODataProducerException
Specified by:
deleteLink in interface ODataClient
Throws:
ODataProducerException

doRequest

protected abstract ODataClientResponse doRequest(FormatType reqType,
                                                 ODataClientRequest request,
                                                 Response.StatusType... expectedResponseStatus)
                                          throws ODataProducerException
Throws:
ODataProducerException

getCollections

public Iterable<AtomCollectionInfo> getCollections(ODataClientRequest request)
                                            throws ODataProducerException
Specified by:
getCollections in interface ODataClient
Throws:
ODataProducerException

getEntities

public ODataClientResponse getEntities(ODataClientRequest request)
                                throws ODataProducerException
Specified by:
getEntities in interface ODataClient
Throws:
ODataProducerException

getEntity

public ODataClientResponse getEntity(ODataClientRequest request)
                              throws ODataProducerException
Specified by:
getEntity in interface ODataClient
Throws:
ODataProducerException

getFormatType

public FormatType getFormatType()
Specified by:
getFormatType in interface ODataClient

getLinks

public Iterable<SingleLink> getLinks(ODataClientRequest request)
                              throws ODataProducerException
Specified by:
getLinks in interface ODataClient
Throws:
ODataProducerException

getMetadata

public EdmDataServices getMetadata(ODataClientRequest request)
                            throws ODataProducerException
Specified by:
getMetadata in interface ODataClient
Throws:
ODataProducerException

toXml

protected abstract XMLEventReader2 toXml(ODataClientResponse response)

updateEntity

public void updateEntity(ODataClientRequest request)
                  throws ODataProducerException
Specified by:
updateEntity in interface ODataClient
Throws:
ODataProducerException

updateLink

public void updateLink(ODataClientRequest request)
                throws ODataProducerException
Specified by:
updateLink in interface ODataClient
Throws:
ODataProducerException


http://odata4j.org