Package io.ocfl.core.db
Class ObjectDetailsDatabaseBuilder
- java.lang.Object
-
- io.ocfl.core.db.ObjectDetailsDatabaseBuilder
-
public class ObjectDetailsDatabaseBuilder extends Object
ConstructsObjectDetailsDatabase
instances
-
-
Constructor Summary
Constructors Constructor Description ObjectDetailsDatabaseBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectDetailsDatabase
build()
Constructs a newObjectDetailsDatabase
instance using the given dataSource.ObjectDetailsDatabaseBuilder
dataSource(DataSource dataSource)
Sets the DataSource to use for the object details table.ObjectDetailsDatabaseBuilder
storeInventory(boolean storeInventory)
If serialized inventories should be stored in the database.ObjectDetailsDatabaseBuilder
tableName(String tableName)
Sets the name of the table to use to store object details.ObjectDetailsDatabaseBuilder
waitTime(long waitTime, TimeUnit timeUnit)
Used to override the amount of time the client will wait to obtain a lock.
-
-
-
Method Detail
-
storeInventory
public ObjectDetailsDatabaseBuilder storeInventory(boolean storeInventory)
If serialized inventories should be stored in the database. Default: true.- Parameters:
storeInventory
- true if serialized inventories should be stored in the database.- Returns:
- builder
-
waitTime
public ObjectDetailsDatabaseBuilder waitTime(long waitTime, TimeUnit timeUnit)
Used to override the amount of time the client will wait to obtain a lock. Default: 10 seconds.- Parameters:
waitTime
- wait time (MariaDB uses seconds, while PostgreSQL and H2 use milliseconds)timeUnit
- unit of time- Returns:
- builder
-
dataSource
public ObjectDetailsDatabaseBuilder dataSource(DataSource dataSource)
Sets the DataSource to use for the object details table. This is a required field.- Parameters:
dataSource
- the DataSource- Returns:
- builder
-
tableName
public ObjectDetailsDatabaseBuilder tableName(String tableName)
Sets the name of the table to use to store object details. Default: ocfl_object_details- Parameters:
tableName
- the table name to use- Returns:
- builder
-
build
public ObjectDetailsDatabase build()
Constructs a newObjectDetailsDatabase
instance using the given dataSource. If the database does not already contain an object details table, it attempts to create one.- Returns:
- ObjectDetailsDatabase
-
-