Class StoredTransientIdGenerationStrategy
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.saml.nameid.impl.StoredTransientIdGenerationStrategy
- All Implemented Interfaces:
TransientIdGenerationStrategy,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
public class StoredTransientIdGenerationStrategy
extends AbstractIdentifiableInitializableComponent
implements TransientIdGenerationStrategy
Generates transients using a
StorageService to manage the reverse mappings.
The identifier itself is the record key, and the value combines the principal name with the identifier of the recipient.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IdentifierGenerationStrategyGenerator of random, hex-encoded, identifiers.private DurationLength identifiers are valid.private intSize, in bytes, of the identifier.private StorageServiceStore used to map identifiers to principals.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidGenerate a new Transient ID.Get the time ids are valid.intGet the size, in bytes, of the id.voidsetIdGenerator(IdentifierGenerationStrategy generator) Set the ID generator we should use.voidsetIdLifetime(Duration lifetime) Set the time ids are valid.voidsetIdSize(int size) Set the size, in bytes, of the id.voidsetIdStore(StorageService store) Set the ID store we should use.Methods 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
idStore
Store used to map identifiers to principals. -
idGenerator
Generator of random, hex-encoded, identifiers. -
idSize
private int idSizeSize, in bytes, of the identifier. -
idLifetime
Length identifiers are valid.
-
-
Constructor Details
-
StoredTransientIdGenerationStrategy
public StoredTransientIdGenerationStrategy()Constructor.
-
-
Method Details
-
setIdStore
Set the ID store we should use.- Parameters:
store- the store to use.
-
getIdSize
Get the size, in bytes, of the id.- Returns:
- id size, in bytes
-
setIdSize
Set the size, in bytes, of the id.- Parameters:
size- size, in bytes, of the id
-
getIdLifetime
Get the time ids are valid.- Returns:
- time ids are valid
-
setIdLifetime
Set the time ids are valid.- Parameters:
lifetime- time ids are valid
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
generate
@Nonnull @NotEmpty public String generate(@Nonnull @NotEmpty String relyingPartyId, @Nonnull @NotEmpty String principalName) throws SAMLException Generate a new Transient ID.- Specified by:
generatein interfaceTransientIdGenerationStrategy- Parameters:
relyingPartyId- the relying party for whom we're generatingprincipalName- the principal to map to- Returns:
- the new identifier
- Throws:
SAMLException- if an error occurs generating the identifier
-