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 void
finalShutdown()
Called after all startShutdown() calls have been processed.static BlobContainerManager
getInstance()
Get the singleton instance of this classBlobPropertyGroupAdapter
getPropertyGroupAdapter(java.lang.String dsPropertyName)
Get a CassandraPropertyGroupAdapter bound to the property group described by the given dsPropertyName path (in fhir-server-config.json).static BlobManagedContainer
getSessionForTenantDatasource()
Get the (shared, thread-safe) connection object representing the Azure Blob connection for the current tenant/datasource (seeFHIRRequestContext
).static boolean
isPayloadPersistenceConfigured()
Check if payload persistence is configured for the current tenant/datasourcevoid
serverReady()
Called after the server startup processing is done and all services are readystatic void
shutdown()
Shut down the service so that we don't try and accept any new workvoid
startShutdown()
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:EventCallback
Called after the server startup processing is done and all services are ready- Specified by:
serverReady
in interfaceEventCallback
-
startShutdown
public void startShutdown()
Description copied from interface:EventCallback
Called 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:
startShutdown
in interfaceEventCallback
-
finalShutdown
public void finalShutdown()
Description copied from interface:EventCallback
Called 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:
finalShutdown
in interfaceEventCallback
-
-