Package net.shibboleth.oidc.profile.impl
Class AbstractBuildErrorResponseFromEvent<T extends ErrorResponse>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.oidc.profile.impl.AbstractBuildErrorResponseFromEvent<T>
- Type Parameters:
T- ErrorResponse implementation.
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
- Direct Known Subclasses:
BuildJSONErrorResponseFromEvent
public abstract class AbstractBuildErrorResponseFromEvent<T extends ErrorResponse>
extends AbstractProfileAction
This action is extended by error response actions. Action reads an event from the configured
EventContext
lookup strategy, constructs an OIDC error response message and attaches it as the outbound message, if outbound
message context was found.- Since:
- 2.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault value for the error code in the error response messages.static final intDefault value for the HTTP response status code in the HTTP responses.private StringThe code for unmapped events.private intThe status code for unmapped events.private Function<ProfileRequestContext,EventContext> Strategy function for access toEventContextto check.private final org.slf4j.LoggerClass logger.private Map<String,ErrorObject> Map of eventIds to pre-configured error objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TbuildErrorResponse(ErrorObject error, ProfileRequestContext profileRequestContext) Method implemented by the extending class to create ErrorResponse.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext) voidsetDefaultCode(String code) Set the code for unmapped events.voidsetDefaultStatusCode(int code) Set the status code for unmapped events.voidSet lookup strategy forEventContextto check.voidsetMappedErrors(Map<String, ErrorObject> errors) Set map of eventIds to pre-configured error objects.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods 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
-
DEFAULT_ERROR_CODE
Default value for the error code in the error response messages.- See Also:
-
DEFAULT_HTTP_STATUS_CODE
public static final int DEFAULT_HTTP_STATUS_CODEDefault value for the HTTP response status code in the HTTP responses.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
eventContextLookupStrategy
Strategy function for access toEventContextto check. -
mappedErrors
Map of eventIds to pre-configured error objects. -
defaultStatusCode
private int defaultStatusCodeThe status code for unmapped events. -
defaultCode
The code for unmapped events.
-
-
Constructor Details
-
AbstractBuildErrorResponseFromEvent
public AbstractBuildErrorResponseFromEvent()Constructor.
-
-
Method Details
-
setDefaultStatusCode
public void setDefaultStatusCode(int code) Set the status code for unmapped events.- Parameters:
code- The default status code for unmapped events.
-
setDefaultCode
Set the code for unmapped events.- Parameters:
code- The default status code for unmapped events.
-
setEventContextLookupStrategy
public void setEventContextLookupStrategy(@Nonnull Function<ProfileRequestContext, EventContext> strategy) Set lookup strategy forEventContextto check.- Parameters:
strategy- lookup strategy
-
setMappedErrors
Set map of eventIds to pre-configured error objects.- Parameters:
errors- map of eventIds to pre-configured error objects.
-
buildErrorResponse
@Nullable protected abstract T buildErrorResponse(@Nonnull ErrorObject error, @Nonnull ProfileRequestContext profileRequestContext) Method implemented by the extending class to create ErrorResponse.- Parameters:
error- error object to build the response from.profileRequestContext- profile request context.- Returns:
- ErrorResponse
-
doPreExecute
- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-