Interface MultiTenancyStrategy
-
- All Known Implementing Classes:
DiscriminatorMultiTenancyStrategy,NoMultiTenancyStrategy
public interface MultiTenancyStrategyDefines how the additional information required by multiTenancy are handled.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentIdHelperdocumentIdHelper()Optional<DocumentMetadataContributor>documentMetadataContributor()com.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.ProjectionExtractionHelper<String>idProjectionExtractionHelper()Optional<IndexSchemaRootContributor>indexSchemaRootContributor()booleanisMultiTenancySupported()Indicates if the strategy supports multiTenancy.
-
-
-
Method Detail
-
isMultiTenancySupported
boolean isMultiTenancySupported()
Indicates if the strategy supports multiTenancy.- Returns:
trueif multiTenancy is supported,falseotherwise.
-
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
com.google.gson.JsonObject filterOrNull(String tenantId)
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
com.google.gson.JsonObject filterOrNull(Set<String> tenantIds)
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.
-
-