mapistore backends management API More...
#include <string.h>
#include <dlfcn.h>
#include <dirent.h>
#include "mapistore.h"
#include "mapistore_errors.h"
#include "mapistore_private.h"
#include <dlinklist.h>
#include <samba_util.h>
#include <util/debug.h>
Functions | |
_PUBLIC_ enum mapistore_error | mapistore_backend_add_ref_count (struct backend_context *bctx) |
enum mapistore_error | mapistore_backend_create_context (TALLOC_CTX *mem_ctx, struct mapistore_connection_info *conn_info, struct tdb_wrap *tdbwrap, const char *namespace, const char *uri, uint64_t fid, struct backend_context **context_p) |
_PUBLIC_ enum mapistore_error | mapistore_backend_delete_context (struct backend_context *bctx) |
_PUBLIC_ const char * | mapistore_backend_get_installdir (void) |
enum mapistore_error | mapistore_backend_init (TALLOC_CTX *mem_ctx, const char *path) |
enum mapistore_error | mapistore_backend_list_contexts (const char *username, struct tdb_wrap *tdbwrap, TALLOC_CTX *mem_ctx, struct mapistore_contexts_list **contexts_listP) |
_PUBLIC_ init_backend_fn * | mapistore_backend_load (TALLOC_CTX *mem_ctx, const char *path) |
_PUBLIC_ struct backend_context * | mapistore_backend_lookup (struct backend_context_list *backend_list_ctx, uint32_t context_id) |
_PUBLIC_ struct backend_context * | mapistore_backend_lookup_by_name (TALLOC_CTX *mem_ctx, const char *name) |
_PUBLIC_ struct backend_context * | mapistore_backend_lookup_by_uri (struct backend_context_list *backend_list_ctx, const char *uri) |
_PUBLIC_ enum mapistore_error | mapistore_backend_register (const void *_backend) |
_PUBLIC_ enum mapistore_error | mapistore_backend_registered (const char *name) |
_PUBLIC_ bool | mapistore_backend_run_init (init_backend_fn *fns) |
mapistore backends management API
_PUBLIC_ enum mapistore_error mapistore_backend_add_ref_count | ( | struct backend_context * | bctx | ) |
Increase the ref count associated to a given backend
bctx | pointer to the backend context |
References MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
Referenced by mapistore_add_context_ref_count().
enum mapistore_error mapistore_backend_create_context | ( | TALLOC_CTX * | mem_ctx, |
struct mapistore_connection_info * | conn_info, | ||
struct tdb_wrap * | tdbwrap, | ||
const char * | namespace, | ||
const char * | uri, | ||
uint64_t | fid, | ||
struct backend_context ** | context_p | ||
) |
Create backend context
mem_ctx | pointer to the memory context |
namespace | the backend namespace |
uri | the backend parameters which can be passes inline |
References MAPISTORE_ERR_NOT_FOUND, and MAPISTORE_SUCCESS.
Referenced by mapistore_add_context().
_PUBLIC_ enum mapistore_error mapistore_backend_delete_context | ( | struct backend_context * | bctx | ) |
Delete a context from the specified backend
bctx | pointer to the backend context |
References MAPISTORE_ERR_REF_COUNT, and MAPISTORE_SUCCESS.
Referenced by mapistore_del_context(), and mapistore_mgmt_generate_uri().
_PUBLIC_ const char* mapistore_backend_get_installdir | ( | void | ) |
Return the full path where mapistore backends are installed.
Referenced by mapistore_backend_load().
enum mapistore_error mapistore_backend_init | ( | TALLOC_CTX * | mem_ctx, |
const char * | path | ||
) |
Initialize mapistore backends
mem_ctx | pointer to the memory context |
path | pointer to folder where mapistore backends are installed |
References mapistore_backend_load(), mapistore_backend_run_init(), MAPISTORE_ERR_BACKEND_INIT, and MAPISTORE_SUCCESS.
Referenced by mapistore_init().
enum mapistore_error mapistore_backend_list_contexts | ( | const char * | username, |
struct tdb_wrap * | tdbwrap, | ||
TALLOC_CTX * | mem_ctx, | ||
struct mapistore_contexts_list ** | contexts_listP | ||
) |
List backend contexts for given user
mem_ctx | pointer to the memory context |
namespace | the backend namespace |
uri | the backend parameters which can be passes inline |
References MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
_PUBLIC_ init_backend_fn* mapistore_backend_load | ( | TALLOC_CTX * | mem_ctx, |
const char * | path | ||
) |
Load the initialization functions from backends DSO
mem_ctx | pointer to the memory context |
path | pointer to the backend's DSO folder |
References mapistore_backend_get_installdir().
Referenced by mapistore_backend_init().
|
read |
find the context matching given context identifier
backend_list_ctx | pointer to the backend context list |
context_id | the context identifier to search |
Referenced by mapistore_add_context_ref_count(), mapistore_del_context(), mapistore_folder_create_folder(), mapistore_folder_create_message(), mapistore_folder_delete(), mapistore_folder_delete_message(), mapistore_folder_get_child_count(), mapistore_folder_get_deleted_fmids(), mapistore_folder_open_folder(), mapistore_folder_open_message(), mapistore_indexing_record_add_fmid(), mapistore_indexing_record_del_fmid(), mapistore_message_get_message_data(), mapistore_message_modify_recipients(), mapistore_message_save(), mapistore_message_set_read_flag(), and mapistore_message_submit().
|
read |
Return a pointer on backend functions given its name
mem_ctx | pointer to the memory context |
name | the backend name to lookup |
Referenced by mapistore_mgmt_generate_uri().
|
read |
find the context matching given uri string
backend_list_ctx | pointer to the backend context list |
uri | the uri string to search |
Referenced by mapistore_search_context_by_uri().
_PUBLIC_ enum mapistore_error mapistore_backend_register | ( | const void * | _backend | ) |
Register mapistore backends
backend | pointer to the mapistore backend to register |
References MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
_PUBLIC_ enum mapistore_error mapistore_backend_registered | ( | const char * | name | ) |
Check if the specified backend is registered given its name.
name | backend's name to lookup |
References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NOT_FOUND, and MAPISTORE_SUCCESS.
Referenced by mapistore_mgmt_registered_backend().
_PUBLIC_ bool mapistore_backend_run_init | ( | init_backend_fn * | fns | ) |
Run specified initialization functions.
fns | pointer to an array of mapistore backends initialization functions |
Referenced by mapistore_backend_init().
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |