android-components / mozilla.components.browser.storage.sync / PlacesBookmarksStorage

PlacesBookmarksStorage

open class PlacesBookmarksStorage : PlacesStorage, BookmarksStorage, SyncableStore (source)

Implementation of the BookmarksStorage which is backed by a Rust Places lib via PlacesApi.

Constructors

Name Summary
<init> PlacesBookmarksStorage(context: <ERROR CLASS>)
Implementation of the BookmarksStorage which is backed by a Rust Places lib via PlacesApi.

Properties

Name Summary
logger open val logger: Logger

Functions

Name Summary
addFolder open suspend fun addFolder(parentGuid: String, title: String, position: Int?): String
Adds a new bookmark folder to a given node.
addItem open suspend fun addItem(parentGuid: String, url: String, title: String, position: Int?): String
Adds a new bookmark item to a given node.
addSeparator open suspend fun addSeparator(parentGuid: String, position: Int?): String
Adds a new bookmark separator to a given node.
deleteNode open suspend fun deleteNode(guid: String): Boolean
Deletes a bookmark node and all of its children, if any.
getBookmark open suspend fun getBookmark(guid: String): BookmarkNode?
Obtains the details of a bookmark without children, if one exists with that guid. Otherwise, null.
getBookmarksWithUrl open suspend fun getBookmarksWithUrl(url: String): List<BookmarkNode>
Produces a list of all bookmarks with the given URL.
getHandle open fun getHandle(): Long
This should be removed. See: https://github.com/mozilla/application-services/issues/1877
getTree open suspend fun getTree(guid: String, recursive: Boolean): BookmarkNode?
Produces a bookmarks tree for the given guid string.
importFromFennec fun importFromFennec(dbPath: String): Unit
Import bookmarks data from Fennec’s browser.db file. Before running this, first run PlacesHistoryStorage.importFromFennec to import history and visits data.
searchBookmarks open suspend fun searchBookmarks(query: String, limit: Int): List<BookmarkNode>
Searches bookmarks with a query string.
sync open suspend fun sync(authInfo: SyncAuthInfo): SyncStatus
Runs syncBookmarks() method on the places Connection
updateNode open suspend fun updateNode(guid: String, info: BookmarkInfo): Unit
Edits the properties of an existing bookmark item and/or moves an existing one underneath a new parent guid.

Inherited Functions

Name Summary
cleanup open fun cleanup(): Unit
Cleans up background work and database connections
ignoreUrlExceptions fun ignoreUrlExceptions(operation: String, block: () -> Unit): Unit
Runs block described by operation, ignoring and logging any thrown UrlParseFailed exceptions.
runMaintenance open suspend fun runMaintenance(): Unit
Internal database maintenance tasks. Ideally this should be called once a day.
syncAndHandleExceptions fun syncAndHandleExceptions(syncBlock: () -> Unit): SyncStatus
Runs a syncBlock, re-throwing any panics that may be encountered.

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.