Package edu.wisc.library.ocfl.core.db
Class ObjectDetailsDatabaseBuilder
- java.lang.Object
-
- edu.wisc.library.ocfl.core.db.ObjectDetailsDatabaseBuilder
-
public class ObjectDetailsDatabaseBuilder extends Object
ConstructsObjectDetailsDatabaseinstances
-
-
Constructor Summary
Constructors Constructor Description ObjectDetailsDatabaseBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectDetailsDatabasebuild()Constructs a newObjectDetailsDatabaseinstance using the given dataSource.ObjectDetailsDatabaseBuilderdataSource(DataSource dataSource)Sets the DataSource to use for the object details table.ObjectDetailsDatabaseBuilderstoreInventory(boolean storeInventory)If serialized inventories should be stored in the database.ObjectDetailsDatabaseBuildertableName(String tableName)Sets the name of the table to use to store object details.ObjectDetailsDatabaseBuilderwaitTime(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 newObjectDetailsDatabaseinstance using the given dataSource. If the database does not already contain an object details table, it attempts to create one.- Returns:
- ObjectDetailsDatabase
-
-