Spring Data for VMware GemFire
Package org.springframework.data.gemfire
Class IndexFactoryBean
java.lang.Object
org.springframework.data.gemfire.support.AbstractFactoryBeanSupport<org.apache.geode.cache.query.Index>
org.springframework.data.gemfire.IndexFactoryBean
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.BeanClassLoaderAware,- org.springframework.beans.factory.BeanFactoryAware,- org.springframework.beans.factory.BeanNameAware,- org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.query.Index>,- org.springframework.beans.factory.InitializingBean
public class IndexFactoryBean
extends AbstractFactoryBeanSupport<org.apache.geode.cache.query.Index>
implements org.springframework.beans.factory.InitializingBean
Spring 
FactoryBean used to construct, configure and initialize an Index.- Since:
- 1.0.0
- See Also:
- 
- Region
- RegionService
- Index
- IndexStatistics
- QueryService
- FactoryBean
- InitializingBean
- ConfigurableBeanFactory
- IndexFactoryBean.IndexWrapper
- IndexConfigurer
- AbstractFactoryBeanSupport
 
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsFields inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupportDEFAULT_SINGLETONFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected voidapplyIndexConfigurers(String indexName, Iterable<IndexConfigurer> indexConfigurers) protected voidapplyIndexConfigurers(String indexName, IndexConfigurer... indexConfigurers) Null-safe operation to apply the given array ofIndexConfigurersto thisIndexFactoryBean.protected IndexConfigurerReturns a reference to the CompositeIndexConfigurerused to apply additional configuration to thisIndexFactoryBeanon Spring container initialization.org.apache.geode.cache.query.IndexgetIndex()Returns a reference to theIndexcreated by thisIndexFactoryBean.org.apache.geode.cache.query.IndexClass<?>protected booleanisDefine()Returns a boolean indicating whether theIndexdeclared and defined by thisIndexFactoryBeanwill only be defined initially, or defined and created.booleanDetermines whether to ignore theIndexdefined by thisIndexFactoryBeanwhen anIndexExistsExceptionorIndexNameConflictExceptionis thrown.booleanDetermines whether to override an existingIndexhaving the same definition but different name as theIndexthat would be created by thisIndexFactoryBean.voidsetCache(org.apache.geode.cache.RegionService cache) Sets a reference to theRegionService.voidsetDefine(boolean define) Sets a boolean condition to indicate whether theIndexdeclared and defined by thisIndexFactoryBeanwill only be defined initially, or defined and created.voidsetExpression(String expression) voidvoidsetIgnoreIfExists(boolean ignore) Configures whether to ignore theIndexdefined by thisIndexFactoryBeanwhen anIndexExistsExceptionorIndexNameConflictExceptionis thrown.voidsetImports(String imports) voidsetIndexConfigurers(List<IndexConfigurer> indexConfigurers) Null-safe operation to set anIterableofIndexConfigurersused to apply additional configuration to thisIndexFactoryBeanwhen using Annotation-based configuration.voidsetIndexConfigurers(IndexConfigurer... indexConfigurers) Null-safe operation to set an array ofIndexConfigurersused to apply additional configuration to thisIndexFactoryBeanwhen using Annotation-based configuration.voidSets the name of theIndex.voidsetOverride(boolean override) Configures whether to override an existingIndexhaving the same definition but different name as theIndexthat would be created by thisIndexFactoryBean.voidsetQueryService(org.apache.geode.cache.query.QueryService service) Sets theQueryServiceused to create theIndex.voidvoidSet thetypeof theIndex.Methods inherited from class org.springframework.data.gemfire.support.AbstractFactoryBeanSupportgetBeanClassLoader, getBeanFactory, getBeanName, getLogger, getOptionalLogger, isDebugLoggingEnabled, isErrorLoggingEnabled, isInfoLoggingEnabled, isSingleton, isWarnLoggingEnabled, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, newLogger, setBeanClassLoader, setBeanFactory, setBeanName
- 
Field Details- 
BASIC_INDEX_DEFINITION- See Also:
 
- 
DETAILED_INDEX_DEFINITION- See Also:
 
 
- 
- 
Constructor Details- 
IndexFactoryBeanpublic IndexFactoryBean()
 
