Interface MultiTenancyStrategy

All Known Implementing Classes:
DiscriminatorMultiTenancyStrategy, NoMultiTenancyStrategy

public interface MultiTenancyStrategy
Defines how the additional information required by multiTenancy are handled.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkTenantId(String tenantId, EventContext backendContext)
    Check that the tenant id value is consistent with the strategy.
    void
    checkTenantId(Set<String> tenantIds, EventContext context)
    Check that the set of tenant id values is valid.
    void
    contributeToIndexedDocument(org.apache.lucene.document.Document document, String tenantId)
    Contributes additional information to the indexed document.
    org.apache.lucene.search.Query
    filterOrNull(String tenantId)
    Generate a filter for the given tenant ID, to be applied to search queries and update/delete operations.
    org.apache.lucene.search.Query
    filterOrNull(Set<String> tenantIds)
    Generate a filter for the given set of tenant IDs, to be applied to search queries.
  • Method Details

    • contributeToIndexedDocument

      void contributeToIndexedDocument(org.apache.lucene.document.Document document, String tenantId)
      Contributes additional information to the indexed document.
      Parameters:
      document - The indexed document.
      tenantId - The tenant id.
    • filterOrNull

      org.apache.lucene.search.Query filterOrNull(String tenantId)
      Generate a filter for the given tenant ID, to be applied to search queries and update/delete operations.
      Parameters:
      tenantId - The tenant id.
      Returns:
      The filter, or null if no filter is necessary.
    • filterOrNull

      org.apache.lucene.search.Query filterOrNull(Set<String> tenantIds)
      Generate a filter for the given set of tenant IDs, to be applied to search queries.
      Parameters:
      tenantIds - The set of tenant ids.
      Returns:
      The filter, or null if no filter is necessary.
    • checkTenantId

      void checkTenantId(String tenantId, EventContext backendContext)
      Check that the tenant id value is consistent with the strategy.
      Parameters:
      tenantId - The tenant id.
      backendContext - The backend.
    • checkTenantId

      void checkTenantId(Set<String> tenantIds, EventContext context)
      Check that the set of tenant id values is valid.
      Parameters:
      tenantIds - The set of tenant ids.
      context - The context to add to exceptions (if any).