MeshLogRepositoryImpl

open class MeshLogRepositoryImpl(dbManager: DatabaseProvider, dispatchers: CoroutineDispatchers, meshLogPrefs: MeshLogPrefs, nodeInfoReadDataSource: NodeInfoReadDataSource) : MeshLogRepository(source)

Repository implementation for managing and retrieving logs from the local database.

This repository provides methods for inserting, deleting, and querying logs, including specialized methods for telemetry and traceroute data.

Constructors

Link copied to clipboard
constructor(dbManager: DatabaseProvider, dispatchers: CoroutineDispatchers, meshLogPrefs: MeshLogPrefs, nodeInfoReadDataSource: NodeInfoReadDataSource)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun deleteAll()

Clears all logs from the database.

Link copied to clipboard
open suspend override fun deleteLog(uuid: String)

Deletes a specific log entry by its uuid.

Link copied to clipboard
open suspend override fun deleteLogs(nodeNum: Int, portNum: Int)

Deletes all logs associated with a specific nodeNum and portNum.

Link copied to clipboard
open suspend override fun deleteLogsOlderThan(retentionDays: Int)

Prunes the log database based on the configured retentionDays.

Link copied to clipboard
open override fun getAllLogs(maxItem: Int): Flow<List<MeshLog>>

Retrieves all MeshLogs in the database, up to maxItem.

Link copied to clipboard
open override fun getAllLogsInReceiveOrder(maxItem: Int): Flow<List<MeshLog>>

Retrieves all MeshLogs in the database in the order they were received.

Link copied to clipboard
open override fun getAllLogsUnbounded(): Flow<List<MeshLog>>

Retrieves all MeshLogs in the database without any limit.

Link copied to clipboard
open override fun getLogsFrom(nodeNum: Int, portNum: Int): Flow<List<MeshLog>>

Retrieves all MeshLogs associated with a specific nodeNum and portNum.

Link copied to clipboard
open override fun getMeshPacketsFrom(nodeNum: Int, portNum: Int): Flow<List<MeshPacket>>

Retrieves all MeshLogs containing MeshPackets for a specific nodeNum.

Link copied to clipboard
open override fun getMyNodeInfo(): Flow<MyNodeInfo?>

Returns the cached MyNodeInfo from the system logs.

Link copied to clipboard
open override fun getRequestLogs(targetNodeNum: Int, portNum: PortNum): Flow<List<MeshLog>>

Retrieves all outgoing request logs for a specific targetNodeNum and portNum.

Link copied to clipboard
open override fun getTelemetryFrom(nodeNum: Int): Flow<List<Telemetry>>

Retrieves telemetry history for a specific node, automatically handling local node redirection.

Link copied to clipboard
open suspend override fun insert(log: MeshLog)

Persists a new log entry to the database if logging is enabled in preferences.