StoreConfig (Oracle - Berkeley DB Java API)
Date: 2020-06-01

Package com.sleepycat.persist

## Class StoreConfig

- java.lang.Object
- - com.sleepycat.persist.StoreConfig

- All Implemented Interfaces:
    `java.lang.Cloneable`

      public class StoreConfig
      extends java.lang.Object
      implements java.lang.Cloneable

  Configuration properties used with an `EntityStore` or `RawStore`.

  `StoreConfig` objects are thread-safe. Multiple threads may safely call the methods of a shared `StoreConfig` object.

  See the package summary example for an example of using a `StoreConfig`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static StoreConfig` | `DEFAULT` | The default store configuration containing properties as if the configuration were constructed and not modified.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StoreConfig()` | Creates an entity store configuration object with default properties.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `StoreConfig` | `clone()` | Returns a shallow copy of the configuration.
    `StoreConfig` | `cloneConfig()` | Deprecated. As of JE 4.0.13, replaced by `clone()`.
    `void` | `enableEncrypted​(boolean enable)` | Enables encryption when the environment is also encrypted, see `EnvironmentConfig.setEncrypted`
    `boolean` | `getAllowCreate()` | Returns whether creation of a new store is allowed.
    `DatabaseNamer` | `getDatabaseNamer()` | Returns the object reponsible for naming of files and databases.
    `boolean` | `getEncrypted()` | Return true if the database has been configured to perform encryption.
    `boolean` | `getExclusiveCreate()` | Returns whether opening an existing store is prohibited.
    `EntityModel` | `getModel()` | Returns the entity model that defines entity classes and index keys.
    `Mutations` | `getMutations()` | Returns the configured mutations for performing lazy evolution of stored instances.
    `java.lang.String` | `getPassword()` |
    `boolean` | `getReadOnly()` | Returns the read-only configuration property.
    `boolean` | `getSecondaryBulkLoad()` | Returns the bulk-load-secondaries configuration property.
    `boolean` | `getTransactional()` | Returns the transactional configuration property.
    `StoreConfig` | `setAllowCreate​(boolean allowCreate)` | Specifies whether creation of a new store is allowed.
    `void` | `setAllowCreateVoid​(boolean allowCreate)` | The void return setter for use by Bean editors.
    `StoreConfig` | `setDatabaseNamer​(DatabaseNamer databaseNamer)` | Specifies the object reponsible for naming of files and databases.
    `void` | `setDatabaseNamerVoid​(DatabaseNamer databaseNamer)` | The void return setter for use by Bean editors.
    `void` | `setEncrypted​(java.lang.String password)` | Set the password used to perform encryption and decryption.
    `StoreConfig` | `setExclusiveCreate​(boolean exclusiveCreate)` | Specifies whether opening an existing store is prohibited.
    `void` | `setExclusiveCreateVoid​(boolean exclusiveCreate)` | The void return setter for use by Bean editors.
    `StoreConfig` | `setModel​(EntityModel model)` | Sets the entity model that defines entity classes and index keys.
    `void` | `setModelVoid​(EntityModel model)` | The void return setter for use by Bean editors.
    `StoreConfig` | `setMutations​(Mutations mutations)` | Configures mutations for performing lazy evolution of stored instances.
    `void` | `setMutationsVoid​(Mutations mutations)` | The void return setter for use by Bean editors.
    `StoreConfig` | `setReadOnly​(boolean readOnly)` | Sets the read-only configuration property.
    `void` | `setReadOnlyVoid​(boolean readOnly)` | The void return setter for use by Bean editors.
    `StoreConfig` | `setSecondaryBulkLoad​(boolean secondaryBulkLoad)` | Sets the bulk-load-secondaries configuration property.
    `void` | `setSecondaryBulkLoadVoid​(boolean secondaryBulkLoad)` | The void return setter for use by Bean editors.
    `StoreConfig` | `setTransactional​(boolean transactional)` | Sets the transactional configuration property.
    `void` | `setTransactionalVoid​(boolean transactional)` | The void return setter for use by Bean editors.

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT

          public static final StoreConfig DEFAULT

      The default store configuration containing properties as if the configuration were constructed and not modified.

  - ### Constructor Detail

    - #### StoreConfig

          public StoreConfig()

      Creates an entity store configuration object with default properties.

  - ### Method Detail

    - #### cloneConfig

          @Deprecated
          public StoreConfig cloneConfig()

      Deprecated.
      As of JE 4.0.13, replaced by `clone()`.
      Returns a shallow copy of the configuration.
      Returns:
        the clone.

    - #### clone

          public StoreConfig clone()

      Returns a shallow copy of the configuration.
      Overrides:
        `clone` in class `java.lang.Object`

    - #### setAllowCreate

          public StoreConfig setAllowCreate​(boolean allowCreate)

      Specifies whether creation of a new store is allowed. By default this property is false.

      If this property is false and the internal store metadata database does not exist, `DatabaseException` will be thrown when the store is opened.

      Parameters:
        `allowCreate` - whether creation of a new store is allowed.
      Returns:
        'this'.

    - #### setAllowCreateVoid

          public void setAllowCreateVoid​(boolean allowCreate)

      The void return setter for use by Bean editors.
      Parameters:
        `allowCreate` - whether creation of a new store is allowed.

    - #### getAllowCreate

          public boolean getAllowCreate()

      Returns whether creation of a new store is allowed.
      Returns:
        whether creation of a new store is allowed.

    - #### setExclusiveCreate

          public StoreConfig setExclusiveCreate​(boolean exclusiveCreate)

      Specifies whether opening an existing store is prohibited. By default this property is false.

      If this property is true and the internal store metadata database already exists, `DatabaseException` will be thrown when the store is opened.

      Parameters:
        `exclusiveCreate` - whether opening an existing store is prohibited.
      Returns:
        'this'.

    - #### setExclusiveCreateVoid

          public void setExclusiveCreateVoid​(boolean exclusiveCreate)

      The void return setter for use by Bean editors.
      Parameters:
        `exclusiveCreate` - whether opening an existing store is prohibited.

    - #### getExclusiveCreate

          public boolean getExclusiveCreate()

      Returns whether opening an existing store is prohibited.
      Returns:
        whether opening an existing store is prohibited.

    - #### setTransactional

          public StoreConfig setTransactional​(boolean transactional)

      Sets the transactional configuration property. By default this property is false.

      This property is true to open all store indices for transactional access. True may not be specified if the environment is not also transactional.

      Parameters:
        `transactional` - whether the store is transactional.
      Returns:
        'this'.

    - #### setTransactionalVoid

          public void setTransactionalVoid​(boolean transactional)

      The void return setter for use by Bean editors.
      Parameters:
        `transactional` - whether the store is transactional.

    - #### getTransactional

          public boolean getTransactional()

      Returns the transactional configuration property.
      Returns:
        whether the store is transactional.

    - #### setEncrypted

          public void setEncrypted​(java.lang.String password)

      Set the password used to perform encryption and decryption.

      Because databases opened within environments use the password specified to the environment, it is an error to attempt to set a password in a database created within an environment. To encrypt a database within an encrypted environment use `EnvironmentConfig.setEncrypted`

      Berkeley DB uses the Rijndael/AES (also known as the Advanced Encryption Standard and Federal Information Processing Standard (FIPS) 197) algorithm for encryption or decryption.

      Parameters:
        `password` - the password used to perform encryption and decryption

    - #### enableEncrypted

          public void enableEncrypted​(boolean enable)

      Enables encryption when the environment is also encrypted, see `EnvironmentConfig.setEncrypted`

      To encrypt a database that does not use an environment, see `StoreConfig.setEncrypted`

      Parameters:
        `enable` - encryption on this database.

    - #### getEncrypted

          public boolean getEncrypted()

      Return true if the database has been configured to perform encryption.

      This method may be called at any time during the life of the application.

      Returns:
        True if the database has been configured to perform encryption.

    - #### setReadOnly

          public StoreConfig setReadOnly​(boolean readOnly)

      Sets the read-only configuration property. By default this property is false.

      This property is true to open all store indices for read-only access, or false to open them for read-write access. False may not be specified if the environment is read-only.

      Parameters:
        `readOnly` - whether the store is read-only.
      Returns:
        'this'.

    - #### setReadOnlyVoid

          public void setReadOnlyVoid​(boolean readOnly)

      The void return setter for use by Bean editors.
      Parameters:
        `readOnly` - whether the store is read-only.

    - #### getReadOnly

          public boolean getReadOnly()

      Returns the read-only configuration property.
      Returns:
        whether the store is read-only.

    - #### setSecondaryBulkLoad

          public StoreConfig setSecondaryBulkLoad​(boolean secondaryBulkLoad)

      Sets the bulk-load-secondaries configuration property. By default this property is false.

      This property is true to cause the initial creation of secondary indices to be performed as a bulk load. If this property is true and `EntityStore.getSecondaryIndex` has never been called for a secondary index, that secondary index will not be created or written as records are written to the primary index. In addition, if that secondary index defines a foreign key constraint, the constraint will not be enforced.

      The secondary index will be populated later when the `getSecondaryIndex` method is called for the first time for that index, or when the store is closed and re-opened with this property set to false and the primary index is obtained. In either case, the secondary index is populated by reading through the entire primary index and adding records to the secondary index as needed. While populating the secondary, foreign key constraints will be enforced and an exception is thrown if a constraint is violated.

      When loading a primary index along with secondary indexes from a large input data set, configuring a bulk load of the secondary indexes is sometimes more performant than updating the secondary indexes each time the primary index is updated. The absence of foreign key constraints during the load also provides more flexibility.

      Parameters:
        `secondaryBulkLoad` - whether bulk-load-secondaries is used.
      Returns:
        'this'.

    - #### setSecondaryBulkLoadVoid

          public void setSecondaryBulkLoadVoid​(boolean secondaryBulkLoad)

      The void return setter for use by Bean editors.
      Parameters:
        `secondaryBulkLoad` - whether bulk-load-secondaries is used.

    - #### getSecondaryBulkLoad

          public boolean getSecondaryBulkLoad()

      Returns the bulk-load-secondaries configuration property.
      Returns:
        whether bulk-load-secondaries is used.

    - #### setModel

          public StoreConfig setModel​(EntityModel model)

      Sets the entity model that defines entity classes and index keys.

      If null is specified or this method is not called, an `AnnotationModel` instance is used by default.

      Parameters:
        `model` - the EntityModel.
      Returns:
        'this'.

    - #### setModelVoid

          public void setModelVoid​(EntityModel model)

      The void return setter for use by Bean editors.
      Parameters:
        `model` - the EntityModel.

    - #### getModel

          public EntityModel getModel()

      Returns the entity model that defines entity classes and index keys.
      Returns:
        the EntityModel.

    - #### setMutations

          public StoreConfig setMutations​(Mutations mutations)

      Configures mutations for performing lazy evolution of stored instances. Existing mutations for this store are not cleared, so the mutations required are only those changes that have been made since the store was last opened. Some new mutations may override existing specifications, and some may be supplemental.

      If null is specified and the store already exists, the previously specified mutations are used. The mutations are stored persistently in serialized form.

      Mutations must be available to handle all changes to classes that are incompatible with the class definitions known to this store. See `Mutations` and `Class Evolution` for more information.

      If an incompatible class change has been made and mutations are not available for handling the change, `IncompatibleClassException` will be thrown when creating an `EntityStore`.

      Parameters:
        `mutations` - the Mutations.
      Returns:
        'this'.

    - #### setMutationsVoid

          public void setMutationsVoid​(Mutations mutations)

      The void return setter for use by Bean editors.
      Parameters:
        `mutations` - the Mutations.

    - #### getMutations

          public Mutations getMutations()

      Returns the configured mutations for performing lazy evolution of stored instances.
      Returns:
        the Mutations.

    - #### setDatabaseNamer

          public StoreConfig setDatabaseNamer​(DatabaseNamer databaseNamer)

      Specifies the object reponsible for naming of files and databases. By default this property is `DatabaseNamer.DEFAULT`.
      Parameters:
        `databaseNamer` - the DatabaseNamer.
      Returns:
        'this'.
      Throws:
        `java.lang.NullPointerException` - if a null parameter value is passed.

    - #### setDatabaseNamerVoid

          public void setDatabaseNamerVoid​(DatabaseNamer databaseNamer)

      The void return setter for use by Bean editors.
      Parameters:
        `databaseNamer` - the DatabaseNamer.

    - #### getDatabaseNamer

          public DatabaseNamer getDatabaseNamer()

      Returns the object reponsible for naming of files and databases.
      Returns:
        the DatabaseNamer.

    - #### getPassword

          public java.lang.String getPassword()

Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.