Interface Historian<S extends HistorianSettings>
- Type Parameters:
S- the historian's settings type.
- All Known Subinterfaces:
TagHistoryProvider<S>
- All Known Implementing Classes:
AbstractHistorian, LegacyTagHistoryProviderAdapter
public interface Historian<S extends HistorianSettings>
A historian: a named, configurable provider that owns a storage engine and/or a query engine for
historical data, with a startup and shutdown lifecycle.
-
Method Summary
Modifier and TypeMethodDescriptiongetName()Returns the historian's name.default QualifiedPathAdapterReturns the adapter used to normalize paths;QualifiedPathAdapter.DEFAULTby default.default Optional<QueryEngine> Returns this historian's query engine, or empty (the default) if it has none.Returns the historian's settings.Returns the status shown on the Historians page and reported to the health check.default Optional<StorageEngine> Returns this historian's storage engine, or empty (the default) if it has none.default booleanhandleNameChange(String newName) Applies a new name without a restart if the historian supports it.default voidCalled, beforeshutdown(), when the gateway resource backing this historian is deleted; not called on normal shutdown or restart.default booleanhandleSettingsChange(S newSettings) Applies new settings without a restart if the historian supports it.voidshutdown()Stops the historian and releases its resources.voidstartup()Starts the historian: allocates resources, connects to backends and schedules maintenance.
-
Method Details
-
startup
Starts the historian: allocates resources, connects to backends and schedules maintenance. May throwIllegalStateExceptionif already started.- Throws:
Exception- if startup fails.
-
shutdown
void shutdown()Stops the historian and releases its resources. It must not accept new requests afterwards. Overrides should callsuper. -
getName
String getName()Returns the historian's name. -
getSettings
S getSettings()Returns the historian's settings. -
getStatus
ProfileStatus getStatus()Returns the status shown on the Historians page and reported to the health check. -
getQueryEngine
Returns this historian's query engine, or empty (the default) if it has none. -
getStorageEngine
Returns this historian's storage engine, or empty (the default) if it has none. -
getPathAdapter
Returns the adapter used to normalize paths;QualifiedPathAdapter.DEFAULTby default. -
handleNameChange
Applies a new name without a restart if the historian supports it.- Parameters:
newName- the new name.- Returns:
trueif applied;falseif the historian needs a restart or a new instance.
-
handleSettingsChange
Applies new settings without a restart if the historian supports it.- Parameters:
newSettings- the new settings.- Returns:
trueif applied;falseif the historian needs a restart or a new instance.
-
handleResourceDeleted
default void handleResourceDeleted()Called, beforeshutdown(), when the gateway resource backing this historian is deleted; not called on normal shutdown or restart. Implementations must remove all backend storage tied to the historian, both store-and-forward caches and persisted data. The default does nothing, which suits historians whose state ends with the resource.May be called more than once for the same deletion, so cleanup must tolerate already-removed state. Log cleanup failures rather than throwing; the resource is already removed from configuration, so an exception cannot block the deletion.
- Since:
- 8.3.5
-