#1132: UserXmlPreferencesCache.kt

projectforge-business/src/main/kotlin/org/projectforge/business/user/UserXmlPreferencesCache.kt Cache, projectforge-business/src/main/kotlin/org/projectforge/business/user/UserXmlPreferencesCache.kt 80 lines · 37 code · 31 comments · 12 blank
Cache for user preferences stored in XML format, providing typed access to complex preference structures with XML serialization/deserialization.

Architecture

XML Storage Backend

Implements AbstractUserPrefCache using XML files stored on disk per user. Uses JAXB or kotlinx.serialization for XML binding.

Cache Strategy

Loads entire preferences file into memory on first access, writes through to disk on changes, and uses file modification timestamps for cross-request cache validation.

Design Rationale

Provides a file-based alternative to database storage for preferences, enabling configuration portability and simpler deployment scenarios without a database.

Architecture Analysis

Resides in projectforge-business, the core module containing domain logic, services, and persistence. Typically annotated with @Service or @Component, managed by the Spring IoC container with dependency injection.

Git History

CommitWhat changed
868d6abb752025 -> 2026
63081666f6Source file headers: 2024-> 2025.
f8961fd661Shutdown handling of ProjectForge improved: ShutdownService will shutdown some services first before database will gone.
011000f03dMigration stuff in progress... (all tests of all packages: OK).
4d58829ccdUserPrefCache and UserXmlPreferencesCache refactored.
2bf1323f2fMigration stuff in progress...
9afeb4b460UserXmlPreferencesDao/Cache: saved a lot of db calls.