BinderWrapper

interface BinderWrapper

Represents a connection to the Scatterbrain API. This class should only be injected by dagger only. By default this class is created as a singleton, as there is little value of concurrent connections to Scatterbrain

Types

Companion
Link copied to clipboard
object Companion

Functions

authorizeIdentity
Link copied to clipboard
abstract suspend fun authorizeIdentity(identity: Identity, packageName: String)
Adds an ACL to an identity authorizing an app to use it.
deauthorizeIdentity
Link copied to clipboard
abstract suspend fun deauthorizeIdentity(identity: Identity, packageName: String)
Removes an ACL authorizing an app to use an identity.
generateIdentity
Link copied to clipboard
abstract suspend fun generateIdentity(name: String): Identity
generates and returns a scatterbrain identity with ACLs matching the calling application only If additional applications need access to this identity they can be assigned via the Scatterbrain app.
getIdentities
Link copied to clipboard
abstract suspend fun getIdentities(): List<Identity>
Gets a list of all known identities.
getIdentity
Link copied to clipboard
abstract suspend fun getIdentity(fingerprint: UUID): Identity?
Gets a single identity by fingerprint.
getPackages
Link copied to clipboard
abstract suspend fun getPackages(): List<NamePackage>
Gets a list of packages declaring a Scatterbrain compatible BroadcastReceiver.
getPermissions
Link copied to clipboard
abstract suspend fun getPermissions(identity: Identity): List<NamePackage>
Gets a list of ACLs associated with a given identity object.
getScatterMessages
Link copied to clipboard
abstract suspend fun getScatterMessages(application: String): List<ScatterMessage>
returns a list of all stored message objects for a given application requires net.ballmerlabs.scatterroutingservice.permission.
abstract suspend fun getScatterMessages(application: String, since: Date): List<ScatterMessage>
returns a list of all stored messages for a given application after a given date.
abstract suspend fun getScatterMessages(application: String, start: Date, end: Date): List<ScatterMessage>
returns a list of all stored messages for a given application between two dates.
isConnected
Link copied to clipboard
abstract suspend fun isConnected(): Boolean
Checks if this SDK is connected to a running Scatterbrain router
observeIdentities
Link copied to clipboard
abstract suspend fun observeIdentities(): Flow<List<Identity>>
returns an asynchronous flow of identities received after this function is called in real time.
observeMessages
Link copied to clipboard
abstract suspend fun observeMessages(application: String): Flow<List<ScatterMessage>>
returns an asynchronous flow of all messages received after this functions is called filtered by a given application identifier.
register
Link copied to clipboard
abstract fun register()
Unregisters the internal BroadcastReceiver for Scatterbrain events.
removeIdentity
Link copied to clipboard
abstract suspend fun removeIdentity(identity: Identity): Boolean
Deletes an identity.
rescanPeers
Link copied to clipboard
abstract suspend fun rescanPeers()
Attempts to reconnect to known local peers
sendMessage
Link copied to clipboard
abstract suspend fun sendMessage(messages: List<ScatterMessage>)
Enqueues multiple Scatterbrain messages to the datastore.
abstract suspend fun sendMessage(message: ScatterMessage)
Enqueues a Scatterbrain message to the datastore.
abstract suspend fun sendMessage(messages: List<ScatterMessage>, identity: UUID)
Enqueues a list of messages to the datastore and signs it with a given identity.
abstract suspend fun sendMessage(messages: List<ScatterMessage>, identity: Identity)
Enqueues a list of messages to the datastore and signs it with a given identity.
abstract suspend fun sendMessage(message: ScatterMessage, identity: UUID)
Enqueues a message to the datastore and signs it with a given identity.
abstract suspend fun sendMessage(message: ScatterMessage, identity: Identity)
Enqueues a message to the datastore and signs it with a given identity.
sign
Link copied to clipboard
abstract suspend fun sign(identity: Identity, data: ByteArray): ByteArray
Cryptographically signs data using a stored identity.
startDiscover
Link copied to clipboard
abstract suspend fun startDiscover()
Starts active discovery using default transport modules This function requires net.ballmerlabs.scatterroutingservice.permission.
startPassive
Link copied to clipboard
abstract suspend fun startPassive()
Starts passive discovery using the default radio module.
startService
Link copied to clipboard
abstract suspend fun startService()
Starts the scatterbrain router if stopped.
stopDiscover
Link copied to clipboard
abstract suspend fun stopDiscover()
Stops active discovery This function requires net.ballmerlabs.scatterroutingservice.permission.
stopPassive
Link copied to clipboard
abstract suspend fun stopPassive()
Stops passive discovery This function requires net.ballmerlabs.scatterroutingservice.permission.
stopService
Link copied to clipboard
abstract suspend fun stopService()
Stops the scatterbrain router if started.
unbindService
Link copied to clipboard
abstract suspend fun unbindService()
disconnects from the binder interface
unregister
Link copied to clipboard
abstract fun unregister()
Unregisters Scatterbrain broadcast receivers
verify
Link copied to clipboard
abstract suspend fun verify(identity: Identity, data: ByteArray, sig: ByteArray): Boolean
Cryptographically verifies a detached signature using a stored identity This function requires net.ballmerlabs.scatterroutingservice.permission.

Inheritors

BinderWrapperImpl
Link copied to clipboard