Interface SearchMapping
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
InfinispanMapping
public interface SearchMapping extends AutoCloseable
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Collection<? extends SearchIndexedEntity>allIndexedEntities()Set<Class<?>>allIndexedEntityJavaClasses()Set<String>allIndexedEntityNames()static SearchMappingBuilderbuilder(org.hibernate.search.mapper.pojo.model.spi.PojoBootstrapIntrospector introspector, ClassLoader aggregatedClassLoader, Collection<ProgrammaticSearchMappingProvider> mappingProviders, org.infinispan.util.concurrent.BlockingManager blockingManager, org.infinispan.util.concurrent.NonBlockingManager nonBlockingManager)voidclose()org.hibernate.search.engine.reporting.FailureHandlergetFailureHandler()SearchSessiongetMappingSession()SearchIndexergetSearchIndexer()SearchIndexedEntityindexedEntity(Class<?> entityType)SearchIndexedEntityindexedEntity(String entityName)booleanisClose()default booleanisRestarting()default voidreload()Releases all used resources (IO, threads) and restarts from the mapping configuration.default voidrestart()Releases some used resources (e.g.: threads), preserving some others (e.g.: IO) and restarts from the mapping configuration.default <E> SearchScope<E>scope(Class<E> type)Create aSearchScopelimited to the given type.<E> SearchScope<E>scope(Collection<? extends Class<? extends E>> types)Create aSearchScopelimited to the given types.SearchScope<?>scopeAll()Class<?>toConvertedEntityJavaClass(Object value)
-
-
-
Method Detail
-
scope
default <E> SearchScope<E> scope(Class<E> type)
Create aSearchScopelimited to the given type.- Type Parameters:
E- An entity type to include in the scope.- Parameters:
type- A type to include in the scope.- Returns:
- The created scope.
- See Also:
SearchScope
-
scope
<E> SearchScope<E> scope(Collection<? extends Class<? extends E>> types)
Create aSearchScopelimited to the given types.- Type Parameters:
E- An entity to include in the scope.- Parameters:
types- A collection of types to include in the scope.- Returns:
- The created scope.
- See Also:
SearchScope
-
scopeAll
SearchScope<?> scopeAll()
-
getFailureHandler
org.hibernate.search.engine.reporting.FailureHandler getFailureHandler()
-
close
void close()
- Specified by:
closein interfaceAutoCloseable
-
isClose
boolean isClose()
-
isRestarting
default boolean isRestarting()
-
getMappingSession
SearchSession getMappingSession()
-
getSearchIndexer
SearchIndexer getSearchIndexer()
-
indexedEntity
SearchIndexedEntity indexedEntity(Class<?> entityType)
- Parameters:
entityType- The type of an possible-indexed entity.- Returns:
- A
SearchIndexedEntityfor the indexed entity with the exact given type, if the type matches some indexed entity, otherwisenull.
-
indexedEntity
SearchIndexedEntity indexedEntity(String entityName)
-
allIndexedEntities
Collection<? extends SearchIndexedEntity> allIndexedEntities()
- Returns:
- A collection containing one
SearchIndexedEntityfor each indexed entity
-
allIndexedEntityNames
Set<String> allIndexedEntityNames()
- Returns:
- A set containing the name of
all indexed entities.
-
reload
default void reload()
Releases all used resources (IO, threads) and restarts from the mapping configuration.
-
restart
default void restart()
Releases some used resources (e.g.: threads), preserving some others (e.g.: IO) and restarts from the mapping configuration.
-
toConvertedEntityJavaClass
Class<?> toConvertedEntityJavaClass(Object value)
- Parameters:
value- An entity.- Returns:
- The internal Java class for this entity after conversion,
i.e. the Java class that will be returned by
allIndexedEntityJavaClasses()if this entity is potentially indexed. In practice, this is only useful to handle protobuf type: if an instance of ProtobufValueWrapper is passed, this will return byte[] because that's the type we use for protobuf values internally. For all other types, this just returns value.getClass(). - See Also:
EntityConverter
-
builder
static SearchMappingBuilder builder(org.hibernate.search.mapper.pojo.model.spi.PojoBootstrapIntrospector introspector, ClassLoader aggregatedClassLoader, Collection<ProgrammaticSearchMappingProvider> mappingProviders, org.infinispan.util.concurrent.BlockingManager blockingManager, org.infinispan.util.concurrent.NonBlockingManager nonBlockingManager)
-
-