Package org.opensaml.saml.common.profile.logic

# Class DefaultLocalErrorPredicate

java.lang.Object
org.opensaml.saml.common.profile.logic.DefaultLocalErrorPredicate

All Implemented Interfaces:
  `Predicate<ProfileRequestContext>`

public class DefaultLocalErrorPredicate extends Object implements Predicate<ProfileRequestContext>
Predicate that decides whether to handle an error by returning a SAML response to a requester or fail locally.

This is principally determined based on whether or not the necessary message context children are present so that a response can be delivered, but is also tunable based on the error event being handled.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,SAMLBindingContext>`
`bindingContextLookupStrategy`
Strategy function for access to `SAMLBindingContext` to check.
`private Function<ProfileRequestContext,SAMLEndpointContext>`
`endpointContextLookupStrategy`
Strategy function for access to `SAMLEndpointContext` to check.
`private Function<ProfileRequestContext,EventContext>`
`eventContextLookupStrategy`
Strategy function for access to `EventContext` to check.
`private Set<String>`
`localEvents`
Error events to handle locally, even if possible to do so with a response.
`private final org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`DefaultLocalErrorPredicate()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`setBindingContextLookupStrategy(Function<ProfileRequestContext,SAMLBindingContext> strategy)`
Set lookup strategy for `SAMLBindingContext` to check.
`void`
`setEndpointContextLookupStrategy(Function<ProfileRequestContext,SAMLEndpointContext> strategy)`
Set lookup strategy for `SAMLEndpointContext` to check.
`void`
`setEventContextLookupStrategy(Function<ProfileRequestContext,EventContext> strategy)`
Set lookup strategy for `EventContext` to check.
`void`
`setLocalEvents(Collection<String> events)`
Set the events to handle locally.
`boolean`
`test(ProfileRequestContext input)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Predicate

`and, negate, or`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### bindingContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,SAMLBindingContext> bindingContextLookupStrategy
Strategy function for access to `SAMLBindingContext` to check.

### endpointContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,SAMLEndpointContext> endpointContextLookupStrategy
Strategy function for access to `SAMLEndpointContext` to check.

### eventContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,EventContext> eventContextLookupStrategy
Strategy function for access to `EventContext` to check.

### localEvents

@Nonnull private Set<String> localEvents
Error events to handle locally, even if possible to do so with a response.

## Constructor Details

### DefaultLocalErrorPredicate

public DefaultLocalErrorPredicate()
Constructor.

## Method Details

### setBindingContextLookupStrategy

public void setBindingContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLBindingContext> strategy)
Set lookup strategy for `SAMLBindingContext` to check.

Parameters:
  `strategy` - lookup strategy

### setEndpointContextLookupStrategy

public void setEndpointContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLEndpointContext> strategy)
Set lookup strategy for `SAMLEndpointContext` to check.

Parameters:
  `strategy` - lookup strategy

### setEventContextLookupStrategy

public void setEventContextLookupStrategy(@Nonnull Function<ProfileRequestContext,EventContext> strategy)
Set lookup strategy for `EventContext` to check.

Parameters:
  `strategy` - lookup strategy

### setLocalEvents

public void setLocalEvents(@Nullable Collection<String> events)
Set the events to handle locally.

Parameters:
  `events` - locally handled events

### test

public boolean test(@Nullable ProfileRequestContext input)

Specified by:
  `test` in interface `Predicate<ProfileRequestContext>`