Class AddSOAPFault
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction
Fault object, and stores it in the outbound message context.
An attempt will first be made to resolve a pre-existing fault instance from the ProfileRequestContext, via
an optionally configured lookup strategy. This is to accommodate SOAP-aware components which may choose to
emit a specific, locally determined fault. The default strategy is AddSOAPFault.MessageContextFaultStrategy.
If no context fault instance is resolved, a new instance will be built using strategy functions which lookup
the FaultCode QName and the FaultString String values. If no value is produced,
the former defaults to FaultCode.SERVER. The latter defaults to null.
- Event:
EventIds.PROCEED_EVENT_ID
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA default method to map event IDs to faultcode QName based onEventContext.static classDefault strategy which returns aFaultinstance already registered in the current request context. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,Fault> Strategy for resolving a fault instance directly from the request context.private QNameDefault fault codes to insert.private booleanWhether to include detailed status information.private Predicate<ProfileRequestContext>Predicate determining whether detailed error information is permitted.private Function<ProfileRequestContext,QName> Optional method to obtain fault code.private StringA default fault string to include.private Function<ProfileRequestContext,String> Optional method to obtain a fault string.private org.slf4j.LoggerClass logger.private booleanWhether to set the outbound message context's message property to null. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbuildFaultString(Fault fault, String message) Build and attachFaultStringelement.private FaultbuildNewMappedFault(ProfileRequestContext profileRequestContext) Build and return a newFaultbased on configured mapping strategy.protected voiddoExecute(ProfileRequestContext profileRequestContext) Performs this action.protected booleandoPreExecute(ProfileRequestContext profileRequestContext) Called prior to execution, actions may override this method to perform pre-processing for a request.private FaultresolveContextFault(ProfileRequestContext profileRequestContext) Resolve aFaultinstance stored in theProfileRequestContext.voidSet the optional strategy used to resolve aFaultinstance directly from the request context.voidsetDetailedErrorsCondition(Predicate<ProfileRequestContext> condition) Set the predicate used to determine the detailed errors condition.voidsetFaultCode(QName code) Set the default faultcode to insert.voidSet the optional strategy used to obtain a faultcode to include.voidsetFaultString(String message) Set a default faultstring to use in the event that error detail is off, or no specific message is obtained.voidSet the optional strategy used to obtain a faultstring to include.voidsetNullifyOutboundMessage(boolean flag) Set the flag indicating whether to set the outbound message context's message property to null.Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
contextFaultStrategy
Strategy for resolving a fault instance directly from the request context. -
detailedErrorsCondition
Predicate determining whether detailed error information is permitted. -
faultCodeLookupStrategy
Optional method to obtain fault code. -
faultStringLookupStrategy
Optional method to obtain a fault string. -
defaultFaultCode
Default fault codes to insert. -
faultString
A default fault string to include. -
detailedErrors
private boolean detailedErrorsWhether to include detailed status information. -
nullifyOutboundMessage
private boolean nullifyOutboundMessageWhether to set the outbound message context's message property to null.
-
-
Constructor Details
-
AddSOAPFault
public AddSOAPFault()Constructor.
-
-
Method Details
-
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
Set the optional strategy used to resolve aFaultinstance directly from the request context.- Parameters:
strategy- strategy used to resolve the fault instance
-
setDetailedErrorsCondition
Set the predicate used to determine the detailed errors condition.- Parameters:
condition- predicate for detailed errors condition
-
setFaultCodeLookupStrategy
Set the optional strategy used to obtain a faultcode to include.- Parameters:
strategy- strategy used to obtain faultcode
-
setFaultStringLookupStrategy
Set the optional strategy used to obtain a faultstring to include.- Parameters:
strategy- strategy used to obtain a fault string
-
setFaultCode
Set the default faultcode to insert.- Parameters:
code- faultcode
-
setFaultString
Set a default faultstring to use in the event that error detail is off, or no specific message is obtained.- Parameters:
message- default faultstring
-
doPreExecute
Called prior to execution, actions may override this method to perform pre-processing for a request.If false is returned, execution will not proceed, and the action should attach an
EventContextto the context tree to signal how to continue with overall workflow processing.If returning successfully, the last step should be to return the result of the superclass version of this method.
- Overrides:
doPreExecutein classAbstractProfileAction- Parameters:
profileRequestContext- the current IdP profile request context- Returns:
- true iff execution should proceed
-
doExecute
Performs this action. Actions must override this method to perform their work.- Overrides:
doExecutein classAbstractProfileAction- Parameters:
profileRequestContext- the current IdP profile request context
-
resolveContextFault
Resolve aFaultinstance stored in theProfileRequestContext.- Parameters:
profileRequestContext- the current request context- Returns:
- the fault instance resolved from the request context, or null
-
buildNewMappedFault
Build and return a newFaultbased on configured mapping strategy.- Parameters:
profileRequestContext- the current request context- Returns:
- the new fault
-
buildFaultString
Build and attachFaultStringelement.- Parameters:
fault- the element to attach tomessage- the message to set
-