Methods
(async) cache_stored(key, body) → {object}
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | |
body |
object |
- Source:
Returns:
- Type
- object
(async) del_key_value(token)
delete from the key value DB
Parameters:
| Name | Type | Description |
|---|---|---|
token |
string |
- Source:
(async) del_session_key_value(key)
Remove the key from the hash table and free up space.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string |
- Source:
(async) del_static_store(whokey)
Parameters:
| Name | Type | Description |
|---|---|---|
whokey |
string |
- Source:
disconnect() → {boolean}
This method is made available for applications that will clean up database connections on shutdown or at various other times.
- Source:
Returns:
- the extending class must implement this method
- Type
- boolean
drop(collection, data)
This is a method for wrapping drop usually associated with a DB for dropping a table.
The collection is some object (perhaps a string) identifying the object to be dropped.
Parameters:
| Name | Type | Description |
|---|---|---|
collection |
object | A table that will be dropped |
data |
object | any data that might be used by a method dropping a DB table. |
- Source:
exists(collection, data) → {boolean}
A method for checling the existence of some object in a DB table.
Parameters:
| Name | Type | Description |
|---|---|---|
collection |
object | A table that will containing the item to be found |
data |
object | any data that might be used by a method for searching for an entry |
- Source:
Returns:
- Type
- boolean
fetch(key) → {object}
This may be an implementation of get for one of the DB types. But, it may have other properties. This is left as an abstract entry point for an application to define.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string |
- Source:
Returns:
- Type
- object
(async) fetch_fields(fields_key) → {object}
This method is for fecthing the description of fields that may occur in client forms. This method is called by the method used to configure the validator.
Parameters:
| Name | Type | Description |
|---|---|---|
fields_key |
string |
- Source:
Returns:
- Type
- object
(async) get_key_value(key) → {any}
return the value mapped by the key in the DB. retun null if the value is not present.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | key mapping to the object |
- Source:
Returns:
- Type
- any
(async) get_session_key_value(key) → {any}
Get the value from the hash table. The value mapped by the key is often a JSON object. If so, it should be parsed before it is returned.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string |
- Source:
Returns:
The value mapped by the key
- Type
- any
initialize(conf)
Calls the initialization methods for all the connection based databases interfaces.
This includes the key_value_db, the persistent db (pdb), and the static db (sdb).
The static_sync interval is read from the configuration.
Parameters:
| Name | Type | Description |
|---|---|---|
conf |
object |
- Source:
last_step_initalization()
The method last_step_initalization exists in order to give make a call available to the initialization process
in the user_service_class module. This method is called at the start of run.s
- Source:
(async) put_static_store(whokey, text, mime_type, extension) → {boolean}
put the object in the static db, which attempts to keep a copy of the asset close to the processor on its own local disks...
wrap the object in a carrier, in which the object is serialized with its mime-type for future transport..
Parameters:
| Name | Type | Description |
|---|---|---|
whokey |
string | |
text |
string | |
mime_type |
string | |
extension |
string |
- Source:
Returns:
- Type
- boolean
remove(collection, data)
Parameters:
| Name | Type | Description |
|---|---|---|
collection |
object | A table that will containing the item to be removed |
data |
object | any data that might be used by a method removing an entry |
- Source:
set_hasher(hashfn)
If the hasher is not set during construction, then the application may use this method to set the has function for use by the db.
Parameters:
| Name | Type | Description |
|---|---|---|
hashfn |
* |
- Source:
(async) set_key_value(key, value)
Insert or update in the key value DB
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | |
value |
object |
- Source:
(async) set_session_key_value(key, value) → {string}
The session storage. Most likely the session storage will be implemented as a shared hash table. Some implementations may user share memory storage. And, some may use DHT (distributed hash tables).
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | |
value |
object |
- Source:
Returns:
- the hash key for the value.
- Type
- string
(async) static_store(asset) → {object}
Get an object from static store
Parameters:
| Name | Type | Description |
|---|---|---|
asset |
string |
- Source:
Returns:
-- the stored object
- Type
- object
static_synchronizer(sync_function)
Parameters:
| Name | Type | Description |
|---|---|---|
sync_function |
function |
- Source:
store(collection, data)
A wrapper for putting data into a table
Parameters:
| Name | Type | Description |
|---|---|---|
collection |
object | A table that will eventually contain the item |
data |
object | any data that might be used by a method for inserting an entry or the data to be stored |
- Source:
(async) store_cache(key, data, back_ref)
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | |
data |
object | |
back_ref |
string |
- Source:
(async) update_cache(key, data, back_ref)
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | |
data |
object | |
back_ref |
string |
- Source: