Class AbstractPersistentIdDataConnector
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
-
- net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
-
- net.shibboleth.idp.attribute.resolver.AbstractDataConnector
-
- net.shibboleth.idp.saml.attribute.resolver.impl.AbstractPersistentIdDataConnector
-
- All Implemented Interfaces:
DataConnector,ResolverPlugin<Map<String,IdPAttribute>>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
public abstract class AbstractPersistentIdDataConnector extends AbstractDataConnector
The basis of aDataConnectorthat handles persistent IDs that depend on a sourceIdPAttribute.
-
-
Field Summary
Fields Modifier and Type Field Description private StringgeneratedAttributeID of the attribute generated by this data connector.private org.slf4j.LoggerlogClass logger.private StringsourceInformationInformation about the dependency.
-
Constructor Summary
Constructors Constructor Description AbstractPersistentIdDataConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddoDependencyInformation()Do the dance with dependencies.protected voiddoInitialize()protected Map<String,IdPAttribute>encodeAsAttribute(String value)Encode the provided string.StringgetGeneratedAttributeId()Get the ID of the attribute generated by this connector.StringgetSourceAttributeInformation()Get Information about the attribute whose first value is used when generating the computed ID.protected StringresolveSourceAttribute(AttributeResolverWorkContext workContext)Helper function to locate the source Attribute in the dependencies.voidsetGeneratedAttributeId(String newAttributeId)Set the ID of the attribute generated by this connector.-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector
doDataConnectorResolve, doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, isExportAllAttributes, setExportAllAttributes, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay
-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin
addDisplayInformation, doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, getProfileContextStrategy, hashCode, isPropagateResolutionExceptions, isSuppressDisplayInformation, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setProfileContextStrategy, setPropagateResolutionExceptions, setSuppressDisplayInformation
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
-
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
generatedAttribute
@NonnullAfterInit private String generatedAttribute
ID of the attribute generated by this data connector.
-
sourceInformation
@NonnullAfterInit private String sourceInformation
Information about the dependency.
-
-
Method Detail
-
getSourceAttributeInformation
@Nullable @NonnullAfterInit public String getSourceAttributeInformation()
Get Information about the attribute whose first value is used when generating the computed ID. This is derived from the sourceID (if present) and/or the dependencies. Public purely as an aid to testing.- Returns:
- log-friend information.
-
getGeneratedAttributeId
@NonnullAfterInit public String getGeneratedAttributeId()
Get the ID of the attribute generated by this connector.- Returns:
- ID of the attribute generated by this connector
-
setGeneratedAttributeId
public void setGeneratedAttributeId(@Nullable String newAttributeId)Set the ID of the attribute generated by this connector.- Parameters:
newAttributeId- what to set.
-
doDependencyInformation
private void doDependencyInformation() throws ComponentInitializationExceptionDo the dance with dependencies. Old style ones get the sourceId added (failing if it isn't there). New style ones get their names added to the information string.- Throws:
ComponentInitializationException- if the dependencies are not aligned correctly
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractDataConnector- Throws:
ComponentInitializationException
-
resolveSourceAttribute
@Nullable protected String resolveSourceAttribute(@Nonnull AttributeResolverWorkContext workContext)
Helper function to locate the source Attribute in the dependencies.- Parameters:
workContext- the context to look in- Returns:
- the value, or null in any of the failure cases.
-
encodeAsAttribute
@Nullable protected Map<String,IdPAttribute> encodeAsAttribute(@Nullable String value)
Encode the provided string.- Parameters:
value- the value to encode or null if that failed- Returns:
- null or the attribute.
-
-