Package net.shibboleth.idp.authn.impl

# Class FunctionSubjectCanonicalization

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor
net.shibboleth.idp.authn.AbstractSubjectCanonicalizer
net.shibboleth.idp.authn.impl.FunctionSubjectCanonicalization

All Implemented Interfaces:
  `Function<SubjectCanonicalizationContext,String>`, `Predicate<ProfileRequestContext>`, `SubjectCanonicalizer`, `FlowDescriptor`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`

public class FunctionSubjectCanonicalization extends AbstractSubjectCanonicalizer
A `SubjectCanonicalizer` that delegates implementation to a function, allowing scripted/etc. use.

Since:
  5.2.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<SubjectCanonicalizationContext,String>`
`delegatedFunction`
Implementation of flow.

## Constructor Summary

Constructors
Constructor
Description
`FunctionSubjectCanonicalization()`

## Method Summary

Modifier and Type
Method
Description
`String`
`doApply(SubjectCanonicalizationContext c14nContext)`
Performs c14n if possible.
`protected void`
`doInitialize()`
`void`
`setFunction(Function<SubjectCanonicalizationContext,String> f)`
Set the function to use.

### Methods inherited from class net.shibboleth.idp.authn.AbstractSubjectCanonicalizer

`apply, applyTransforms, getLogPrefix, setLowercase, setTransforms, setTrim, setUppercase`

### Methods inherited from class net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor

`equals, getFlowId, hashCode, setActivationCondition, setFlowId, test, toString`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

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

`andThen, compose`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiableComponent

`setId`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

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

`and, negate, or`

## Field Details

### delegatedFunction

@NonnullAfterInit private Function<SubjectCanonicalizationContext,String> delegatedFunction
Implementation of flow.

## Constructor Details

### FunctionSubjectCanonicalization

public FunctionSubjectCanonicalization()

## Method Details

### setFunction

public void setFunction(@Nonnull Function<SubjectCanonicalizationContext,String> f)
Set the function to use.

Parameters:
  `f` - function to use

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractSubjectCanonicalizer`
Throws:
  `ComponentInitializationException`

### doApply

@Nullable public String doApply(@Nonnull SubjectCanonicalizationContext c14nContext)
Performs c14n if possible.

Specified by:
  `doApply` in class `AbstractSubjectCanonicalizer`
Parameters:
  `c14nContext` - the current subject canonicalization context
Returns:
  event indicating result of function