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 TypeMethodDescriptioncom.google.gson.JsonObjectfilterOrNull(String tenantId) Generate a filter for the given tenant ID, to be applied to search queries.com.google.gson.JsonObjectfilterOrNull(Set<String> tenantIds) Generate a filter for the given tenant IDs, to be applied to search queries.
-
Method Details
-
indexSchemaRootContributor
Optional<IndexSchemaRootContributor> indexSchemaRootContributor()- Returns:
- A schema contributor for the required additional properties (tenant ID, ...), or an empty optional.
-
documentIdHelper
DocumentIdHelper documentIdHelper()- Returns:
- A helper for creating predicates from tenant IDs.
-
documentMetadataContributor
Optional<DocumentMetadataContributor> documentMetadataContributor()- Returns:
- A metadata contributor for the required additional properties (tenant ID, ...), or an empty optional.
-
filterOrNull
Generate a filter for the given tenant ID, to be applied to search queries.- Parameters:
tenantId- The tenant id.- Returns:
- The filter, or
nullif no filter is necessary.
-
filterOrNull
Generate a filter for the given tenant IDs, to be applied to search queries.- Parameters:
tenantIds- The set of tenant ids.- Returns:
- The filter, or
nullif no filter is necessary.
-
idProjectionExtractionHelper
ProjectionExtractionHelper<String> idProjectionExtractionHelper()- Returns:
- A helper for projections that need to extract the document id from search hits.
-