uk.org.ogsadai.client.toolkit.exception
Class FaultToException

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.exception.FaultToException

public class FaultToException
extends java.lang.Object

A collection of static methods for converting uk.org.ogsadai.client.toolkit.service.faults into OGSA-DAI client toolkit exceptions.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
 
Constructor Summary
FaultToException()
           
 
Method Summary
static AuthorisationException getAuthorisationException(AuthorisationFaultType fault)
          Return a AuthorisationException corresponding to a AuthorisationFaultType.
static RequestException getRequestException(RequestFaultType fault)
          Return a RequestException corresponding to a server-side fault.
static ResourceBusyException getResourceBusyException(ResourceBusyFaultType fault)
          Return a ResourceBusyException corresponding to a ResourceBusyFaultType.
static ResourceUnknownException getResourceUnknownException(ResourceUnknownFaultType fault)
          Return a ResourceUnknownException corresponding to a ResourceUnknownFaultType.
static ResourceUnknownException getResourceUnknownException(ResourceUnknownFaultType fault)
          Return a ResourceUnknownException corresponding to a ResourceUnknownFaultType.
static ServerException getServerException(InternalFaultType fault)
          Return a ServerException corresponding to a InternalFaultType.
private static RequestException getSoloRequestException(ComplexFaultType fault)
          Return a RequestException corresponding to a server-side fault.
static UnknownPropertyException getUnknownPropertyException(InvalidResourcePropertyQNameFaultType fault)
          Return a UnknownPropertyException corresponding to an InvalidResourcePropertyQNameFaultType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values
Constructor Detail

FaultToException

public FaultToException()
Method Detail

getServerException

public static ServerException getServerException(InternalFaultType fault)
Return a ServerException corresponding to a InternalFaultType.

Parameters:
fault - InternalFaultType
Returns:
exception corresponding to the fault

getAuthorisationException

public static AuthorisationException getAuthorisationException(AuthorisationFaultType fault)
Return a AuthorisationException corresponding to a AuthorisationFaultType.

Parameters:
fault - AuthorisationFaultType
Returns:
exception corresponding to the fault

getResourceBusyException

public static ResourceBusyException getResourceBusyException(ResourceBusyFaultType fault)
Return a ResourceBusyException corresponding to a ResourceBusyFaultType.

Parameters:
fault - ResourceBusyFaultType.
Returns:
exception corresponding to the fault

getResourceUnknownException

public static ResourceUnknownException getResourceUnknownException(ResourceUnknownFaultType fault)
Return a ResourceUnknownException corresponding to a ResourceUnknownFaultType.

Parameters:
fault - ResourceUnknownFaultType.
Returns:
exception corresponding to the fault

getResourceUnknownException

public static ResourceUnknownException getResourceUnknownException(ResourceUnknownFaultType fault)
Return a ResourceUnknownException corresponding to a ResourceUnknownFaultType.

Parameters:
fault - ResourceUnknownFaultType.
Returns:
exception corresponding to the fault

getUnknownPropertyException

public static UnknownPropertyException getUnknownPropertyException(InvalidResourcePropertyQNameFaultType fault)
Return a UnknownPropertyException corresponding to an InvalidResourcePropertyQNameFaultType.

Parameters:
fault - InvalidResourcePropertyQNameFaultType.
Returns:
exception corresponding to the fault

getRequestException

public static RequestException getRequestException(RequestFaultType fault)
Return a RequestException corresponding to a server-side fault.

If the fault was caused by one of

then the associated sub-exception of RequestException is returned directly (see getSoloRequestException(ReasonFaultType)).

Otherwise, from the causes of the fault, as recorded within the fault, a causal chain of sub-exceptions is attached to the RequestException using java.lang.Throwable.initCause(e).

Parameters:
fault - Fault from server.
Returns:
exception corresponding to the fault.

getSoloRequestException

private static RequestException getSoloRequestException(ComplexFaultType fault)
Return a RequestException corresponding to a server-side fault.

Parameters:
fault - Fault from server.
Returns:
exception corresponding to the fault.