Module io.ebean.api

Class DocStoreConfig

java.lang.Object
io.ebean.config.DocStoreConfig

public class DocStoreConfig extends Object
Configuration for the Document store integration (e.g. ElasticSearch).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    True when the Document store integration is active/on.
    protected boolean
    Set to true such that the client allows connections to invalid/self signed SSL certificates.
    protected int
    The default batch size to use for the Bulk API calls.
    protected boolean
    When true the Document store should create any document indexes that don't already exist.
    protected boolean
    When true the Document store should drop and re-create document indexes.
    protected boolean
    Set to true means Ebean will generate mapping files on startup.
    protected String
    Resource path for the Document store mapping files.
    protected String
    Suffix used for mapping files.
    protected String
    Password credential that be used for authentication to document store.
    protected String
    Location of resources that mapping files are generated into.
    protected io.ebean.annotation.DocStoreMode
    The default mode used by indexes.
    protected String
    The URL of the Document store.
    protected String
    Credential that be used for authentication to document store.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return the default batch size to use for calls to the Bulk API.
    Return the mapping path.
    Return the mapping suffix.
    Return the password credential for connecting to the document store.
    Return the relative file system path to resources when generating mapping files.
    io.ebean.annotation.DocStoreMode
    Return the default behavior for when Insert, Update and Delete events occur on beans that have an associated Document store.
    Return the URL to the Document store.
    Return the user credential for connecting to the document store.
    boolean
    Return true if the Document store (ElasticSearch) integration is active.
    boolean
    Return true if the client allows connections to invalid/self signed SSL certificates.
    boolean
    Create true if the document store should create mapped indexes that don't yet exist.
    boolean
    Return true if the document store should recreate mapped indexes.
    boolean
    Return true if Ebean should generate mapping files on server startup.
    void
    Load settings specified in properties files.
    void
    setActive(boolean active)
    Set to true to make the Document store (ElasticSearch) integration active.
    void
    setAllowAllCertificates(boolean allowAllCertificates)
    Set to true such that the client allows connections to invalid/self signed SSL certificates.
    void
    setBulkBatchSize(int bulkBatchSize)
    Set the default batch size to use for calls to the Bulk API.
    void
    setCreate(boolean create)
    Set to true if the document store should create mapped indexes that don't yet exist.
    void
    setDropCreate(boolean dropCreate)
    Set to true if the document store should recreate mapped indexes.
    void
    setGenerateMapping(boolean generateMapping)
    Set to true if Ebean should generate mapping files on server startup.
    void
    setMappingPath(String mappingPath)
    Set the mapping path.
    void
    setMappingSuffix(String mappingSuffix)
    Set the mapping suffix.
    void
    setPassword(String password)
    Set the password credential for connecting to the document store.
    void
    setPathToResources(String pathToResources)
    Set the relative file system path to resources when generating mapping files.
    void
    setPersist(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.
    void
    Set the URL to the Document store.
    void
    setUsername(String username)
    Set the user credential for connecting to the document store.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • active

      protected boolean active
      True when the Document store integration is active/on.
    • generateMapping

      protected boolean generateMapping
      Set to true means Ebean will generate mapping files on startup.
    • dropCreate

      protected boolean dropCreate
      When true the Document store should drop and re-create document indexes.
    • create

      protected boolean create
      When true the Document store should create any document indexes that don't already exist.
    • url

      protected String url
      The URL of the Document store. For example: http://localhost:9200.
    • username

      protected String username
      Credential that be used for authentication to document store.
    • password

      protected String password
      Password credential that be used for authentication to document store.
    • allowAllCertificates

      protected boolean allowAllCertificates
      Set to true such that the client allows connections to invalid/self signed SSL certificates.
    • persist

      protected io.ebean.annotation.DocStoreMode persist
      The default mode used by indexes.
    • bulkBatchSize

      protected int bulkBatchSize
      The default batch size to use for the Bulk API calls.
    • mappingPath

      protected String mappingPath
      Resource path for the Document store mapping files.
    • mappingSuffix

      protected String mappingSuffix
      Suffix used for mapping files.
    • pathToResources

      protected String pathToResources
      Location of resources that mapping files are generated into.
  • Constructor Details

    • DocStoreConfig

      public DocStoreConfig()
  • Method Details

    • isActive

      public boolean isActive()
      Return true if the Document store (ElasticSearch) integration is active.
    • setActive

      public void setActive(boolean active)
      Set to true to make the Document store (ElasticSearch) integration active.
    • getUrl

      public String getUrl()
      Return the URL to the Document store.
    • getUsername

      public String getUsername()
      Return the user credential for connecting to the document store.
    • setUsername

      public void setUsername(String username)
      Set the user credential for connecting to the document store.
    • getPassword

      public String getPassword()
      Return the password credential for connecting to the document store.
    • setPassword

      public void setPassword(String password)
      Set the password credential for connecting to the document store.
    • setUrl

      public void setUrl(String url)
      Set the URL to the Document store.

      For a local ElasticSearch server this would be: http://localhost:9200

    • isGenerateMapping

      public boolean isGenerateMapping()
      Return true if Ebean should generate mapping files on server startup.
    • setGenerateMapping

      public void setGenerateMapping(boolean generateMapping)
      Set to true if Ebean should generate mapping files on server startup.
    • isDropCreate

      public boolean isDropCreate()
      Return true if the document store should recreate mapped indexes.
    • setDropCreate

      public void setDropCreate(boolean dropCreate)
      Set to true if the document store should recreate mapped indexes.
    • isCreate

      public boolean 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

      public void setCreate(boolean create)
      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

      public boolean isAllowAllCertificates()
      Return true if the client allows connections to invalid/self signed SSL certificates.
    • setAllowAllCertificates

      public void setAllowAllCertificates(boolean allowAllCertificates)
      Set to true such that the client allows connections to invalid/self signed SSL certificates.
    • getBulkBatchSize

      public int getBulkBatchSize()
      Return the default batch size to use for calls to the Bulk API.
    • setBulkBatchSize

      public void setBulkBatchSize(int bulkBatchSize)
      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

      public String getMappingPath()
      Return the mapping path.
    • setMappingPath

      public void setMappingPath(String mappingPath)
      Set the mapping path.
    • getMappingSuffix

      public String getMappingSuffix()
      Return the mapping suffix.
    • setMappingSuffix

      public void setMappingSuffix(String mappingSuffix)
      Set the mapping suffix.
    • getPathToResources

      public String getPathToResources()
      Return the relative file system path to resources when generating mapping files.
    • setPathToResources

      public void setPathToResources(String pathToResources)
      Set the relative file system path to resources when generating mapping files.
    • getPersist

      public io.ebean.annotation.DocStoreMode getPersist()
      Return the default behavior for when Insert, Update and Delete events occur on beans that have an associated Document store.
    • setPersist

      public void setPersist(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.
      • 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

      public void loadSettings(PropertiesWrapper properties)
      Load settings specified in properties files.