Package io.bdeploy.bhive
Class BHive.Operation<T>
java.lang.Object
io.bdeploy.bhive.BHive.Operation<T>
- All Implemented Interfaces:
BHiveExecution,Callable<T>
- Direct Known Subclasses:
AwaitDirectoryLockOperation,BHive.TransactedOperation,CopyOperation,ExportOperation,ExportTreeOperation,FsckOperation,InsertManifestOperation,LockDirectoryOperation,ManifestConsistencyCheckOperation,ManifestDeleteOldByIdOperation,ManifestDeleteOperation,ManifestExistsOperation,ManifestLexicalMaxTagOperation,ManifestListOperation,ManifestLoadOperation,ManifestMaxIdOperation,ManifestNextIdOperation,ManifestRefLoadOperation,ManifestRefScanOperation,ObjectConsistencyCheckOperation,ObjectExistsOperation,ObjectListOperation,ObjectLoadOperation,ObjectSizeOperation,ObjectWriteOperation,PruneOperation,ReleaseDirectoryLockOperation,RemoteOperation,ScanOperation,TreeEntryLoadOperation,TreeLoadOperation
- Enclosing class:
- BHive
public abstract static class BHive.Operation<T>
extends Object
implements Callable<T>, BHiveExecution
Base class for all operations that need to access internals of the
BHive they are executed on.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<X> Xexecute(BHive.Operation<X> other) Execute anotherBHive.Operationon theBHivewhich is currently associated with thisBHive.Operation.protected ActivityReporterprotected AuditorReturns the supplier that provide the content to be written to the lock file.Returns the validator to check is a given lock file is still valid.protected ManifestDatabaseprotected Pathprotected ObjectManagersetRetryCount(int retryCount) Sets the number of times the operation should be retried in case of an exception.protected Future<?>Submit aRunnableperforming a file operation to the pool managing those operations.
-
Constructor Details
-
Operation
public Operation()
-
-
Method Details
-
getObjectManager
- Returns:
- the
ObjectManagerto use when operating on the underlyingObjectDatabase.
-
getManifestDatabase
- Returns:
- the underlying
ManifestDatabase
-
getMarkerRoot
- Returns:
- the root path for marker databases which contribute to protected objects.
-
getActivityReporter
- Returns:
- the
ActivityReporterto manageActivityReporter.Activitys with.
-
getAuditor
-
getLockContentValidator
Returns the validator to check is a given lock file is still valid. -
getLockContentSupplier
Returns the supplier that provide the content to be written to the lock file. -
getTransactions
- Specified by:
getTransactionsin interfaceBHiveExecution- Returns:
- the transactions manager for this
BHiveExecution
-
submitFileOperation
Submit aRunnableperforming a file operation to the pool managing those operations.- Parameters:
op- the operation to run- Returns:
- a
Futurewhich can awaited, seeFutureHelper.awaitAll(java.util.Collection).
-
execute
Execute anotherBHive.Operationon theBHivewhich is currently associated with thisBHive.Operation.- Specified by:
executein interfaceBHiveExecution- Parameters:
other- theBHive.Operationto execute- Returns:
- the
BHive.Operations declared return type.
-
setRetryCount
Sets the number of times the operation should be retried in case of an exception. The default value is '0' which means that the operation is not retried on failure. A retry count of '4' means that the operation is executed up to 5 times before giving up (First run + 4 retries).The default value is '0' which means an operation is not retried in case of an exception.
- Parameters:
retryCount- the number of times to retry the operation
-