|
PACS System 0.1.0
PACS DICOM system library
|
Repository for sync persistence (legacy SQLite interface) More...
#include <sync_repository.h>

Public Member Functions | |
| sync_repository (sqlite3 *db) | |
| ~sync_repository () | |
| sync_repository (const sync_repository &)=delete | |
| auto | operator= (const sync_repository &) -> sync_repository &=delete |
| sync_repository (sync_repository &&) noexcept | |
| auto | operator= (sync_repository &&) noexcept -> sync_repository & |
| auto | save_config (const client::sync_config &config) -> VoidResult |
| auto | find_config (std::string_view config_id) const -> std::optional< client::sync_config > |
| auto | list_configs () const -> std::vector< client::sync_config > |
| auto | list_enabled_configs () const -> std::vector< client::sync_config > |
| auto | remove_config (std::string_view config_id) -> VoidResult |
| auto | update_config_stats (std::string_view config_id, bool success, size_t studies_synced) -> VoidResult |
| auto | save_conflict (const client::sync_conflict &conflict) -> VoidResult |
| auto | find_conflict (std::string_view study_uid) const -> std::optional< client::sync_conflict > |
| auto | list_conflicts (std::string_view config_id) const -> std::vector< client::sync_conflict > |
| auto | list_unresolved_conflicts () const -> std::vector< client::sync_conflict > |
| auto | resolve_conflict (std::string_view study_uid, client::conflict_resolution resolution) -> VoidResult |
| auto | cleanup_old_conflicts (std::chrono::hours max_age) -> Result< size_t > |
| auto | save_history (const client::sync_history &history) -> VoidResult |
| auto | list_history (std::string_view config_id, size_t limit=100) const -> std::vector< client::sync_history > |
| auto | get_last_history (std::string_view config_id) const -> std::optional< client::sync_history > |
| auto | cleanup_old_history (std::chrono::hours max_age) -> Result< size_t > |
| auto | count_configs () const -> size_t |
| auto | count_unresolved_conflicts () const -> size_t |
| auto | count_syncs_today () const -> size_t |
| auto | is_valid () const noexcept -> bool |
Private Member Functions | |
| auto | parse_config_row (void *stmt) const -> client::sync_config |
| auto | parse_conflict_row (void *stmt) const -> client::sync_conflict |
| auto | parse_history_row (void *stmt) const -> client::sync_history |
Static Private Member Functions | |
| static auto | serialize_vector (const std::vector< std::string > &vec) -> std::string |
| static auto | deserialize_vector (std::string_view json) -> std::vector< std::string > |
Private Attributes | |
| sqlite3 * | db_ {nullptr} |
Repository for sync persistence (legacy SQLite interface)
This is the legacy interface maintained for builds without database_system. New code should use the pacs_database_adapter version when PACS_WITH_DATABASE_SYSTEM is defined.
Definition at line 375 of file sync_repository.h.
|
explicit |
Definition at line 879 of file sync_repository.cpp.
|
default |
|
delete |
|
defaultnoexcept |
|
nodiscard |
Definition at line 1310 of file sync_repository.cpp.
References db_.
|
nodiscard |
Definition at line 1446 of file sync_repository.cpp.
References db_.
|
nodiscard |
Definition at line 1482 of file sync_repository.cpp.
References db_.
|
nodiscard |
Definition at line 1520 of file sync_repository.cpp.
References db_.
|
nodiscard |
Definition at line 1501 of file sync_repository.cpp.
References db_.
|
staticnodiscardprivate |
Definition at line 836 of file sync_repository.cpp.
Referenced by parse_config_row(), and parse_history_row().

|
nodiscard |
Definition at line 959 of file sync_repository.cpp.
References db_, and parse_config_row().

|
nodiscard |
Definition at line 1191 of file sync_repository.cpp.
References db_, and parse_conflict_row().

|
nodiscard |
Definition at line 1419 of file sync_repository.cpp.
References db_, and parse_history_row().

|
nodiscardnoexcept |
Definition at line 1546 of file sync_repository.cpp.
References db_.
|
nodiscard |
Definition at line 988 of file sync_repository.cpp.
References db_, and parse_config_row().

|
nodiscard |
Definition at line 1219 of file sync_repository.cpp.
References db_, and parse_conflict_row().

