MechanismFactory

abstract class MechanismFactory

Determines the type of mechanism which is being created, and routes the creation request to the appropriate builder.

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context, storageClient: StorageClient)
Creates the MechanismFactory and loads the available mechanism information.

Properties

Link copied to clipboard
private open var context: Context
Link copied to clipboard
private open var storageClient: StorageClient
Link copied to clipboard
private val TAG: String

Functions

Link copied to clipboard
private open fun checkOrphanAccount(account: Account)
Link copied to clipboard
fun createFromUri(uri: String, listener: FRAListener<Mechanism>)
Convert a URL to the Mechanism it represents, including extracting the account.
Link copied to clipboard
protected abstract fun createFromUriParameters(version: Int, mechanismUID: String, map: Map<String, String>, listener: FRAListener<Mechanism>)
Method used to create the Mechanism represented by a given URI.
Link copied to clipboard
private open fun getAllMechanisms(): List<Mechanism>
Get all mechanisms stored in the model.
Link copied to clipboard
open fun getContext(): Context
Get a context that this factory was created from.
Link copied to clipboard
open fun getFromMap(map: Map<String, String>, name: String, defaultValue: String): String
Get a single value from the map.
Link copied to clipboard
private open fun getNewMechanismUID(): String
Generate a new, unique ID for a Mechanism.
Link copied to clipboard
protected abstract fun getParser(): MechanismParser
Return the MechanismParser subclass used by the factory for a particular Mechanism type.
Link copied to clipboard
private open fun isExistingMechanismUID(uid: String): Boolean
Check if unique ID for a Mechanism already exist
Link copied to clipboard
private open fun storeAccount(account: Account)