Class MongoPersistentEntityIndexCreator
java.lang.Object
org.springframework.data.mongodb.core.index.MongoPersistentEntityIndexCreator
- All Implemented Interfaces:
EventListener
,ApplicationListener<MappingContextEvent<?,
?>>
public class MongoPersistentEntityIndexCreator
extends Object
implements ApplicationListener<MappingContextEvent<?,?>>
Component that inspects
MongoPersistentEntity
instances contained in the given MongoMappingContext
for indexing metadata and ensures the indexes to be available.- Author:
- Jon Brisbin, Oliver Gierke, Philipp Schneider, Johno Crawford, Laurent Canet, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorDescriptionMongoPersistentEntityIndexCreator
(MongoMappingContext mappingContext, IndexOperationsProvider indexOperationsProvider) Creates a newMongoPersistentEntityIndexCreator
for the givenMongoMappingContext
andMongoDatabaseFactory
.MongoPersistentEntityIndexCreator
(MongoMappingContext mappingContext, IndexOperationsProvider indexOperationsProvider, IndexResolver indexResolver) Creates a newMongoPersistentEntityIndexCreator
for the givenMongoMappingContext
andMongoDatabaseFactory
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isIndexCreatorFor
(MappingContext<?, ?> context) Returns whether the current index creator was registered for the givenMappingContext
.void
onApplicationEvent
(MappingContextEvent<?, ?> event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
MongoPersistentEntityIndexCreator
public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext, IndexOperationsProvider indexOperationsProvider) Creates a newMongoPersistentEntityIndexCreator
for the givenMongoMappingContext
andMongoDatabaseFactory
.- Parameters:
mappingContext
- must not be null.indexOperationsProvider
- must not be null.
-
MongoPersistentEntityIndexCreator
public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext, IndexOperationsProvider indexOperationsProvider, IndexResolver indexResolver) Creates a newMongoPersistentEntityIndexCreator
for the givenMongoMappingContext
andMongoDatabaseFactory
.- Parameters:
mappingContext
- must not be null.indexOperationsProvider
- must not be null.indexResolver
- must not be null.
-
-
Method Details
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceApplicationListener<MappingContextEvent<?,
?>>
-
isIndexCreatorFor
Returns whether the current index creator was registered for the givenMappingContext
.- Parameters:
context
-- Returns:
-