|
nodiscard |
Definition at line 1014 of file sync_repository.cpp.
References db_, and parse_config_row().

|
nodiscard |
Definition at line 1391 of file sync_repository.cpp.
References db_, and parse_history_row().

|
nodiscard |
Definition at line 1247 of file sync_repository.cpp.
References db_, and parse_conflict_row().

|
delete |
|
defaultnoexcept |
|
nodiscardprivate |
Definition at line 1554 of file sync_repository.cpp.
References kcenon::pacs::client::sync_config::config_id, kcenon::pacs::client::sync_config::delete_missing, deserialize_vector(), kcenon::pacs::client::sync_config::direction, kcenon::pacs::client::sync_config::enabled, kcenon::pacs::client::sync_config::last_successful_sync, kcenon::pacs::client::sync_config::last_sync, kcenon::pacs::client::sync_config::lookback, kcenon::pacs::client::sync_config::modalities, kcenon::pacs::client::sync_config::name, kcenon::pacs::client::sync_config::overwrite_existing, kcenon::pacs::client::sync_config::patient_id_patterns, kcenon::pacs::client::sync_config::pk, kcenon::pacs::client::sync_config::schedule_cron, kcenon::pacs::client::sync_config::source_node_id, kcenon::pacs::client::sync_config::studies_synced, kcenon::pacs::client::sync_direction_from_string(), kcenon::pacs::client::sync_config::sync_metadata_only, and kcenon::pacs::client::sync_config::total_syncs.
Referenced by find_config(), list_configs(), and list_enabled_configs().


|
nodiscardprivate |
Definition at line 1581 of file sync_repository.cpp.
References kcenon::pacs::client::conflict_resolution_from_string(), and kcenon::pacs::client::sync_conflict_type_from_string().
Referenced by find_conflict(), list_conflicts(), and list_unresolved_conflicts().


|
nodiscardprivate |
Definition at line 1609 of file sync_repository.cpp.
References kcenon::pacs::client::sync_history::completed_at, kcenon::pacs::client::sync_history::config_id, kcenon::pacs::client::sync_history::conflicts_found, deserialize_vector(), kcenon::pacs::client::sync_history::errors, kcenon::pacs::client::sync_history::job_id, kcenon::pacs::client::sync_history::pk, kcenon::pacs::client::sync_history::started_at, kcenon::pacs::client::sync_history::studies_checked, kcenon::pacs::client::sync_history::studies_synced, and kcenon::pacs::client::sync_history::success.
Referenced by get_last_history(), and list_history().


|
nodiscard |
Definition at line 1040 of file sync_repository.cpp.
References db_.
|
nodiscard |
Definition at line 1272 of file sync_repository.cpp.
References db_, and kcenon::pacs::storage::to_string().

|
nodiscard |
Definition at line 890 of file sync_repository.cpp.
References kcenon::pacs::storage::to_string().

|
nodiscard |
Definition at line 1129 of file sync_repository.cpp.
References db_, and kcenon::pacs::storage::to_string().

|
nodiscard |
Definition at line 1348 of file sync_repository.cpp.
References kcenon::pacs::client::sync_history::completed_at, kcenon::pacs::client::sync_history::config_id, kcenon::pacs::client::sync_history::conflicts_found, db_, kcenon::pacs::client::sync_history::errors, kcenon::pacs::client::sync_history::job_id, serialize_vector(), kcenon::pacs::client::sync_history::started_at, kcenon::pacs::client::sync_history::studies_checked, kcenon::pacs::client::sync_history::studies_synced, and kcenon::pacs::client::sync_history::success.

|
staticnodiscardprivate |
Definition at line 817 of file sync_repository.cpp.
Referenced by save_history().

|
nodiscard |
Definition at line 1069 of file sync_repository.cpp.
References db_, and kcenon::pacs::storage::success.
|
private |
Definition at line 434 of file sync_repository.h.
Referenced by cleanup_old_conflicts(), cleanup_old_history(), count_configs(), count_syncs_today(), count_unresolved_conflicts(), find_config(), find_conflict(), get_last_history(), is_valid(), list_configs(), list_conflicts(), list_enabled_configs(), list_history(), list_unresolved_conflicts(), remove_config(), resolve_conflict(), save_conflict(), save_history(), and update_config_stats().