Package io.ebean.config
Class DocStoreConfig
java.lang.Object
io.ebean.config.DocStoreConfig
public class DocStoreConfig extends Object
Configuration for the Document store integration (e.g. ElasticSearch).
-
Constructor Summary
Constructors Constructor Description DocStoreConfig() -
Method Summary
Modifier and Type Method Description intgetBulkBatchSize()Return the default batch size to use for calls to the Bulk API.StringgetMappingPath()Return the mapping path.StringgetMappingSuffix()Return the mapping suffix.StringgetPassword()Return the password credential for connecting to the document store.StringgetPathToResources()Return the relative file system path to resources when generating mapping files.io.ebean.annotation.DocStoreModegetPersist()Return the default behavior for when Insert, Update and Delete events occur on beans that have an associated Document store.StringgetUrl()Return the URL to the Document store.StringgetUsername()Return the user credential for connecting to the document store.booleanisActive()Return true if the Document store (ElasticSearch) integration is active.booleanisAllowAllCertificates()Return true if the client allows connections to invalid/self signed SSL certificates.booleanisCreate()Create true if the document store should create mapped indexes that don't yet exist.booleanisDropCreate()Return true if the document store should recreate mapped indexes.booleanisGenerateMapping()Return true if Ebean should generate mapping files on server startup.voidloadSettings(PropertiesWrapper properties)Load settings specified in properties files.voidsetActive(boolean active)Set to true to make the Document store (ElasticSearch) integration active.voidsetAllowAllCertificates(boolean allowAllCertificates)Set to true such that the client allows connections to invalid/self signed SSL certificates.voidsetBulkBatchSize(int bulkBatchSize)Set the default batch size to use for calls to the Bulk API.voidsetCreate(boolean create)Set to true if the document store should create mapped indexes that don't yet exist.voidsetDropCreate(boolean dropCreate)Set to true if the document store should recreate mapped indexes.voidsetGenerateMapping(boolean generateMapping)Set to true if Ebean should generate mapping files on server startup.voidsetMappingPath(String mappingPath)Set the mapping path.voidsetMappingSuffix(String mappingSuffix)Set the mapping suffix.voidsetPassword(String password)Set the password credential for connecting to the document store.voidsetPathToResources(String pathToResources)Set the relative file system path to resources when generating mapping files.voidsetPersist(io.ebean.annotation.DocStoreMode persist)Set the default behavior for when Insert, Update and Delete events occur on beans that have an associated Document store.voidsetUrl(String url)Set the URL to the Document store.voidsetUsername(String username)Set the user credential for connecting to the document store.
-
Constructor Details
-
DocStoreConfig
public DocStoreConfig()
-
-
Method Details
-
isActive
Return true if the Document store (ElasticSearch) integration is active. -
setActive
Set to true to make the Document store (ElasticSearch) integration active. -
getUrl
Return the URL to the Document store. -
getUsername
Return the user credential for connecting to the document store. -
setUsername
Set the user credential for connecting to the document store. -
getPassword
Return the password credential for connecting to the document store. -
setPassword
Set the password credential for connecting to the document store. -
setUrl
Set the URL to the Document store.For a local ElasticSearch server this would be: http://localhost:9200
-
isGenerateMapping
Return true if Ebean should generate mapping files on server startup. -
setGenerateMapping
Set to true if Ebean should generate mapping files on server startup. -
isDropCreate
Return true if the document store should recreate mapped indexes. -
setDropCreate
Set to true if the document store should recreate mapped indexes. -
isCreate
Create true if the document store should create mapped indexes that don't yet exist. This is only used if dropCreate is false. -
setCreate
Set to true if the document store should create mapped indexes that don't yet exist. This is only used if dropCreate is false. -
isAllowAllCertificates
Return true if the client allows connections to invalid/self signed SSL certificates. -
setAllowAllCertificates
Set to true such that the client allows connections to invalid/self signed SSL certificates. -
getBulkBatchSize
Return the default batch size to use for calls to the Bulk API. -
setBulkBatchSize
Set the default batch size to use for calls to the Bulk API.The batch size can be set on a transaction via
Transaction.setDocStoreBatchSize(int). -
getMappingPath
Return the mapping path. -
setMappingPath
Set the mapping path. -
getMappingSuffix
Return the mapping suffix. -
setMappingSuffix
Set the mapping suffix. -
getPathToResources
Return the relative file system path to resources when generating mapping files. -
setPathToResources
Set the relative file system path to resources when generating mapping files. -
getPersist
Return the default behavior for when Insert, Update and Delete events occur on beans that have an associated Document store. -
setPersist
Set the default behavior for when Insert, Update and Delete events occur on beans that have an associated Document store.- DocStoreEvent.UPDATE - build and send message to Bulk API
- DocStoreEvent.QUEUE - add an entry with the index type and id only into a queue for later processing
- DocStoreEvent.IGNORE - ignore. Most likely used when some scheduled batch job handles updating the index
You might choose to use QUEUE if that particular index data is updating very frequently or the cost of indexing is expensive. Setting it to QUEUE can mean many changes can be batched together potentially coalescing multiple updates for an index entry into a single update.
You might choose to use IGNORE when you have your own external process for updating the indexes. In this case you don't want Ebean to do anything when the data changes.
-
loadSettings
Load settings specified in properties files.
-