Package net.shibboleth.idp.authn
Class AbstractSubjectCanonicalizer
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
- All Implemented Interfaces:
Function<SubjectCanonicalizationContext,,String> Predicate<ProfileRequestContext>,SubjectCanonicalizer,FlowDescriptor,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
- Direct Known Subclasses:
AttributeSourcedSubjectCanonicalization,FunctionSubjectCanonicalization,SimpleSubjectCanonicalization,X500SubjectCanonicalization
public abstract class AbstractSubjectCanonicalizer
extends SubjectCanonicalizationFlowDescriptor
implements SubjectCanonicalizer
A base class for "stand-alone" subject c14n implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private StringCached log prefix.private booleanConvert to lowercase prior to transforms?Match patterns and replacement strings to apply.private booleanTrim prior to transforms?private booleanConvert to uppercase prior to transforms? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(SubjectCanonicalizationContext c14nContext) Performs this c14n action's pre-execute step.protected StringapplyTransforms(String input) Apply any configured regular expression replacements to an input value and return the result.protected abstract StringdoApply(SubjectCanonicalizationContext c14nContext) Performs c14n if possible.protected voidprotected StringReturn a prefix for logging messages for this component.voidsetLowercase(boolean flag) Controls conversion to lowercase prior to applying any transforms.voidsetTransforms(Collection<Pair<String, String>> newTransforms) A collection of regular expression and replacement pairs.voidsetTrim(boolean flag) Controls whitespace trimming prior to applying any transforms.voidsetUppercase(boolean flag) Controls conversion to uppercase prior to applying any transforms.Methods inherited from class net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor
equals, getFlowId, hashCode, setActivationCondition, setFlowId, test, toStringMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiableComponent
setIdMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
logPrefix
Cached log prefix. -
transforms
Match patterns and replacement strings to apply. -
uppercase
private boolean uppercaseConvert to uppercase prior to transforms? -
lowercase
private boolean lowercaseConvert to lowercase prior to transforms? -
trim
private boolean trimTrim prior to transforms?
-
-
Constructor Details
-
AbstractSubjectCanonicalizer
public AbstractSubjectCanonicalizer()Constructor.
-
-
Method Details
-
setTransforms
A collection of regular expression and replacement pairs.- Parameters:
newTransforms- collection of replacement transforms
-
setUppercase
public void setUppercase(boolean flag) Controls conversion to uppercase prior to applying any transforms.- Parameters:
flag- uppercase flag
-
setLowercase
public void setLowercase(boolean flag) Controls conversion to lowercase prior to applying any transforms.- Parameters:
flag- lowercase flag
-
setTrim
public void setTrim(boolean flag) Controls whitespace trimming prior to applying any transforms.- Parameters:
flag- trim flag
-
doInitialize
- Overrides:
doInitializein classSubjectCanonicalizationFlowDescriptor- Throws:
ComponentInitializationException
-
apply
Performs this c14n action's pre-execute step. Default implementation just returns true iff a subject is set.- Specified by:
applyin interfaceFunction<SubjectCanonicalizationContext,String> - Parameters:
c14nContext- the current subject canonicalization context- Returns:
- event indicating result of function
-
doApply
Performs c14n if possible.- Parameters:
c14nContext- the current subject canonicalization context- Returns:
- event indicating result of function
-
applyTransforms
Apply any configured regular expression replacements to an input value and return the result.- Parameters:
input- the input string- Returns:
- the result of applying the expressions
-
getLogPrefix
Return a prefix for logging messages for this component.- Returns:
- a string for insertion at the beginning of any log messages
-