Class TenantContextLoader


  • @ApplicationScoped
    public class TenantContextLoader
    extends Object
    Component responsible for creating instances of RegistryTenantContext so they can be set with TenantContext
    Author:
    Fabian Martinez
    • Constructor Detail

      • TenantContextLoader

        public TenantContextLoader()
    • Method Detail

      • onStart

        public void onStart​(@Observes
                            io.quarkus.runtime.StartupEvent ev)
      • loadRequestContext

        public RegistryTenantContext loadRequestContext​(String tenantId)
        Used for user requests where there is a JWT token in the request This method enforces authorization and uses JWT token information to verify if the tenant is authorized to access the organization indicated in the JWT
        Parameters:
        tenantId -
        Returns:
      • loadBatchJobContext

        public RegistryTenantContext loadBatchJobContext​(String tenantId)
        Used for internal stuff where there isn't a JWT token from the user request available This won't perform any authorization check.
        Parameters:
        tenantId -
        Returns:
      • invalidateTenantInCache

        public void invalidateTenantInCache​(String tenantId)
      • invalidateTenantCache

        public void invalidateTenantCache()