Class AddSOAPFault

    • Field Detail

      • log

        @Nonnull
        private org.slf4j.Logger log
        Class logger.
      • contextFaultStrategy

        @Nullable
        private Function<ProfileRequestContext,​Fault> contextFaultStrategy
        Strategy for resolving a fault instance directly from the request context.
      • detailedErrorsCondition

        @Nonnull
        private Predicate<ProfileRequestContext> detailedErrorsCondition
        Predicate determining whether detailed error information is permitted.
      • defaultFaultCode

        @Nonnull
        @NonnullElements
        private QName defaultFaultCode
        Default fault codes to insert.
      • faultString

        @Nullable
        private String faultString
        A default fault string to include.
      • detailedErrors

        private boolean detailedErrors
        Whether to include detailed status information.
      • nullifyOutboundMessage

        private boolean nullifyOutboundMessage
        Whether to set the outbound message context's message property to null.
    • Constructor Detail

      • AddSOAPFault

        public AddSOAPFault()
        Constructor.
    • Method Detail

      • setNullifyOutboundMessage

        public void setNullifyOutboundMessage​(boolean flag)
        Set the flag indicating whether to set the outbound message context's message property to null.

        Default is: true

        Parameters:
        flag - true if should nullify, false if not
      • setContextFaultStrategy

        public void setContextFaultStrategy​(@Nullable
                                            Function<ProfileRequestContext,​Fault> strategy)
        Set the optional strategy used to resolve a Fault instance directly from the request context.
        Parameters:
        strategy - strategy used to resolve the fault instance
      • setDetailedErrorsCondition

        public void setDetailedErrorsCondition​(@Nonnull
                                               Predicate<ProfileRequestContext> condition)
        Set the predicate used to determine the detailed errors condition.
        Parameters:
        condition - predicate for detailed errors condition
      • setFaultCodeLookupStrategy

        public void setFaultCodeLookupStrategy​(@Nullable
                                               Function<ProfileRequestContext,​QName> strategy)
        Set the optional strategy used to obtain a faultcode to include.
        Parameters:
        strategy - strategy used to obtain faultcode
      • setFaultStringLookupStrategy

        public void setFaultStringLookupStrategy​(@Nullable
                                                 Function<ProfileRequestContext,​String> strategy)
        Set the optional strategy used to obtain a faultstring to include.
        Parameters:
        strategy - strategy used to obtain a fault string
      • setFaultCode

        public void setFaultCode​(@Nonnull
                                 QName code)
        Set the default faultcode to insert.
        Parameters:
        code - faultcode
      • setFaultString

        public void setFaultString​(@Nullable
                                   String message)
        Set a default faultstring to use in the event that error detail is off, or no specific message is obtained.
        Parameters:
        message - default faultstring
      • resolveContextFault

        @Nullable
        private Fault resolveContextFault​(ProfileRequestContext profileRequestContext)
        Resolve a Fault instance stored in the ProfileRequestContext.
        Parameters:
        profileRequestContext - the current request context
        Returns:
        the fault instance resolved from the request context, or null
      • buildNewMappedFault

        @Nonnull
        private Fault buildNewMappedFault​(ProfileRequestContext profileRequestContext)
        Build and return a new Fault based on configured mapping strategy.
        Parameters:
        profileRequestContext - the current request context
        Returns:
        the new fault
      • buildFaultString

        private void buildFaultString​(@Nonnull
                                      Fault fault,
                                      @Nonnull @NotEmpty
                                      String message)
        Build and attach FaultString element.
        Parameters:
        fault - the element to attach to
        message - the message to set