Package io.bdeploy.bhive.objects
Class ManifestDatabase
java.lang.Object
io.bdeploy.bhive.objects.LockableDatabase
io.bdeploy.bhive.objects.ManifestDatabase
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class io.bdeploy.bhive.objects.LockableDatabase
LockableDatabase.LockedOperation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddManifest(Manifest manifest) Concurrent-save adds aManifestto the database.voidaddSpawnListener(ManifestSpawnListener listener) voidclose()getAllForName(String name) getManifest(Manifest.Key key) booleanhasManifest(Manifest.Key key) voidInvalidates all cached data.voidConcurrent-save removes a manifest from the database.voidremoveSpawnListener(ManifestSpawnListener listener) voidMethods inherited from class io.bdeploy.bhive.objects.LockableDatabase
locked
-
Constructor Details
-
ManifestDatabase
- Parameters:
root- the root path of the database, created empty if it does not yet exist
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
addSpawnListener
-
removeSpawnListener
-
scheduleNotify
-
hasManifest
- Parameters:
key- the manifest key to check- Returns:
- whether the
Manifestexists in the database.
-
addManifest
Concurrent-save adds aManifestto the database.- Parameters:
manifest- the manifest to store in the database.
-
removeManifest
Concurrent-save removes a manifest from the database. Does not remove underlying objects from anyObjectDatabase, just removes the manifest entry (which is the "root-anchor" to those objects).- Parameters:
key- the manifest to remove
-
getAllManifests
- Returns:
- all
Manifest.Keys found in the database's filesystem.
-
getAllForName
- Parameters:
name- the name to collect for. May be any number of name segments (must be complete segments). e.g 'my/manifest' will match the same (but potentially more) than 'my/manifest/name', but none of the two will match 'my/manifestname'. If the name includes a ':', it is treated as a fully qualified manifest key.- Returns:
- the list of manifests which matched the name.
-
getManifest
- Parameters:
key- the key of the manifest to load- Returns:
- the
Manifestloaded from its backing file.
-
invalidateCaches
public void invalidateCaches()Invalidates all cached data.
-