Package io.jmix.search.index.mapping
Class IndexConfigurationManager
java.lang.Object
io.jmix.search.index.mapping.IndexConfigurationManager
@Component("search_IndexConfigurationManager")
public class IndexConfigurationManager
extends Object
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final io.jmix.search.index.mapping.IndexConfigurationManager.Registry
-
Constructor Summary
ConstructorDescriptionIndexConfigurationManager
(JmixModulesClasspathScanner classpathScanner, AnnotatedIndexDefinitionProcessor indexDefinitionProcessor, InstanceNameProvider instanceNameProvider, IndexDefinitionDetector indexDefinitionDetector, MetadataTools metadataTools) -
Method Summary
Modifier and TypeMethodDescriptionGets allIndexConfiguration
registered in applicationgetDependenciesMetaDataForDelete
(Class<?> deletedEntityClass) Gets metadata of entities dependent on deleted main entity.getDependenciesMetaDataForUpdate
(Class<?> entityClass, Set<String> changedProperties) Gets metadata of entities dependent on updated main entity and its changed properties.getIndexConfigurationByEntityName
(String entityName) GetsIndexConfiguration
registered for provided entity name.getIndexConfigurationByEntityNameOpt
(String entityName) Gets optionalIndexConfiguration
registered for provided entity name.getIndexConfigurationByIndexName
(String indexName) GetsIndexConfiguration
registered for provided index name.getIndexConfigurationByIndexNameOpt
(String indexName) Gets optionalIndexConfiguration
registered for provided index name.getLocalPropertyNamesAffectedByUpdate
(Class<?> entityClass) Gets local property names of provided entity involved into index update processboolean
isAffectedEntityClass
(Class<?> entityClass) Checks if provided entity is involved in index process directly or as a part of another entity.boolean
isDirectlyIndexed
(String entityName) Checks if provided entity is declared to be indexed directly (not as a part of another entity).
-
Field Details
-
registry
protected final io.jmix.search.index.mapping.IndexConfigurationManager.Registry registry
-
-
Constructor Details
-
IndexConfigurationManager
@Autowired public IndexConfigurationManager(JmixModulesClasspathScanner classpathScanner, AnnotatedIndexDefinitionProcessor indexDefinitionProcessor, InstanceNameProvider instanceNameProvider, IndexDefinitionDetector indexDefinitionDetector, MetadataTools metadataTools)
-
-
Method Details
-
getAllIndexConfigurations
Gets allIndexConfiguration
registered in application- Returns:
- all
IndexConfiguration
-
getIndexConfigurationByEntityName
GetsIndexConfiguration
registered for provided entity name. ThrowsIllegalArgumentException
if there is no configuration for provided entity name.- Parameters:
entityName
- entity name.- Returns:
IndexConfiguration
-
getIndexConfigurationByEntityNameOpt
Gets optionalIndexConfiguration
registered for provided entity name.- Parameters:
entityName
- entity name- Returns:
- optional
IndexConfiguration
-
getIndexConfigurationByIndexName
GetsIndexConfiguration
registered for provided index name. ThrowsIllegalArgumentException
if there is no configuration for provided index name.- Parameters:
indexName
- index name- Returns:
IndexConfiguration
-
getIndexConfigurationByIndexNameOpt
Gets optionalIndexConfiguration
registered for provided index name.- Parameters:
indexName
- index name- Returns:
- optional
IndexConfiguration
-
getAllIndexedEntities
-
isDirectlyIndexed
Checks if provided entity is declared to be indexed directly (not as a part of another entity).- Parameters:
entityName
- entity name- Returns:
- true if entity is indexed, false otherwise
-
isAffectedEntityClass
Checks if provided entity is involved in index process directly or as a part of another entity.- Parameters:
entityClass
- entity java class- Returns:
- true if entity is involved in index process, false otherwise
-
getLocalPropertyNamesAffectedByUpdate
Gets local property names of provided entity involved into index update process- Parameters:
entityClass
- entity class- Returns:
- set of property names
-
getDependenciesMetaDataForUpdate
public Map<MetaClass,Set<MetaPropertyPath>> getDependenciesMetaDataForUpdate(Class<?> entityClass, Set<String> changedProperties) Gets metadata of entities dependent on updated main entity and its changed properties.- Parameters:
entityClass
- java class of main entitychangedProperties
- changed property of main entity- Returns:
- dependent entities grouped by their
MetaClass
. For every meta class group there are set of properties representing dependency-to-main references
-
getDependenciesMetaDataForDelete
public Map<MetaClass,Set<MetaPropertyPath>> getDependenciesMetaDataForDelete(Class<?> deletedEntityClass) Gets metadata of entities dependent on deleted main entity.- Parameters:
deletedEntityClass
- java class of main entity- Returns:
- dependent entities grouped by their
MetaClass
. For every meta class group there are set of properties representing dependency-to-main references
-