Class DiscriminatorMultiTenancyStrategy
- java.lang.Object
-
- org.hibernate.search.backend.elasticsearch.multitenancy.impl.DiscriminatorMultiTenancyStrategy
-
- All Implemented Interfaces:
MultiTenancyStrategy
public class DiscriminatorMultiTenancyStrategy extends Object implements MultiTenancyStrategy
-
-
Constructor Summary
Constructors Constructor Description DiscriminatorMultiTenancyStrategy()
-
Method Summary
All Methods Instance Methods Concrete 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.org.hibernate.search.backend.elasticsearch.multitenancy.impl.DiscriminatorMultiTenancyStrategy.DiscriminatorMultiTenancyIdProjectionExtractionHelperidProjectionExtractionHelper()Optional<IndexSchemaRootContributor>indexSchemaRootContributor()booleanisMultiTenancySupported()Indicates if the strategy supports multiTenancy.
-
-
-
Method Detail
-
isMultiTenancySupported
public boolean isMultiTenancySupported()
Description copied from interface:MultiTenancyStrategyIndicates if the strategy supports multiTenancy.- Specified by:
isMultiTenancySupportedin interfaceMultiTenancyStrategy- Returns:
trueif multiTenancy is supported,falseotherwise.
-
indexSchemaRootContributor
public Optional<IndexSchemaRootContributor> indexSchemaRootContributor()
- Specified by:
indexSchemaRootContributorin interfaceMultiTenancyStrategy- Returns:
- A schema contributor for the required additional properties (tenant ID, ...), or an empty optional.
-
documentIdHelper
public DocumentIdHelper documentIdHelper()
- Specified by:
documentIdHelperin interfaceMultiTenancyStrategy- Returns:
- A helper for creating predicates from tenant IDs.
-
documentMetadataContributor
public Optional<DocumentMetadataContributor> documentMetadataContributor()
- Specified by:
documentMetadataContributorin interfaceMultiTenancyStrategy- Returns:
- A metadata contributor for the required additional properties (tenant ID, ...), or an empty optional.
-
filterOrNull
public com.google.gson.JsonObject filterOrNull(String tenantId)
Description copied from interface:MultiTenancyStrategyGenerate a filter for the given tenant ID, to be applied to search queries.- Specified by:
filterOrNullin interfaceMultiTenancyStrategy- Parameters:
tenantId- The tenant id.- Returns:
- The filter, or
nullif no filter is necessary.
-
filterOrNull
public com.google.gson.JsonObject filterOrNull(Set<String> tenantIds)
Description copied from interface:MultiTenancyStrategyGenerate a filter for the given tenant IDs, to be applied to search queries.- Specified by:
filterOrNullin interfaceMultiTenancyStrategy- Parameters:
tenantIds- The set of tenant ids.- Returns:
- The filter, or
nullif no filter is necessary.
-
idProjectionExtractionHelper
public org.hibernate.search.backend.elasticsearch.multitenancy.impl.DiscriminatorMultiTenancyStrategy.DiscriminatorMultiTenancyIdProjectionExtractionHelper idProjectionExtractionHelper()
- Specified by:
idProjectionExtractionHelperin interfaceMultiTenancyStrategy- Returns:
- A helper for projections that need to extract the document id from search hits.
-
-