Class BasicAccessControlService

All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent, UnmodifiableComponent, AccessControlService

public class BasicAccessControlService extends AbstractIdentifiableInitializableComponent implements AccessControlService
Simple implementation that uses an in-memory map of policies.
  • Field Details

    • log

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

      @Nonnull private Map<String,AccessControl> policyMap
      Map of named policies.
  • Constructor Details

    • BasicAccessControlService

      public BasicAccessControlService()
      Constructor.
  • Method Details

    • setPolicyMap

      public void setPolicyMap(@Nullable Map<String,AccessControl> map)
      Set the policies to store.
      Parameters:
      map - map of named policies
    • getInstance

      @Nonnull public AccessControl getInstance(@Nonnull String name)
      Get an AccessControl instance matching a given name.

      In the absence of a matching instance, a default policy that denies access is returned.

      Specified by:
      getInstance in interface AccessControlService
      Parameters:
      name - policy name
      Returns:
      the matching instance, or a default