Class AbstractFileOIDCEntityResolver<Key extends Identifier,Value>

Type Parameters:
Key - The identifier type in the backing store
Value - The entity type in the backing store
All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent
Direct Known Subclasses:
FilesystemClientInformationResolver, FilesystemProviderMetadataResolver

public abstract class AbstractFileOIDCEntityResolver<Key extends Identifier,Value> extends AbstractReloadingOIDCEntityResolver<Key,Value>
  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • metadataFile

      @Nonnull private File metadataFile
      The metadata file.
  • Constructor Details

    • AbstractFileOIDCEntityResolver

      protected AbstractFileOIDCEntityResolver(@Nonnull Resource metadata) throws IOException
      Constructor.
      Parameters:
      metadata - the metadata file
      Throws:
      IOException - If the metedata cannot be loaded.
    • AbstractFileOIDCEntityResolver

      protected AbstractFileOIDCEntityResolver(@Nullable Timer backgroundTaskTimer, @Nonnull Resource metadata) throws IOException
      Constructor.
      Parameters:
      metadata - the metadata file
      backgroundTaskTimer - timer used to refresh metadata in the background
      Throws:
      IOException - If the metedata cannot be loaded.
  • Method Details

    • setMetadataFile

      protected void setMetadataFile(@Nonnull File file)
      Sets the file from which metadata is read.
      Parameters:
      file - path to the metadata file
    • getMetadataIdentifier

      @Nonnull protected String getMetadataIdentifier()
      Gets an identifier which may be used to distinguish this metadata in logging statements.
      Specified by:
      getMetadataIdentifier in class AbstractReloadingOIDCEntityResolver<Key extends Identifier,Value>
      Returns:
      identifier which may be used to distinguish this metadata in logging statements
    • getMetadataUpdateTime

      protected Instant getMetadataUpdateTime()
      Get the time for the last update/modification of the metadata file.
      Returns:
      The last update time.
    • fetchMetadata

      protected byte[] fetchMetadata() throws ResolverException
      Fetches metadata from a source.
      Specified by:
      fetchMetadata in class AbstractReloadingOIDCEntityResolver<Key extends Identifier,Value>
      Returns:
      the fetched metadata, or null if the metadata is known not to have changed since the last retrieval
      Throws:
      ResolverException - thrown if there is a problem fetching the metadata