Class AddStatusToResponse
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.saml.saml1.profile.impl.AddStatusToResponse
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction
Action that sets
Status content in a Response obtained from
a lookup strategy, typically from the outbound message context.
If the message already contains status information, this action will overwrite it.
Options allows for the creation of a StatusMessage either explicitly,
or via lookup strategy.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA default method to map event IDs to SAML 1 StatusCode QNames based onEventContext. -
Field Summary
FieldsModifier and TypeFieldDescriptionOne or more default status codes to insert.private booleanWhether to include detailed status information.private Predicate<ProfileRequestContext>Predicate determining whether detailed error information is permitted.private org.slf4j.LoggerClass logger.private ResponseResponse to modify.private Function<ProfileRequestContext,Response> Strategy used to locate theResponseto operate on.private Function<ProfileRequestContext,List<QName>> Optional method to obtain status codes.private StringA default status message to include.private Function<ProfileRequestContext,String> Optional method to obtain a status message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbuildStatusCode(Status status, List<QName> codes) Build and attachStatusCodeelement.private voidbuildStatusMessage(Status status, String message) Build and attachStatusMessageelement.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.voidsetDetailedErrorsCondition(Predicate<ProfileRequestContext> condition) Set the predicate used to determine the detailed errors condition.voidSet the strategy used to locate theResponseto operate on.voidsetStatusCodes(List<QName> codes) Set the default list of status code values to insert, ordered such that the top level code is first and every other code will be nested inside the previous one.voidSet the optional strategy used to obtain status codes to include.voidsetStatusMessage(String message) Set a default status message to use in the event that error detail is off, or no specific message is obtained.voidSet the optional strategy used to obtain a status message to include.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. -
responseLookupStrategy
Strategy used to locate theResponseto operate on. -
detailedErrorsCondition
Predicate determining whether detailed error information is permitted. -
statusCodesLookupStrategy
Optional method to obtain status codes. -
statusMessageLookupStrategy
Optional method to obtain a status message. -
defaultStatusCodes
One or more default status codes to insert. -
statusMessage
A default status message to include. -
detailedErrors
private boolean detailedErrorsWhether to include detailed status information. -
response
Response to modify.
-
-
Constructor Details
-
AddStatusToResponse
public AddStatusToResponse()Constructor.
-
-
Method Details
-
setDetailedErrorsCondition
Set the predicate used to determine the detailed errors condition.- Parameters:
condition- predicate for detailed errors condition
-
setStatusCodesLookupStrategy
public void setStatusCodesLookupStrategy(@Nullable Function<ProfileRequestContext, List<QName>> strategy) Set the optional strategy used to obtain status codes to include.- Parameters:
strategy- strategy used to obtain status codes
-
setStatusMessageLookupStrategy
public void setStatusMessageLookupStrategy(@Nullable Function<ProfileRequestContext, String> strategy) Set the optional strategy used to obtain a status message to include.- Parameters:
strategy- strategy used to obtain a status message
-
setResponseLookupStrategy
Set the strategy used to locate theResponseto operate on.- Parameters:
strategy- strategy used to locate theResponseto operate on
-
setStatusCodes
Set the default list of status code values to insert, ordered such that the top level code is first and every other code will be nested inside the previous one.- Parameters:
codes- list of status code values to insert
-
setStatusMessage
Set a default status message to use in the event that error detail is off, or no specific message is obtained.- Parameters:
message- default status message
-
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
-
buildStatusCode
Build and attachStatusCodeelement.- Parameters:
status- the element to attach tocodes- the status codes to use
-
buildStatusMessage
Build and attachStatusMessageelement.- Parameters:
status- the element to attach tomessage- the message to set
-