DeviceIdFilePersistence

class DeviceIdFilePersistence(file: File, deviceIdGenerator: () -> UUID, logger: Logger) : DeviceIdPersistence

This class is responsible for persisting and retrieving a device ID to a file.

This class is made multi-process safe through the use of a FileLock, and thread safe through the use of a ReadWriteLock in SynchronizedStreamableStore.

Constructors

Link copied to clipboard
constructor(file: File, deviceIdGenerator: () -> UUID, logger: Logger)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun loadDeviceId(requestCreateIfDoesNotExist: Boolean): String?

Loads the device ID from its file system location. If no value is present then a UUID will be generated and persisted.