Class SOAP11FaultContextDecoratingErrorHandler

java.lang.Object
org.opensaml.soap.soap11.messaging.impl.SOAP11FaultContextDecoratingErrorHandler
All Implemented Interfaces:
MessageErrorHandler, TypedMessageErrorHandler

public class SOAP11FaultContextDecoratingErrorHandler extends Object implements TypedMessageErrorHandler
An implementation of TypedMessageErrorHandler which simply decorates the supplied MessageContext with a Fault and optionally a WS-Addressing Action URI.

The actual SOAP 1.1. fault is assumed to be emitted later, perhaps directly by a specialized fault-aware MessageEncoder.

  • Field Details

    • handledThrowable

      @Nonnull private Class<? extends Throwable> handledThrowable
      The handled type of Throwable.
    • faultCode

      @Nonnull private QName faultCode
      The fault code to emit.
    • faultString

      @Nonnull private String faultString
      The fault string to emit.
    • faultActor

      @Nullable private String faultActor
      The fault actor to emit.
    • wsAddressingActionURI

      @Nullable private String wsAddressingActionURI
      The WS-Addressing fault action URI to supply via the context.
  • Constructor Details

    • SOAP11FaultContextDecoratingErrorHandler

      public SOAP11FaultContextDecoratingErrorHandler(@Nonnull Class<? extends Throwable> throwable, @Nonnull QName code, @Nonnull String message)
      Constructor.
      Parameters:
      throwable - the handled type of Throwable
      code - the fault code
      message - the fault string
    • SOAP11FaultContextDecoratingErrorHandler

      public SOAP11FaultContextDecoratingErrorHandler(@Nonnull Class<? extends Throwable> throwable, @Nonnull QName code, @Nonnull String message, @Nullable String actor, @Nullable String addressingActionURI)
      Constructor.
      Parameters:
      throwable - the handled type of Throwable
      code - the fault code
      message - the fault string
      actor - the fault actor
      addressingActionURI - the WS-Addressing action URI
  • Method Details

    • handlesError

      public boolean handlesError(@Nonnull Throwable t)
      Indicates whether the message error handle is capable of handling the specified error.
      Specified by:
      handlesError in interface TypedMessageErrorHandler
      Parameters:
      t - the type of error about which to query
      Returns:
      true iff the handle can handle the specified error type
    • handleError

      public boolean handleError(@Nonnull Throwable t, @Nonnull MessageContext messageContext)
      Handle a particular thrown error.
      Specified by:
      handleError in interface MessageErrorHandler
      Parameters:
      t - the error that was thrown
      messageContext - the message context being processed, if available
      Returns:
      true if error was successfully handled, false otherwise