- 
- 
Method Details- 
afterPropertiesSet- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
- Throws:
- Exception
 
- 
applyIndexConfigurersNull-safe operation to apply the given array ofIndexConfigurersto thisIndexFactoryBean.- Parameters:
- indexName-- Stringcontaining the name of the- Index.
- indexConfigurers- array of- IndexConfigurersapplied to this- IndexFactoryBean.
- See Also:
 
- 
applyIndexConfigurers- Parameters:
- indexName-- Stringcontaining the name of the- Index.
- indexConfigurers-- Iterableof- IndexConfigurersapplied to this- IndexFactoryBean.
- See Also:
 
- 
getCompositeIndexConfigurerReturns a reference to the CompositeIndexConfigurerused to apply additional configuration to thisIndexFactoryBeanon Spring container initialization.- Returns:
- the Composite IndexConfigurer.
- See Also:
 
- 
getIndexpublic org.apache.geode.cache.query.Index getIndex()Returns a reference to theIndexcreated by thisIndexFactoryBean.- Returns:
- a reference to the Indexcreated by thisIndexFactoryBean.
- See Also:
- 
- Index
 
 
- 
getObjectpublic org.apache.geode.cache.query.Index getObject()- Specified by:
- getObjectin interface- org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.query.Index>
 
- 
getObjectType- Specified by:
- getObjectTypein interface- org.springframework.beans.factory.FactoryBean<org.apache.geode.cache.query.Index>
 
- 
setCachepublic void setCache(org.apache.geode.cache.RegionService cache) Sets a reference to theRegionService.- Parameters:
- cache- reference to the- RegionService.
- See Also:
- 
- RegionService
 
 
- 
setNameSets the name of theIndex.- Parameters:
- name-- Stringcontaining the name given to the- Index.
 
- 
setQueryServicepublic void setQueryService(org.apache.geode.cache.query.QueryService service) Sets theQueryServiceused to create theIndex.- Parameters:
- service-- QueryServiceused to create the- Index.
- See Also:
- 
- QueryService
 
 
- 
setDefinepublic void setDefine(boolean define) Sets a boolean condition to indicate whether theIndexdeclared and defined by thisIndexFactoryBeanwill only be defined initially, or defined and created. If defined-only, theIndexFactoryBeanwill receive a callback at the end of the Spring container lifecycle to subsequently "create" all "defined-only"Indexesonce, in a single operation.- Parameters:
- define- a boolean value indicating the define or define/create status. If true, the- Indexdeclared by this- IndexFactoryBeanwill only be defined initially and subsequently created when this bean receives an appropriate callback from the Spring container; if false, the- Indexwill be created immediately.
 
- 
isDefineprotected boolean isDefine()Returns a boolean indicating whether theIndexdeclared and defined by thisIndexFactoryBeanwill only be defined initially, or defined and created. If defined-only, theIndexFactoryBeanwill receive a callback at the end of the Spring container lifecycle to subsequently "create" all "defined-only"Indexesonce, in a single operation.- Returns:
- a boolean value indicating the define or define/create status.  If true, the Indexdeclared by thisIndexFactoryBeanwill only be defined initially and subsequently created when this bean receives an appropriate callback from the Spring container; if false, theIndexwill be created immediately.
 
- 
setExpression- Parameters:
- expression- Index expression to set
 
- 
setFrom- Parameters:
- from- Index from clause to set
 
- 
setImports- Parameters:
- imports- Index imports to set
 
- 
setIgnoreIfExistspublic void setIgnoreIfExists(boolean ignore) Configures whether to ignore theIndexdefined by thisIndexFactoryBeanwhen anIndexExistsExceptionorIndexNameConflictExceptionis thrown. AnIndexExistsExceptionis thrown when there exists anotherIndexwith the same definition but with another name. AnIndexNameConflictExceptionis thrown when there exists anotherIndexwith the same name but possibly a different definition. When ignoreIfExists is set to true and anIndexExistsExceptionis thrown, then the existingIndexwill be returned as the object of thisIndexFactoryBeancreation and the name of the existingIndexis added as an alias for this bean. When ignoreIfExists is set to true andIndexNameConflictExceptionis thrown, then the existingIndexwill be returned as the object of thisIndexFactoryBeancreation. A warning is logged if the definition of thisIndexFactoryBeanand the existingIndexare different. ignoreIfExists takes precedence overoverride. Defaults to false.- Parameters:
- ignore- boolean value indicating whether to ignore the- Indexdefined by this- IndexFactoryBean. Default is false.
- See Also:
 
