org.odata4j.exceptions
Class ODataProducerExceptions

java.lang.Object
  extended by org.odata4j.exceptions.ODataProducerExceptions

public class ODataProducerExceptions
extends Object

A static factory to create ODataProducerException instances.

This factory is used after deserialization of error responses retrieved from an OData producer; it returns one of the following exceptions based on the HTTP status of the response:

In case the HTTP status cannot be mapped to a specific sub-class, an unspecific ODataProducerException is thrown.


Method Summary
static void add(ExceptionFactory<?> exceptionFactory)
          Adds an ExceptionFactory and thus makes the created exception available (and catchable) for OData consumers.
static ODataProducerException create(Response.StatusType status, OError error)
          Creates a new ODataProducerException.
static void restore()
          Restores this factory to its initial state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public static void add(ExceptionFactory<?> exceptionFactory)
Adds an ExceptionFactory and thus makes the created exception available (and catchable) for OData consumers.

Parameters:
exceptionFactory - the exception factory to add

create

public static ODataProducerException create(Response.StatusType status,
                                            OError error)
Creates a new ODataProducerException.

Parameters:
status - the HTTP status received in conjunction with this error
error - the OData error message returned by the producer
Returns:
an instance of ODataProducerException

restore

public static void restore()
Restores this factory to its initial state.



http://odata4j.org