Package io.bdeploy.bhive
Class BHive
java.lang.Object
io.bdeploy.bhive.BHive
- All Implemented Interfaces:
BHiveExecution,AutoCloseable
A high level management layer for storage repositories.
Encapsulates ObjectDatabase and ManifestDatabase, provides
over arching functionality.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase class for all operations that need to access internals of theBHivethey are executed on.static classBase class for operations which require an open transaction, set up by the caller. -
Constructor Summary
ConstructorsConstructorDescriptionBHive(URI uri, Auditor auditor, ActivityReporter reporter) Creates a new hive instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpawnListener(ManifestSpawnListener listener) voidclose()<T> Texecute(BHive.Operation<T> op) Execute the givenBHive.Operationon thisBHive.Retrieve the auditor for testing.Get the supplier that provides lock file contentGet the predicate that is used to validate an existing lock file.getUri()voidremoveSpawnListener(ManifestSpawnListener listener) voidsetLockContentSupplier(Supplier<String> lockContentSupplier) Sets the supplier that provides the content that is written to a lock file.voidsetLockContentValidator(Predicate<String> lockContentValidator) Sets the predicate that is used to validate an existing lock file.voidsetParallelism(int parallelism) Set the amount of threads to use for parallel-capable file operations.
-
Constructor Details
-
BHive
Creates a new hive instance. Supports ZIP and directory hives.To connect to a remote hive instead, use
RemoteBHive.forService(io.bdeploy.common.security.RemoteService, String, ActivityReporter)
-
-
Method Details
-
getUri
-
setParallelism
public void setParallelism(int parallelism) Set the amount of threads to use for parallel-capable file operations. -
getAuditor
Retrieve the auditor for testing. -
addSpawnListener
-
removeSpawnListener
-
setLockContentSupplier
Sets the supplier that provides the content that is written to a lock file. -
setLockContentValidator
Sets the predicate that is used to validate an existing lock file. -
getLockContentSupplier
Get the supplier that provides lock file content -
getLockContentValidator
Get the predicate that is used to validate an existing lock file. -
execute
Execute the givenBHive.Operationon thisBHive.- Specified by:
executein interfaceBHiveExecution- Parameters:
op- theBHive.Operationto execute- Returns:
- the
BHive.Operations declared return type.
-
getTransactions
- Specified by:
getTransactionsin interfaceBHiveExecution- Returns:
- the
BHiveTransactionstracker.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-