#2742 Events tab: decode events from all channels stored in the database

- EventManager collects decode events from all channels (tracked by identity, re-checked for in-place updates)
  and saves/broadcasts EventRecord snapshots for the Events tab and future API subscribers.
- Schema version 3: events and event_patched_talkgroups tables; IEventRepository/EventRepository for H2,
  MariaDB and PostgreSQL.
- Events tab after Calls: paging, page size, talkgroup/radio alias search, category, event type, protocol,
  system, details and date filters, live updates, talkgroup hold context menu.
- Aliases resolved at display time from the stored alias list name (shared IdentifierRecord base with calls,
  SqlSupport filter helpers).
- Database switch transfers events; event age-off rule (default 30 days) in the database preferences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
denny
2026-11-22 02:29:09 -05:00
parent 6dc1f0fdcb
commit d92070bd11
27 changed files with 3744 additions and 588 deletions

View File

@@ -49,9 +49,12 @@ public class DatabasePreference extends Preference
private static final String KEY_SIZE_RULE_LIMIT_MB = "ageoff.size.limit.mb";
private static final String KEY_SIZE_RULE_ACTION = "ageoff.size.action";
private static final String KEY_DUPLICATE_DNM_RETENTION = "ageoff.duplicate.dnm.retention";
private static final String KEY_EVENT_RULE_ENABLED = "ageoff.events.enabled";
private static final String KEY_EVENT_RULE_DAYS = "ageoff.events.days";
public static final String DEFAULT_POSTGRES_DATABASE = "postgres";
public static final int DEFAULT_AGE_DAYS = 30;
public static final int DEFAULT_EVENT_AGE_DAYS = 30;
public static final int DEFAULT_SIZE_LIMIT_MB = 10 * 1024;
private final Preferences mPreferences = Preferences.userNodeForPackage(DatabasePreference.class);
@@ -131,6 +134,35 @@ public class DatabasePreference extends Preference
mPreferences.get(KEY_USER, ""), mPreferences.get(KEY_PASSWORD, ""));
}
/**
* Indicates if the event age rule (delete decode events older than a number of days) is enabled. Enabled by
* default, because a busy control channel produces many events.
*/
public boolean isEventRuleEnabled()
{
return mPreferences.getBoolean(KEY_EVENT_RULE_ENABLED, true);
}
public void setEventRuleEnabled(boolean enabled)
{
mPreferences.putBoolean(KEY_EVENT_RULE_ENABLED, enabled);
notifyPreferenceUpdated();
}
/**
* Maximum decode event age in days for the event age rule
*/
public int getEventRuleDays()
{
return Math.max(1, mPreferences.getInt(KEY_EVENT_RULE_DAYS, DEFAULT_EVENT_AGE_DAYS));
}
public void setEventRuleDays(int days)
{
mPreferences.putInt(KEY_EVENT_RULE_DAYS, Math.max(1, days));
notifyPreferenceUpdated();
}
public boolean isAgeRuleEnabled()
{
return mPreferences.getBoolean(KEY_AGE_RULE_ENABLED, false);