Module watts_persistent_leveldb

this module implements the persistent storage for a leveldb database.

Behaviours: watts_persistent.

See also: watts_persistent_mnesia.

Description

this module implements the persistent storage for a leveldb database. It heavily uses the mnesia implementation. The difference is in the setup phase, the callback uses directly the mnesia implementation.

Function Index

create_table/3*create a single table and wait for it to be ready.
create_tables/0*create the needed tables.
credential_add/5store a credential for a user A callback from the watts_persistent behaviour.
credential_get/1get a specific credential.
credential_get_count/2get the number of credentials for a user at a service.
credential_get_list/1get the list of credentials for a user A callback from the watts_persistent behaviour.
credential_remove/2remove a credential of a user A callback from the watts_persistent behaviour.
initialize/0initialize the sqlite database.
is_ready/0return if the database is ready.
list_tables/0*list all tables.
setup_mnesia_if_needed/1*setup the leveldb datbase in mnesia if needed.
start_mnesia/0*start the mensia application.
stop_mnesia/0*stop the mensia application.

Function Details

create_table/3 *

create_table(TableName::atom(), Attributes::list(), Indexes::[atom()]) -> ok | {timeout, [atom()]} | {error, Reason::any()}

create a single table and wait for it to be ready.

create_tables/0 *

create_tables() -> ok | {timeout, [atom()]} | {error, Reason::any()}

create the needed tables

credential_add/5

credential_add(UserId::binary(), ServiceId::binary(), Interface::binary(), CredState::any(), AllowNonUniqueStates::boolean()) -> {ok, CredentialID::binary()} | {error, Reason::atom()}

store a credential for a user A callback from the watts_persistent behaviour.

credential_get/1

credential_get(CredId::binary()) -> {ok, watts:credential()} | {error, Reason::atom()}

get a specific credential. A callback from the watts_persistent behaviour.

credential_get_count/2

credential_get_count(UserId::binary(), ServiceId::binary()) -> {ok, pos_integer()}

get the number of credentials for a user at a service. A callback from the watts_persistent behaviour.

credential_get_list/1

credential_get_list(UserId::binary()) -> {ok, [watts:credential()]}

get the list of credentials for a user A callback from the watts_persistent behaviour.

credential_remove/2

credential_remove(UserId::binary(), CredentialId::binary()) -> ok | {error, Reason::atom()}

remove a credential of a user A callback from the watts_persistent behaviour.

initialize/0

initialize() -> ok

initialize the sqlite database. A callback from the watts_persistent behaviour.

is_ready/0

is_ready() -> true | {false, Reason::atom()}

return if the database is ready. A callback from the watts_persistent behaviour.

list_tables/0 *

list_tables() -> {ok, [any()]}

list all tables

setup_mnesia_if_needed/1 *

setup_mnesia_if_needed(X1::boolean()) -> ok

setup the leveldb datbase in mnesia if needed

start_mnesia/0 *

start_mnesia() -> ok

start the mensia application

stop_mnesia/0 *

stop_mnesia() -> ok

stop the mensia application


Generated by EDoc