Package io.bdeploy.bhive.remote.jersey
Class BHiveRegistry
java.lang.Object
io.bdeploy.bhive.remote.jersey.BHiveRegistry
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA listener which can be attached to the registry which is notified wheneverManifests spawn in any of the registered hives, seeManifestSpawnListener. -
Constructor Summary
ConstructorsConstructorDescriptionBHiveRegistry(ActivityReporter reporter, Function<BHive, ScopedPermission.Permission> permissionClassifier) -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.glassfish.hk2.utilities.Binderbinder()voidclose()Retrieve a namedBHive.getAll()getRequiredPermission(BHive hive) voidManually register an additional (non-discovered)BHiveto be available in the registry.voidvoidscanLocation(Path location, Function<Path, Auditor> auditorFactory) voidunregister(String name) Removes this hive from the registry and closes all open resources
-
Constructor Details
-
BHiveRegistry
public BHiveRegistry(ActivityReporter reporter, Function<BHive, ScopedPermission.Permission> permissionClassifier) - Parameters:
reporter- theActivityReporterused for allBHivediscovered by the registrypermissionClassifier- a classifier which determines the required access permission per BHive. It is allowed to returnnull(no permission required).
-
-
Method Details
-
getRequiredPermission
-
addManifestSpawnListener
-
removeManifestSpawnListener
- Parameters:
listener- a previously registeredBHiveRegistry.MultiManifestSpawnListener.
-
register
-
unregister
Removes this hive from the registry and closes all open resources- Parameters:
name- the hive to remove.
-
get
Retrieve a namedBHive. -
getAll
- Returns:
- all registered
BHives
-
getLocations
- Returns:
- all locations which have been scanned for
BHives
-
scanLocation
- Parameters:
location- the location to scan for availableBHives (recursively).
-
binder
public org.glassfish.hk2.utilities.Binder binder()- Returns:
- the HK2
Binderwhich can be used to provide theBHiveRegistryusing dependency injection.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-