Class LuceneAccessor
java.lang.Object
org.springframework.data.gemfire.search.lucene.support.LuceneOperationsSupport
org.springframework.data.gemfire.search.lucene.LuceneAccessor
- All Implemented Interfaces:
InitializingBean
,LuceneOperations
- Direct Known Subclasses:
LuceneAccessorSupport
LuceneAccessor
is an abstract class supporting implementations of the LuceneOperations
interface
encapsulating common functionality necessary to execute Lucene queries.- Since:
- 1.1.0
- Author:
- John Blum
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
-
Field Summary
Fields inherited from interface org.springframework.data.gemfire.search.lucene.LuceneOperations
DEFAULT_PAGE_SIZE, DEFAULT_RESULT_LIMIT
-
Constructor Summary
ConstructorDescriptionConstructs an uninitialized instance ofLuceneAccessor
.LuceneAccessor
(String indexName, String regionPath) Constructs an instance of theLuceneAccessor
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.LuceneAccessor
(String indexName, Region<?, ?> region) Constructs an instance of theLuceneAccessor
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.LuceneAccessor
(LuceneIndex luceneIndex) Constructs an instance of theLuceneAccessor
initialized with the givenLuceneIndex
used to perform Lucene queries (searches). -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates an instance of theLuceneQueryFactory
to create and executeLucene queries
.createLuceneQueryFactory
(int resultLimit) Creates an instance of theLuceneQueryFactory
to create and executeLucene queries
.createLuceneQueryFactory
(int resultLimit, int pageSize) Creates an instance of theLuceneQueryFactory
to create and executeLucene queries
.protected <T> T
doFind
(LuceneAccessor.LuceneQueryExecutor<T> queryExecutor, Object query, String regionPath, String indexName) protected GemFireCache
getCache()
Returns a reference to theGemFireCache
.Returns the name of theLuceneIndex
used in Lucene queries.Returns a reference to theLuceneIndex
used in Lucene queries.protected LuceneService
Returns a reference to theLuceneService
used to perform Lucene query data access operations.Region<?,
?> Returns a reference to theRegion
used to specify Lucene queries.Returns a fully-qualified pathname to theRegion
used to specify Lucene queries.protected GemFireCache
Resolves a reference to theGemFireCache
.protected String
Resolves the name of theLuceneIndex
required in the Lucene data access, query operations when aLuceneIndex
is not specifically provided.protected LuceneService
Resolves theLuceneService
used by this data access object to perform Lucene queries.protected LuceneService
resolveLuceneService
(GemFireCache gemfireCache) Resolves theLuceneService
used by this data access object to perform Lucene queries.protected String
Resolves the fully-qualified pathname of theRegion
to which the Lucene data access, query operations are performed and theLuceneIndex
is applied, when aregion path
is not specifically provided.<T extends LuceneAccessor>
TsetCache
(GemFireCache gemfireCache) Sets a reference to theGemFireCache
.<T extends LuceneAccessor>
TsetIndexName
(String indexName) Sets the name of theLuceneIndex
used in Lucene queries.<T extends LuceneAccessor>
TsetLuceneIndex
(LuceneIndex luceneIndex) Sets a reference to theLuceneIndex
used in Lucene queries.<T extends LuceneAccessor>
TsetLuceneService
(LuceneService luceneService) Sets a reference to theLuceneService
used to perform Lucene query data access operations.<T extends LuceneAccessor>
TSets a reference to theRegion
used to specify Lucene queries.<T extends LuceneAccessor>
TsetRegionPath
(String regionPath) Sets a fully-qualified pathname to theRegion
used to specify Lucene queries.Methods inherited from class org.springframework.data.gemfire.search.lucene.support.LuceneOperationsSupport
query, query, query, query, queryForKeys, queryForKeys, queryForValues, queryForValues
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.gemfire.search.lucene.LuceneOperations
query, query, queryForKeys, queryForKeys, queryForValues, queryForValues
-
Constructor Details
-
LuceneAccessor
public LuceneAccessor()Constructs an uninitialized instance ofLuceneAccessor
. -
LuceneAccessor
Constructs an instance of theLuceneAccessor
initialized with the givenLuceneIndex
used to perform Lucene queries (searches).- Parameters:
luceneIndex
-LuceneIndex
used in Lucene queries.- See Also:
-
LuceneAccessor
Constructs an instance of theLuceneAccessor
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.- Parameters:
indexName
-String
containing the name of theLuceneIndex
used in Lucene queries.region
-Region
on which Lucene queries are executed.- See Also:
-
LuceneAccessor
Constructs an instance of theLuceneAccessor
initialized with the given Lucene index name andRegion
reference upon which Lucene queries are executed.- Parameters:
indexName
-String
containing the name of theLuceneIndex
used in Lucene queries.regionPath
-String
containing the name of theRegion
on which Lucene queries are executed.
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
createLuceneQueryFactory
Creates an instance of theLuceneQueryFactory
to create and executeLucene queries
.- Returns:
- an instance of the
LuceneQueryFactory
to create and executeLucene queries
. - See Also:
-
createLuceneQueryFactory
Creates an instance of theLuceneQueryFactory
to create and executeLucene queries
.- Parameters:
resultLimit
- limit to the number of results returned by the query.- Returns:
- an instance of the
LuceneQueryFactory
to create and executeLucene queries
. - See Also:
-
createLuceneQueryFactory
Creates an instance of theLuceneQueryFactory
to create and executeLucene queries
.- Parameters:
resultLimit
- limit to the number of results returned by the query.pageSize
- number of results appearing on a single page.- Returns:
- an instance of the
LuceneQueryFactory
to create and executeLucene queries
. - See Also:
-
resolveCache
Resolves a reference to theGemFireCache
.- Returns:
- a reference to the single instance of the
GemFireCache
. - See Also:
-
resolveLuceneService
Resolves theLuceneService
used by this data access object to perform Lucene queries.- Returns:
- a reference to the
GemFireCache
LuceneService
. - See Also:
-
resolveLuceneService
Resolves theLuceneService
used by this data access object to perform Lucene queries.- Parameters:
gemfireCache
-GemFireCache
used to resolve theLuceneService
.- Returns:
- a reference to the
GemFireCache
LuceneService
. - Throws:
IllegalArgumentException
- ifGemFireCache
is null.- See Also:
-
resolveIndexName
Resolves the name of theLuceneIndex
required in the Lucene data access, query operations when aLuceneIndex
is not specifically provided.- Returns:
- the name of the resolve
LuceneIndex
. - Throws:
IllegalStateException
- if the name of theLuceneIndex
cannot be resolved.- See Also:
-
resolveRegionPath
Resolves the fully-qualified pathname of theRegion
to which the Lucene data access, query operations are performed and theLuceneIndex
is applied, when aregion path
is not specifically provided.- Returns:
- a
String
containing the fully-qualified pathname of theRegion
on which the Lucene data access, query operations are performed and theLuceneIndex
is applied. - Throws:
IllegalStateException
- if the fully-qualified pathname of theRegion
cannot be resolved.- See Also:
-
setCache
Sets a reference to theGemFireCache
.- Type Parameters:
T
-Class
type of theLuceneAccessor
.- Parameters:
gemfireCache
-GemFireCache
reference.- Returns:
- this
LuceneAccessor
. - See Also:
-
getCache
Returns a reference to theGemFireCache
.- Returns:
- a reference to the
GemFireCache
. - See Also:
-
setIndexName
Sets the name of theLuceneIndex
used in Lucene queries.- Type Parameters:
T
-Class
type of theLuceneAccessor
.- Parameters:
indexName
-String
containing the name of theLuceneIndex
.- Returns:
- this
LuceneAccessor
. - See Also:
-
getIndexName
Returns the name of theLuceneIndex
used in Lucene queries.- Returns:
- a
String
containing the name of theLuceneIndex
. - See Also:
-
setLuceneIndex
Sets a reference to theLuceneIndex
used in Lucene queries.- Type Parameters:
T
-Class
type of theLuceneAccessor
.- Parameters:
luceneIndex
-LuceneIndex
used in Lucene data access, query operations.- Returns:
- this
LuceneAccessor
. - See Also:
-
getLuceneIndex
Returns a reference to theLuceneIndex
used in Lucene queries.- Returns:
- a
LuceneIndex
used in Lucene data access, query operations. - See Also:
-
setLuceneService
Sets a reference to theLuceneService
used to perform Lucene query data access operations.- Type Parameters:
T
-Class
type of theLuceneAccessor
.- Parameters:
luceneService
-LuceneService
used to perform Lucene queries.- Returns:
- this
LuceneAccessor
. - See Also:
-
getLuceneService
Returns a reference to theLuceneService
used to perform Lucene query data access operations.- Returns:
- a reference to the
LuceneService
used to perform Lucene queries. - See Also:
-
setRegion
Sets a reference to theRegion
used to specify Lucene queries.- Type Parameters:
T
-Class
type of theLuceneAccessor
.- Parameters:
region
-Region
used to specify Lucene queries.- Returns:
- this
LuceneAccessor
. - See Also:
-
getRegion
Returns a reference to theRegion
used to specify Lucene queries.- Returns:
- a
Region
used to specify Lucene queries. - See Also:
-
setRegionPath
Sets a fully-qualified pathname to theRegion
used to specify Lucene queries.- Type Parameters:
T
-Class
type of theLuceneAccessor
.- Parameters:
regionPath
-String
containing the fully-qualified pathname to theRegion
used to specify Lucene queries.- Returns:
- this
LuceneAccessor
. - See Also:
-
getRegionPath
Returns a fully-qualified pathname to theRegion
used to specify Lucene queries. -
doFind
protected <T> T doFind(LuceneAccessor.LuceneQueryExecutor<T> queryExecutor, Object query, String regionPath, String indexName)
-