- 
isIgnoreIfExistspublic boolean isIgnoreIfExists()Determines whether to ignore theIndexdefined by thisIndexFactoryBeanwhen anIndexExistsExceptionorIndexNameConflictExceptionis thrown. AnIndexExistsExceptionis thrown when there exists anotherIndexwith the same definition but with another name. AnIndexNameConflictExceptionis thrown when there exists anotherIndexwith the same name but possibly a different definition. When ignoreIfExists is set to true and anIndexExistsExceptionis thrown, then the existingIndexwill be returned as the object of thisIndexFactoryBeancreation and the name of the existingIndexis added as an alias for this bean. When ignoreIfExists is set to true andIndexNameConflictExceptionis thrown, then the existingIndexwill be returned as the object of thisIndexFactoryBeancreation. A warning is logged if the definition of thisIndexFactoryBeanand the existingIndexare different. ignoreIfExists takes precedence overoverride. Defaults to false.- Returns:
- a boolean value indicating whether to ignore the Indexdefined by thisIndexFactoryBean. Default is false.
- See Also:
 
- 
setIndexConfigurersNull-safe operation to set an array ofIndexConfigurersused to apply additional configuration to thisIndexFactoryBeanwhen using Annotation-based configuration.- Parameters:
- indexConfigurers- array of- IndexConfigurersused to apply additional configuration to this- IndexFactoryBean.
- See Also:
 
- 
setIndexConfigurersNull-safe operation to set anIterableofIndexConfigurersused to apply additional configuration to thisIndexFactoryBeanwhen using Annotation-based configuration.- Parameters:
- indexConfigurers-- Iterableof- IndexConfigurersused to apply additional configuration to this- IndexFactoryBean.
- See Also:
 
- 
setOverridepublic void setOverride(boolean override) Configures whether to override an existingIndexhaving the same definition but different name as theIndexthat would be created by thisIndexFactoryBean. AnIndexExistsExceptionis thrown when there exists anotherIndexwith the same definition but with another name. AnIndexNameConflictExceptionis thrown when there exists anotherIndexwith the same name but possibly a different definition. With override set to true when anIndexExistsExceptionis thrown, then override is effectively the same as "renaming" the existingIndex. In other words, the existingIndexwill beremovedand recreated by thisIndexFactoryBeanunder the newnamehaving the same definition. With override set to true when anIndexNameConflictExceptionis thrown, then overriding the existingIndexis equivalent to changing the existingIndexdefinition. When this happens, a warning is logged. If the existingIndexdefinition is the same then overriding effectively just rebuilds theIndex. ignoreIfExists takes precedence over override. Defaults to false.- Parameters:
- override- boolean value indicating whether an existing- Indexwill be removed and recreated by this- IndexFactoryBean. Default is false.
- See Also:
 
- 
isOverridepublic boolean isOverride()Determines whether to override an existingIndexhaving the same definition but different name as theIndexthat would be created by thisIndexFactoryBean. AnIndexExistsExceptionis thrown when there exists anotherIndexwith the same definition but with another name. AnIndexNameConflictExceptionis thrown when there exists anotherIndexwith the same name but possibly a different definition. With override set to true when anIndexExistsExceptionis thrown, then override is effectively the same as "renaming" the existingIndex. In other words, the existingIndexwill beremovedand recreated by thisIndexFactoryBeanunder the newnamehaving the same definition. With override set to true when anIndexNameConflictExceptionis thrown, then overriding the existingIndexis equivalent to changing the existingIndexdefinition. When this happens, a warning is logged. If the existingIndexdefinition is the same then overriding effectively just rebuilds theIndex. ignoreIfExists takes precedence over override. Defaults to false.- Returns:
- a boolean value indicating whether an existing Indexwill be removed and recreated by thisIndexFactoryBean. Default is false.
- See Also:
 
- 
setType
- 
setTypeSet thetypeof theIndex.
 
- 
