Class DefaultDynamicBackingStore<I,T>
- java.lang.Object
-
- net.shibboleth.oidc.metadata.impl.AbstractBackingStore<I,T>
-
- net.shibboleth.oidc.metadata.impl.DefaultDynamicBackingStore<I,T>
-
- Type Parameters:
I- the metadata identifier type.T- the metadata type.
- All Implemented Interfaces:
BackingStore<I,T>,DynamicBackingStore<I,T>
@ThreadSafe public class DefaultDynamicBackingStore<I,T> extends AbstractBackingStore<I,T> implements DynamicBackingStore<I,T>
Default implementation of aDynamicBackingStore.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<I,MetadataManagementData<I>>mgmtDataMapMap holding management data for each entityID.
-
Constructor Summary
Constructors Constructor Description DefaultDynamicBackingStore()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadataManagementData<I>computeManagementDataIfAbsent(I identifier, Function<I,MetadataManagementData<I>> mappingFunction)Get the management data for the specified identifier.MetadataManagementData<I>getManagementData(I identifier)Get the management data for the specified identifier.Set<I>getManagementDataIdentifiers()Get the set of entityIDs which currently have management data.voidremoveManagementData(I identifier)Remove the management data for the specified entityID.-
Methods inherited from class net.shibboleth.oidc.metadata.impl.AbstractBackingStore
getIndexedValues, getOrderedValues
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.oidc.metadata.BackingStore
getIndexedValues, getOrderedValues
-
-
-
-
Field Detail
-
mgmtDataMap
private final Map<I,MetadataManagementData<I>> mgmtDataMap
Map holding management data for each entityID.
-
-
Method Detail
-
computeManagementDataIfAbsent
public MetadataManagementData<I> computeManagementDataIfAbsent(@Nonnull I identifier, @Nonnull Function<I,MetadataManagementData<I>> mappingFunction)
Description copied from interface:DynamicBackingStoreGet the management data for the specified identifier. If the management data does not exist it should be created using the supplied mapping function.Management data facilitates per-entity metadata locking and cache primitives e.g. next refresh time.
Should do so in a thread-safe way e.g. if two threads enter this method, only one should be allowed to create management data for the same identifier.
- Specified by:
computeManagementDataIfAbsentin interfaceDynamicBackingStore<I,T>- Parameters:
identifier- the identifier of the entity to find management data aboutmappingFunction- the function used to create a newMetadataManagementDatainstance if none exist.- Returns:
- a new or previously cache metadata management data.
-
getManagementData
public MetadataManagementData<I> getManagementData(@Nonnull I identifier)
Description copied from interface:DynamicBackingStoreGet the management data for the specified identifier. If the management data does not exist, null is returned.- Specified by:
getManagementDatain interfaceDynamicBackingStore<I,T>- Parameters:
identifier- the identifier of the entity to find management data about- Returns:
- the corresponding management data, or null if not found.
-
removeManagementData
public void removeManagementData(@Nonnull I identifier)Description copied from interface:DynamicBackingStoreRemove the management data for the specified entityID.- Specified by:
removeManagementDatain interfaceDynamicBackingStore<I,T>- Parameters:
identifier- the input identifier
-
getManagementDataIdentifiers
@Nonnull @NonnullElements @Unmodifiable @NotLive public Set<I> getManagementDataIdentifiers()
Description copied from interface:DynamicBackingStoreGet the set of entityIDs which currently have management data.- Specified by:
getManagementDataIdentifiersin interfaceDynamicBackingStore<I,T>- Returns:
- set of entityIDs, may be empty
-
-