android-components / mozilla.components.concept.storage / HistoryStorage

HistoryStorage

interface HistoryStorage : Storage (source)

An interface which defines read/write methods for history data.

Functions

Name Summary
deleteEverything abstract suspend fun deleteEverything(): Unit
Remove all locally stored data.
deleteVisit abstract suspend fun deleteVisit(url: String, timestamp: Long): Unit
Remove a specific visit for a given url.
deleteVisitsBetween abstract suspend fun deleteVisitsBetween(startTime: Long, endTime: Long): Unit
Remove history visits in an inclusive range from startTime to endTime.
deleteVisitsFor abstract suspend fun deleteVisitsFor(url: String): Unit
Remove all history visits for a given url.
deleteVisitsSince abstract suspend fun deleteVisitsSince(since: Long): Unit
Remove history visits in an inclusive range from since to now.
getAutocompleteSuggestion abstract fun getAutocompleteSuggestion(query: String): HistoryAutocompleteResult?
Retrieves domain suggestions which best match the query.
getDetailedVisits abstract suspend fun getDetailedVisits(start: Long, end: Long = Long.MAX_VALUE, excludeTypes: List<VisitType> = listOf()): List<VisitInfo>
Retrieves detailed information about all visits that occurred in the given time range.
getSuggestions abstract fun getSuggestions(query: String, limit: Int): List<SearchResult>
Retrieves suggestions matching the query.
getVisited abstract suspend fun getVisited(uris: List<String>): List<Boolean>
Maps a list of page URIs to a list of booleans indicating if each URI was visited.abstract suspend fun getVisited(): List<String>
Retrieves a list of all visited pages.
getVisitsPaginated abstract suspend fun getVisitsPaginated(offset: Long, count: Long, excludeTypes: List<VisitType> = listOf()): List<VisitInfo>
Return a “page” of history results. Each page will have visits in descending order with respect to their visit timestamps. In the case of ties, their row id will be used.
prune abstract suspend fun prune(): Unit
Prune history storage, removing stale history.
recordObservation abstract suspend fun recordObservation(uri: String, observation: PageObservation): Unit
Records an observation about a page.
recordVisit abstract suspend fun recordVisit(uri: String, visit: PageVisit): Unit
Records a visit to a page.

Inherited Functions

Name Summary
cleanup abstract fun cleanup(): Unit
Cleans up background work and database connections
runMaintenance abstract suspend fun runMaintenance(): Unit
Runs internal database maintenance tasks

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.

Inheritors

Name Summary
InMemoryHistoryStorage class InMemoryHistoryStorage : HistoryStorage
An in-memory implementation of mozilla.components.concept.storage.HistoryStorage.
PlacesHistoryStorage open class PlacesHistoryStorage : PlacesStorage, HistoryStorage, SyncableStore
Implementation of the HistoryStorage which is backed by a Rust Places lib via PlacesApi.