Spring Data MongoDB - Core

org.springframework.data.mongodb.core.index
Class MongoPersistentEntityIndexCreator

java.lang.Object
  extended by org.springframework.data.mongodb.core.index.MongoPersistentEntityIndexCreator
All Implemented Interfaces:
EventListener, ApplicationListener<MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty>>

public class MongoPersistentEntityIndexCreator
extends Object
implements ApplicationListener<MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty>>

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

Constructor Summary
MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext, MongoDbFactory mongoDbFactory)
          Creats a new MongoPersistentEntityIndexCreator for the given MongoMappingContext and MongoDbFactory.
MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext, MongoDbFactory mongoDbFactory, org.springframework.data.mongodb.core.index.IndexResolver indexResolver)
          Creats a new MongoPersistentEntityIndexCreator for the given MongoMappingContext and MongoDbFactory.
 
Method Summary
 boolean isIndexCreatorFor(MappingContext<?,?> context)
          Returns whether the current index creator was registered for the given MappingContext.
 void onApplicationEvent(MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty> event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MongoPersistentEntityIndexCreator

public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext,
                                         MongoDbFactory mongoDbFactory)
Creats a new MongoPersistentEntityIndexCreator for the given MongoMappingContext and MongoDbFactory.

Parameters:
mappingContext - must not be null.
mongoDbFactory - must not be null.

MongoPersistentEntityIndexCreator

public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext,
                                         MongoDbFactory mongoDbFactory,
                                         org.springframework.data.mongodb.core.index.IndexResolver indexResolver)
Creats a new MongoPersistentEntityIndexCreator for the given MongoMappingContext and MongoDbFactory.

Parameters:
mappingContext - must not be null.
mongoDbFactory - must not be null.
indexResolver - must not be null.
Method Detail

onApplicationEvent

public void onApplicationEvent(MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty> event)
Specified by:
onApplicationEvent in interface ApplicationListener<MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty>>

isIndexCreatorFor

public boolean isIndexCreatorFor(MappingContext<?,?> context)
Returns whether the current index creator was registered for the given MappingContext.

Parameters:
context -
Returns:

Spring Data MongoDB - Core

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.