Package net.shibboleth.metadata.dom.saml
Class PullUpCacheDurationStage
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.AbstractStage<T>
net.shibboleth.metadata.pipeline.AbstractIteratingStage<Element>
net.shibboleth.metadata.dom.saml.PullUpCacheDurationStage
- All Implemented Interfaces:
Stage<Element>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.IdentifiableComponent,net.shibboleth.shared.component.IdentifiedComponent,net.shibboleth.shared.component.InitializableComponent
For each Item collection element that is a SAML EntitiesDescriptor this stage will scan all descendant
EntitiesDescriptors and EntityDescriptors, determine the shortest cache duration, set that on the root
EntitiesDescriptor and remove the cache duration from all descendants.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidProcesses a givenItem.final DurationGets the maximum cache duration.final DurationGets the minimum cache duration.protected DurationgetShortestCacheDuration(Element descriptor) Gets the shortest cache duration for a given entity or entities descriptor and all its descendant descriptors.protected voidsetCacheDuration(Element descriptor, Duration cacheDuration) Sets the cache duration on the given descriptor.voidsetMaximumCacheDuration(Duration duration) Sets the maximum cache duration.voidsetMinimumCacheDuration(Duration duration) Sets the minimum cache duration.Methods inherited from class net.shibboleth.metadata.pipeline.AbstractIteratingStage
doExecuteMethods inherited from class net.shibboleth.metadata.pipeline.AbstractStage
execute, getCollectionPredicate, setCollectionPredicateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, 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.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
minCacheDuration
The minimum cache duration. Default value:0 -
maxCacheDuration
The maximum cache duration. Default value: 9223372036854775807L
-
-
Constructor Details
-
PullUpCacheDurationStage
public PullUpCacheDurationStage()
-
-
Method Details
-
getMinimumCacheDuration
Gets the minimum cache duration.- Returns:
- minimum cache duration, always 0 or greater
-
setMinimumCacheDuration
Sets the minimum cache duration.- Parameters:
duration- the minimum cache duration
-
getMaximumCacheDuration
Gets the maximum cache duration.- Returns:
- maximum cache duration, always greater than 0
-
setMaximumCacheDuration
Sets the maximum cache duration.- Parameters:
duration- maximum cache duration, must be greater than 0
-
doExecute
Description copied from class:AbstractIteratingStageProcesses a givenItem.- Specified by:
doExecutein classAbstractIteratingStage<Element>- Parameters:
item-Itemon which to operate- Throws:
StageProcessingException- thrown if there is a problem with the stage processing
-
getShortestCacheDuration
Gets the shortest cache duration for a given entity or entities descriptor and all its descendant descriptors.- Parameters:
descriptor- descriptor from which to get the shortest cache duration- Returns:
- the shortest cache duration from the descriptor and its descendants or null if the descriptor does not contain a cache duration
-
setCacheDuration
Sets the cache duration on the given descriptor. If the given cache duration is less than, or equal to, 0 no duration is set. If the given cache duration is less thanminCacheDurationthen the minimum cache duration is set. If the given cache duration is greater thanmaxCacheDurationthen the maximum cache duration is set. Otherwise the given cache duration is set.- Parameters:
descriptor- entity or entities descriptor to receive the cache duration, never nullcacheDuration- cache duration to be set, may be null
-