Class BlobContainerManager
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.blob.BlobContainerManager
-
- All Implemented Interfaces:
EventCallback
public class BlobContainerManager extends java.lang.Object implements EventCallback
Singleton to abstract and manage Azure Blob containers. Each tenant/datasource gets its own container. TODO: investigate if BlobContainerClient should be long-lived and shared by multiple threads and how to configure its http client library and executor when running inside Liberty.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalShutdown()Called after all startShutdown() calls have been processed.static BlobContainerManagergetInstance()Get the singleton instance of this classBlobPropertyGroupAdaptergetPropertyGroupAdapter(java.lang.String dsPropertyName)Get a CassandraPropertyGroupAdapter bound to the property group described by the given dsPropertyName path (in fhir-server-config.json).static BlobManagedContainergetSessionForTenantDatasource()Get the (shared, thread-safe) connection object representing the Azure Blob connection for the current tenant/datasource (seeFHIRRequestContext).static booleanisPayloadPersistenceConfigured()Check if payload persistence is configured for the current tenant/datasourcevoidserverReady()Called after the server startup processing is done and all services are readystatic voidshutdown()Shut down the service so that we don't try and accept any new workvoidstartShutdown()Called at the start of shutdown.
-
-
-
Method Detail
-
getInstance
public static BlobContainerManager getInstance()
Get the singleton instance of this class- Returns:
-
getSessionForTenantDatasource
public static BlobManagedContainer getSessionForTenantDatasource()
Get the (shared, thread-safe) connection object representing the Azure Blob connection for the current tenant/datasource (seeFHIRRequestContext).- Returns:
-
isPayloadPersistenceConfigured
public static boolean isPayloadPersistenceConfigured()
Check if payload persistence is configured for the current tenant/datasource- Returns:
-
getPropertyGroupAdapter
public BlobPropertyGroupAdapter getPropertyGroupAdapter(java.lang.String dsPropertyName)
Get a CassandraPropertyGroupAdapter bound to the property group described by the given dsPropertyName path (in fhir-server-config.json).- Parameters:
dsPropertyName-- Returns:
-
shutdown
public static void shutdown()
Shut down the service so that we don't try and accept any new work
-
serverReady
public void serverReady()
Description copied from interface:EventCallbackCalled after the server startup processing is done and all services are ready- Specified by:
serverReadyin interfaceEventCallback
-
startShutdown
public void startShutdown()
Description copied from interface:EventCallbackCalled at the start of shutdown. Must not block. This method is called for all registered EventCallback objects before finalShutdown() is called. Implementations may initiate, but not wait for, shutdown of the services they manage.- Specified by:
startShutdownin interfaceEventCallback
-
finalShutdown
public void finalShutdown()
Description copied from interface:EventCallbackCalled after all startShutdown() calls have been processed. Implementations should terminate internal services immediately at this point. Waiting for termination should be kept to a minimum, unless critical for stability.- Specified by:
finalShutdownin interfaceEventCallback
-
-