Class AbstractOIDCEntityResolver<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:
AbstractReloadingOIDCEntityResolver

public abstract class AbstractOIDCEntityResolver<Key extends Identifier,Value> extends AbstractIdentifiableInitializableComponent
A base class for Resolvers used for resolving entities containing identifiers based on Identifier.
  • Field Details

    • log

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

      Backing store for runtime JSON data.
    • logPrefix

      private String logPrefix
      Logging prefix.
    • failFastInitialization

      private boolean failFastInitialization
      Whether problems during initialization should cause the provider to fail or go on without metadata. The assumption being that in most cases a provider will recover at some point in the future. Default: true.
  • Constructor Details

    • AbstractOIDCEntityResolver

      protected AbstractOIDCEntityResolver()
      Constructor.
  • Method Details

    • getLogPrefix

      @Nonnull @NotEmpty protected String getLogPrefix()
      Return a prefix for logging messages for this component.
      Returns:
      a string for insertion at the beginning of any log messages
    • isFailFastInitialization

      public boolean isFailFastInitialization()
      Gets whether problems during initialization should cause the provider to fail or go on without metadata. The assumption being that in most cases a provider will recover at some point in the future.
      Returns:
      whether problems during initialization should cause the provider to fail
    • setFailFastInitialization

      public void setFailFastInitialization(boolean failFast)
      Sets whether problems during initialization should cause the provider to fail or go on without metadata. The assumption being that in most cases a provider will recover at some point in the future.
      Parameters:
      failFast - whether problems during initialization should cause the provider to fail
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractIdentifiedInitializableComponent
      Throws:
      ComponentInitializationException
    • initOIDCResolver

      protected void initOIDCResolver() throws ComponentInitializationException
      Initializes this resolver by creating a new backing store.
      Throws:
      ComponentInitializationException - If the initialization fails.
    • lookupIdentifier

      @Nonnull @NonnullElements protected List<Value> lookupIdentifier(@Nonnull @NotEmpty Key identifier) throws ResolverException
      Get list of information matching a given identifier.
      Parameters:
      identifier - identifier to lookup
      Returns:
      a list of information
      Throws:
      ResolverException - if an error occurs
    • lookupIndexedIdentifier

      @Nonnull @NonnullElements protected List<Value> lookupIndexedIdentifier(@Nonnull @NotEmpty Key identifier)
      Lookup the specified identifier from the index. The returned list will be a copy of what is stored in the backing index, and is safe to be manipulated by callers.
      Parameters:
      identifier - the identifier to lookup
      Returns:
      list copy of indexed identifiers, may be empty, will never be null
    • preProcessEntityDescriptor

      protected void preProcessEntityDescriptor(@Nonnull Value entityDescriptor, @Nonnull Key key, @Nonnull AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore backingStore)
      Pre-process the specified entity descriptor, updating the specified entity backing store instance as necessary.
      Parameters:
      entityDescriptor - the target entity descriptor to process
      key - key to entity
      backingStore - the backing store instance to update
    • removeByIdentifier

      protected void removeByIdentifier(@Nonnull Key identifier, @Nonnull AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore backingStore)
      Remove from the backing store all metadata for the entity with the given identifier.
      Parameters:
      identifier - the identifier of the metadata to remove
      backingStore - the backing store instance to update
    • indexEntityDescriptor

      protected void indexEntityDescriptor(@Nonnull Value entityDescriptor, @Nonnull Key key, @Nonnull AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore backingStore)
      Index the specified entity descriptor, updating the specified entity backing store instance as necessary.
      Parameters:
      entityDescriptor - the target entity descriptor to process
      key - key to entity
      backingStore - the backing store instance to update
    • createNewBackingStore

      @Nonnull protected AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore createNewBackingStore()
      Create a new backing store instance for entity data. Subclasses may override to return a more specialized subclass type. Note this method does not make the returned backing store the effective one in use. The caller is responsible for calling setBackingStore(AbstractOIDCEntityResolver.JsonBackingStore) to make it the effective instance in use.
      Returns:
      the new backing store instance
    • getBackingStore

      Get the entity backing store currently in use by the metadata resolver.
      Returns:
      the current effective entity backing store
    • setBackingStore

      protected void setBackingStore(@Nonnull AbstractOIDCEntityResolver<Key,Value>.JsonBackingStore newBackingStore)
      Set the entity backing store currently in use by the metadata resolver.
      Parameters:
      newBackingStore - the new entity backing store