MAPISTORE general API. More...
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <tdb.h>
#include <ldb.h>
#include <talloc.h>
#include <libmemcached/memcached.h>
#include "libmapi/libmapi.h"
Functions | |
enum mapistore_error | mapi_error_to_mapistore (enum MAPISTATUS) |
enum mapistore_error | mapistore_add_context (struct mapistore_context *, const char *, const char *, uint64_t, uint32_t *, void **) |
enum mapistore_error | mapistore_add_context_ref_count (struct mapistore_context *, uint32_t) |
const char * | mapistore_backend_get_installdir (void) |
init_backend_fn * | mapistore_backend_load (TALLOC_CTX *, const char *) |
struct backend_context * | mapistore_backend_lookup (struct backend_context_list *, uint32_t) |
struct backend_context * | mapistore_backend_lookup_by_name (TALLOC_CTX *, const char *) |
struct backend_context * | mapistore_backend_lookup_by_uri (struct backend_context_list *, const char *) |
enum mapistore_error | mapistore_backend_register (const void *) |
bool | mapistore_backend_run_init (init_backend_fn *) |
enum mapistore_error | mapistore_del_context (struct mapistore_context *, uint32_t) |
const char * | mapistore_errstr (enum mapistore_error) |
enum mapistore_error | mapistore_folder_create_folder (struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint64_t, struct SRow *, void **) |
enum mapistore_error | mapistore_folder_create_message (struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint64_t, uint8_t, void **) |
enum mapistore_error | mapistore_folder_delete (struct mapistore_context *, uint32_t, void *, uint8_t, TALLOC_CTX *, uint64_t **, uint32_t *) |
enum mapistore_error | mapistore_folder_delete_message (struct mapistore_context *, uint32_t, void *, uint64_t, uint8_t) |
enum mapistore_error | mapistore_folder_get_child_count (struct mapistore_context *, uint32_t, void *, enum mapistore_table_type, uint32_t *) |
enum mapistore_error | mapistore_folder_get_deleted_fmids (struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, enum mapistore_table_type, uint64_t, struct UI8Array_r **, uint64_t *) |
enum mapistore_error | mapistore_folder_move_folder (struct mapistore_context *, uint32_t, void *, void *, TALLOC_CTX *, const char *) |
enum mapistore_error | mapistore_folder_open_folder (struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint64_t, void **) |
enum mapistore_error | mapistore_folder_open_message (struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, uint64_t, bool, void **) |
enum mapistore_error | mapistore_indexing_get_new_folderID (struct mapistore_context *, uint64_t *) |
enum mapistore_error | mapistore_indexing_get_new_folderID_as_user (struct mapistore_context *, const char *, uint64_t *) |
enum mapistore_error | mapistore_indexing_get_new_folderIDs (struct mapistore_context *, TALLOC_CTX *, uint64_t, struct UI8Array_r **) |
enum mapistore_error | mapistore_indexing_record_add_fid (struct mapistore_context *, uint32_t, const char *, uint64_t) |
enum mapistore_error | mapistore_indexing_record_add_fmid_for_uri (struct mapistore_context *, uint32_t, const char *, uint64_t, const char *) |
enum mapistore_error | mapistore_indexing_record_add_mid (struct mapistore_context *, uint32_t, const char *, uint64_t) |
enum mapistore_error | mapistore_indexing_record_del_fid (struct mapistore_context *, uint32_t, const char *, uint64_t, uint8_t) |
enum mapistore_error | mapistore_indexing_record_del_mid (struct mapistore_context *, uint32_t, const char *, uint64_t, uint8_t) |
enum mapistore_error | mapistore_indexing_record_get_uri (struct mapistore_context *, const char *, TALLOC_CTX *, uint64_t, char **, bool *) |
enum mapistore_error | mapistore_indexing_reserve_fmid_range (struct mapistore_context *, uint64_t, uint64_t *) |
struct mapistore_context * | mapistore_init (TALLOC_CTX *, struct loadparm_context *, const char *) |
enum mapistore_error | mapistore_message_get_message_data (struct mapistore_context *, uint32_t, void *, TALLOC_CTX *, struct mapistore_message **) |
enum mapistore_error | mapistore_message_modify_recipients (struct mapistore_context *, uint32_t, void *, struct SPropTagArray *, uint16_t, struct mapistore_message_recipient *) |
enum mapistore_error | mapistore_message_save (struct mapistore_context *, uint32_t, void *, TALLOC_CTX *) |
enum mapistore_error | mapistore_message_set_read_flag (struct mapistore_context *, uint32_t, void *, uint8_t) |
enum mapistore_error | mapistore_message_submit (struct mapistore_context *, uint32_t, void *, enum SubmitFlags) |
enum mapistore_error | mapistore_namedprops_create_id (struct namedprops_context *, struct MAPINAMEID, uint16_t) |
enum mapistore_error | mapistore_namedprops_get_mapped_id (struct namedprops_context *, struct MAPINAMEID, uint16_t *) |
enum mapistore_error | mapistore_namedprops_get_nameid (struct namedprops_context *, uint16_t, TALLOC_CTX *mem_ctx, struct MAPINAMEID **) |
enum mapistore_error | mapistore_namedprops_get_nameid_type (struct namedprops_context *, uint16_t, uint16_t *) |
enum mapistore_error | mapistore_namedprops_next_unused_id (struct namedprops_context *, uint16_t *) |
enum mapistore_error | mapistore_notification_deliver_add (struct mapistore_context *, struct GUID, uint8_t *, size_t) |
enum mapistore_error | mapistore_notification_deliver_delete (struct mapistore_context *, struct GUID) |
enum mapistore_error | mapistore_notification_deliver_exist (struct mapistore_context *, struct GUID) |
enum mapistore_error | mapistore_notification_deliver_get (TALLOC_CTX *, struct mapistore_context *, struct GUID, uint8_t **, size_t *) |
enum mapistore_error | mapistore_notification_payload_newmail (TALLOC_CTX *, char *, char *, char *, char, uint8_t **, size_t *) |
enum mapistore_error | mapistore_notification_resolver_add (struct mapistore_context *, const char *, const char *) |
enum mapistore_error | mapistore_notification_resolver_delete (struct mapistore_context *, const char *, const char *) |
enum mapistore_error | mapistore_notification_resolver_exist (struct mapistore_context *, const char *) |
enum mapistore_error | mapistore_notification_resolver_get (TALLOC_CTX *, struct mapistore_context *, const char *, uint32_t *, const char ***) |
enum mapistore_error | mapistore_notification_session_add (struct mapistore_context *, struct GUID, struct GUID, const char *) |
enum mapistore_error | mapistore_notification_session_delete (struct mapistore_context *, struct GUID) |
enum mapistore_error | mapistore_notification_session_exist (struct mapistore_context *, struct GUID) |
enum mapistore_error | mapistore_notification_session_get (TALLOC_CTX *, struct mapistore_context *, struct GUID, struct GUID *, char **) |
enum mapistore_error | mapistore_notification_subscription_add (struct mapistore_context *, struct GUID, uint32_t, uint16_t, uint64_t, uint64_t, uint32_t, enum MAPITAGS *) |
enum mapistore_error | mapistore_notification_subscription_delete (struct mapistore_context *, struct GUID) |
enum mapistore_error | mapistore_notification_subscription_delete_by_handle (struct mapistore_context *, struct GUID, uint32_t) |
enum mapistore_error | mapistore_notification_subscription_exist (struct mapistore_context *, struct GUID) |
Check if a subscription record exist for the given session UUID More... | |
enum mapistore_error | mapistore_release (struct mapistore_context *) |
enum mapistore_error | mapistore_replica_mapping_guid_to_replid (struct mapistore_context *, const char *username, const struct GUID *, uint16_t *) |
enum mapistore_error | mapistore_replica_mapping_replid_to_guid (struct mapistore_context *, const char *username, uint16_t, struct GUID *) |
enum mapistore_error | mapistore_search_context_by_uri (struct mapistore_context *, const char *, uint32_t *, void **) |
enum mapistore_error | mapistore_set_connection_info (struct mapistore_context *, struct ldb_context *, struct openchangedb_context *, const char *) |
void | mapistore_set_default_cache_url (const char *) |
void | mapistore_set_default_indexing_url (const char *) |
enum mapistore_error | mapistore_set_mapping_path (const char *) |
MAPISTORE general API.
This header contains general functions, primarily for users of the store (rather than storage providers).
enum mapistore_error mapi_error_to_mapistore | ( | enum MAPISTATUS | mapi_err | ) |
Map a MAPI error code to MAPISTORE error code. We cannot map 1 to 1 for the reduced MAPISTORE scope, then we mostly likely return general MAPISTORE error code.
mapi_err | the mapi status error code |
References MAPISTORE_ERR_CORRUPTED, MAPISTORE_ERR_DENIED, MAPISTORE_ERR_EXIST, MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_FOUND, MAPISTORE_ERR_NOT_IMPLEMENTED, MAPISTORE_ERR_NOT_INITIALIZED, MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_add_context | ( | struct mapistore_context * | mstore_ctx, |
const char * | owner, | ||
const char * | uri, | ||
uint64_t | fid, | ||
uint32_t * | context_id, | ||
void ** | backend_object | ||
) |
Add a new connection context to mapistore
mstore_ctx | pointer to the mapistore context |
uri | the connection context URI |
context_id | pointer to the context identifier the function returns |
References mapistore_backend_create_context(), MAPISTORE_ERR_CONTEXT_FAILED, MAPISTORE_ERR_INVALID_NAMESPACE, mapistore_indexing_add(), and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_add_context_ref_count | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id | ||
) |
Increase the reference counter of an existing context
mstore_ctx | pointer to the mapistore context |
contex_id | the context identifier referencing the context to update |
References mapistore_backend_add_ref_count(), mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_ERROR.
const char* mapistore_backend_get_installdir | ( | void | ) |
Return the full path where mapistore backends are installed.
Referenced by mapistore_backend_load().
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().
struct backend_context* mapistore_backend_lookup | ( | struct backend_context_list * | backend_list_ctx, |
uint32_t | context_id | ||
) |
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_move_folder(), mapistore_folder_open_folder(), mapistore_folder_open_message(), mapistore_indexing_record_add_fmid(), mapistore_indexing_record_add_fmid_for_uri(), 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().
struct backend_context* mapistore_backend_lookup_by_name | ( | TALLOC_CTX * | mem_ctx, |
const char * | name | ||
) |
Return a pointer on backend functions given its name
mem_ctx | pointer to the memory context |
name | the backend name to lookup |
struct backend_context* mapistore_backend_lookup_by_uri | ( | struct backend_context_list * | backend_list_ctx, |
const char * | uri | ||
) |
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().
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.
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().
enum mapistore_error mapistore_del_context | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id | ||
) |
Delete an existing connection context from mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the context to delete |
References mapistore_backend_delete_context(), mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_REF_COUNT, MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
const char* mapistore_errstr | ( | enum mapistore_error | mapistore_err | ) |
return a string explaining what a mapistore error constant means.
mapistore_err | the mapistore error constant |
References MAPISTORE_ERR_ALREADY_INITIALIZED, MAPISTORE_ERR_BACKEND_INIT, MAPISTORE_ERR_BACKEND_REGISTER, MAPISTORE_ERR_CONN_REFUSED, MAPISTORE_ERR_CONTEXT_FAILED, MAPISTORE_ERR_CORRUPTED, MAPISTORE_ERR_DATABASE_INIT, MAPISTORE_ERR_DATABASE_OPS, MAPISTORE_ERR_DENIED, MAPISTORE_ERR_EXIST, MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_NAMESPACE, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_INVALID_URI, MAPISTORE_ERR_MSG_RCV, MAPISTORE_ERR_MSG_SEND, MAPISTORE_ERR_NO_DIRECTORY, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_FOUND, MAPISTORE_ERR_NOT_IMPLEMENTED, MAPISTORE_ERR_NOT_INITIALIZED, MAPISTORE_ERR_REF_COUNT, MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
Referenced by mapistore_init().
enum mapistore_error mapistore_folder_create_folder | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
TALLOC_CTX * | mem_ctx, | ||
uint64_t | fid, | ||
struct SRow * | aRow, | ||
void ** | child_folder | ||
) |
Create a directory in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the directory will be created |
parent_fid | the parent folder identifier |
new_fid | the folder identifier for the new folder |
aRow | pointer to MAPI data structures with properties to be added to the new folder |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_folder_create_message | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
TALLOC_CTX * | mem_ctx, | ||
uint64_t | mid, | ||
uint8_t | associated, | ||
void ** | messagep | ||
) |
Create a message in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the messagewill be created |
parent_fid | the parent folder identifier |
mid | the message identifier to create |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_folder_delete | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
uint8_t | flags, | ||
TALLOC_CTX * | mem_ctx, | ||
uint64_t ** | deleted_fmids_p, | ||
uint32_t * | deleted_fmids_count_p | ||
) |
Remove a directory in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend |
folder | the folder object |
flags | flags that control the behaviour of the operation |
mem_ctx | memory context where deleted_fmids_p is allocated |
deleted_fmids_p | pointer to the deleted fmids array |
deleted_fmids_count_p | pointer to the number of deleted fmids |
References mapistore_backend_lookup(), MAPISTORE_ERR_EXIST, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_folder_delete_message | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
uint64_t | mid, | ||
uint8_t | flags | ||
) |
Delete a message from mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the message's to be located is stored |
mid | the message identifier of the folder to delete |
flags | flags that control the behaviour of the operation (MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE) |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_folder_get_child_count | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
enum mapistore_table_type | table_type, | ||
uint32_t * | RowCount | ||
) |
Retrieve the number of child messages within a mapistore folder
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend |
fid | the folder identifier |
RowCount | pointer to the count result to return |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_folder_get_deleted_fmids | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
TALLOC_CTX * | mem_ctx, | ||
enum mapistore_table_type | table_type, | ||
uint64_t | change_num, | ||
struct UI8Array_r ** | fmidsp, | ||
uint64_t * | cnp | ||
) |
Get the array of deleted items following a specific change number
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the message's to be located is stored |
folder | the folder backend object |
mem_ctx | the TALLOC_CTX that should be used as parent for the returned array |
table_type | the type of object that we want to take into account |
change_num | the reference change number |
fmidsp | a pointer to the returned array |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_folder_move_folder | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | move_folder, | ||
void * | target_folder, | ||
TALLOC_CTX * | mem_ctx, | ||
const char * | new_folder_name | ||
) |
Move a mapistore folder to target folder
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend |
move_folder | the folder backend object to move |
target_folder | the folder backend object which becomes the parent folder of move_folder. If it is NULL, then the move_folder will become to a root folder |
mem_ctx | the TALLOC_CTX memory context |
new_folder_name | the new folder name after performing the move operation |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_folder_open_folder | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
TALLOC_CTX * | mem_ctx, | ||
uint64_t | fid, | ||
void ** | child_folder | ||
) |
Open a directory in mapistore
mstore_ctx | pointer to the mapistore context | |
context_id | the context identifier referencing the backend where the directory will be opened | |
folder | the parent folder object | |
mem_ctx | the memory context where child_folder is created | |
fid | folder identifier to open | |
[out] | child_folder | location where to store new mapistore backend object on success |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_folder_open_message | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | folder, | ||
TALLOC_CTX * | mem_ctx, | ||
uint64_t | mid, | ||
bool | read_write, | ||
void ** | messagep | ||
) |
Open a message in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the directory will be opened |
parent_fid | the parent folder identifier |
mid | the message identifier to open |
pointer | to the mapistore_message structure |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_indexing_get_new_folderID | ( | struct mapistore_context * | mstore_ctx, |
uint64_t * | fid | ||
) |
Allocates a new FolderID and returns it
mstore_ctx | pointer to the mapistore context |
fid | pointer to the fid value the function returns |
References mapistore_indexing_get_new_folderID_as_user().
enum mapistore_error mapistore_indexing_get_new_folderID_as_user | ( | struct mapistore_context * | mstore_ctx, |
const char * | username, | ||
uint64_t * | fid | ||
) |
Allocates a new FolderID for a specific user and returns it
mstore_ctx | pointer to the mapistore context |
username | name of the mailbox |
fid | pointer to the fid value the function returns |
References MAPISTORE_SUCCESS.
Referenced by mapistore_indexing_get_new_folderID().
enum mapistore_error mapistore_indexing_get_new_folderIDs | ( | struct mapistore_context * | mstore_ctx, |
TALLOC_CTX * | mem_ctx, | ||
uint64_t | max, | ||
struct UI8Array_r ** | fids_p | ||
) |
Allocates a batch of new folder ids and returns them
mstore_ctx | pointer to the mapistore context |
mem_ctx | memory context where the fid will be allocated |
max | number of fids to allocate |
fids_p | pointer array of fids values the function returns |
References MAPISTORE_SUCCESS.
enum mapistore_error mapistore_indexing_record_add_fid | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
const char * | username, | ||
uint64_t | fid | ||
) |
Add a fid record to the indexing database
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the indexing database to update |
fid | the fid to add |
References mapistore_indexing_record_add_fmid().
enum mapistore_error mapistore_indexing_record_add_fmid_for_uri | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
const char * | username, | ||
uint64_t | fmid, | ||
const char * | mapistore_uri | ||
) |
Add a folder or message record to the indexing database using the given URI
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the indexing database to update |
username | the username who owns the new entry |
fmid | the folder or message ID to add |
mapistore_uri | the URI to map against this fmid |
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERROR, and mapistore_indexing_add().
enum mapistore_error mapistore_indexing_record_add_mid | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
const char * | username, | ||
uint64_t | mid | ||
) |
Add a mid record to the indexing database
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the indexing database to update |
mid | the mid to add |
References mapistore_indexing_record_add_fmid().
enum mapistore_error mapistore_indexing_record_del_fid | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
const char * | username, | ||
uint64_t | fid, | ||
uint8_t | flags | ||
) |
Delete a fid record from the indexing database
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the indexing database to update |
fid | the fid to remove |
flags | the type of deletion MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE |
References mapistore_indexing_record_del_fmid().
enum mapistore_error mapistore_indexing_record_del_mid | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
const char * | username, | ||
uint64_t | mid, | ||
uint8_t | flags | ||
) |
Delete a mid record from the indexing database
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the indexing database to update |
mid | the mid to remove |
flags | the type of deletion MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE |
References mapistore_indexing_record_del_fmid().
enum mapistore_error mapistore_indexing_record_get_uri | ( | struct mapistore_context * | mstore_ctx, |
const char * | username, | ||
TALLOC_CTX * | mem_ctx, | ||
uint64_t | fmid, | ||
char ** | urip, | ||
bool * | soft_deletedp | ||
) |
Returns record data
mstore_ctx | pointer to the mapistore context |
username | the name of the account where to look for the indexing database |
mem_ctx | pointer to the memory context |
fmid | the fmid/key to the record |
urip | pointer to the uri pointer |
soft_deletedp | pointer to the soft deleted pointer |
References MAPISTORE_ERR_NOT_INITIALIZED, MAPISTORE_ERROR, and mapistore_indexing_add().
enum mapistore_error mapistore_indexing_reserve_fmid_range | ( | struct mapistore_context * | mstore_ctx, |
uint64_t | range_len, | ||
uint64_t * | first_fmidp | ||
) |
Reserve a range of FMID
mstore_ctx | pointer to the mapistore context |
range_len | size of the range of fmids to reserve |
first_fmidp | pointer to the first reserved fid value the function returns |
References MAPISTORE_ERR_INVALID_PARAMETER, mapistore_indexing_search(), and MAPISTORE_SUCCESS.
struct mapistore_context* mapistore_init | ( | TALLOC_CTX * | mem_ctx, |
struct loadparm_context * | lp_ctx, | ||
const char * | path | ||
) |
Initialize the mapistore context
mem_ctx | pointer to the memory context |
lp_ctx | loadparm_context to get smb.conf options |
path | the path to the location to load the backend providers from (NULL for default) |
References mapistore_backend_init(), mapistore_errstr(), mapistore_set_default_cache_url(), mapistore_set_default_indexing_url(), mapistore_set_mapping_path(), and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_message_get_message_data | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | message, | ||
TALLOC_CTX * | mem_ctx, | ||
struct mapistore_message ** | msg | ||
) |
Modify recipients of a message in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where properties will be stored |
mid | the identifier referencing the message the array of recipient rows the number of elements in the array |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_message_modify_recipients | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | message, | ||
struct SPropTagArray * | columns, | ||
uint16_t | count, | ||
struct mapistore_message_recipient * | recipients | ||
) |
Modify recipients of a message in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where properties will be stored |
mid | the identifier referencing the message the array of recipient rows the number of elements in the array |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_message_save | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | message, | ||
TALLOC_CTX * | mem_ctx | ||
) |
Commit the changes made to a message in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the message's changes will be saved |
mid | the message identifier to save |
flags | flags associated to the commit operation |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_message_set_read_flag | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | message, | ||
uint8_t | flag | ||
) |
Commit the changes made to a message in mapistore
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the message's changes will be saved |
mid | the message identifier to save |
flags | flags associated to the commit operation |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_message_submit | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
void * | message, | ||
enum SubmitFlags | flags | ||
) |
Submits a message for sending.
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the backend where the message will be submitted |
mid | the message identifier representing the message to submit |
flags | flags associated to the submit operation |
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum mapistore_error mapistore_namedprops_create_id | ( | struct namedprops_context * | nprops, |
struct MAPINAMEID | nameid, | ||
uint16_t | mapped_id | ||
) |
return the mapped property ID matching the nameid structure passed in parameter.
ldb_ctx | pointer to the namedprops ldb context |
nameid | the MAPINAMEID structure to lookup |
propID | pointer to the property ID the function returns |
References MAPISTORE_ERROR.
enum mapistore_error mapistore_namedprops_get_mapped_id | ( | struct namedprops_context * | nprops, |
struct MAPINAMEID | nameid, | ||
uint16_t * | propID | ||
) |
return the mapped property ID matching the nameid structure passed in parameter.
ldb_ctx | pointer to the namedprops ldb context |
nameid | the MAPINAMEID structure to lookup |
propID | pointer to the property ID the function returns |
References MAPISTORE_ERROR.
enum mapistore_error mapistore_namedprops_get_nameid | ( | struct namedprops_context * | nprops, |
uint16_t | propID, | ||
TALLOC_CTX * | mem_ctx, | ||
struct MAPINAMEID ** | nameidp | ||
) |
return the nameid structture matching the mapped property ID passed in parameter.
ldb_ctx | pointer to the namedprops ldb context |
propID | the property ID to lookup |
nameid | pointer to the MAPINAMEID structure the function returns |
References MAPISTORE_ERROR.
enum mapistore_error mapistore_namedprops_get_nameid_type | ( | struct namedprops_context * | nprops, |
uint16_t | propID, | ||
uint16_t * | propTypeP | ||
) |
return the type matching the mapped property ID passed in parameter.
ldb_ctx | pointer to the namedprops ldb context |
propID | the property ID to lookup |
propTypeP | pointer to the uint16_t that will receive the property type |
References MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_namedprops_next_unused_id | ( | struct namedprops_context * | nprops, |
uint16_t * | highest_id | ||
) |
Returns the next unmapped property ID
nprops | pointer to the namedprops context |
highest_id | pointer to the next unused id to return |
References MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_deliver_add | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid, | ||
uint8_t * | payload, | ||
size_t | length | ||
) |
Add or update a deliver key
mstore_ctx | pointer to the mapistore context |
uuid | the session UUID |
payload | the payload data to add to the key |
length | the length of the payload data |
References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, mapistore_notification_deliver_exist(), and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_deliver_delete | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid | ||
) |
Delete the deliver key
mstore_ctx | pointer to the mapistore context |
uuid | the uuid of the session to delete content from |
References MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_deliver_exist | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid | ||
) |
Check if a deliver key exist for current session
mstore_ctx | pointer to the mapistore context |
uuid | the session UUID to compute |
References MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
Referenced by mapistore_notification_deliver_add().
enum mapistore_error mapistore_notification_deliver_get | ( | TALLOC_CTX * | mem_ctx, |
struct mapistore_context * | mstore_ctx, | ||
struct GUID | uuid, | ||
uint8_t ** | payload, | ||
size_t * | length | ||
) |
Retrieve the deliver payload
mem_ctx | the memory context to use for data allocation |
mstore_ctx | pointer to the mapistore context |
uuid | the UUID of the session |
payload | pointer on pointer to the data to return |
length | pointer on the length of the payload data to return |
References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_payload_newmail | ( | TALLOC_CTX * | mem_ctx, |
char * | backend, | ||
char * | eml, | ||
char * | folder, | ||
char | separator, | ||
uint8_t ** | data, | ||
size_t * | length | ||
) |
Generate a newmail notification payload to be consumed by the service referenced by resolver entries.
mem_ctx | pointer to the memory context |
backend | the mapistore backend consuming this url |
eml | the eml message to index |
folder | the destination folder |
separator | the folder separator |
data | pointer on pointer to the generated blob to return |
length | pointer to the length of the generated blob returned |
References MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_resolver_add | ( | struct mapistore_context * | mstore_ctx, |
const char * | cn, | ||
const char * | host | ||
) |
Add a record to the resolver
mstore_ctx | pointer to the mapistore context |
cn | the common name (key) to use for host registration |
host | the host to register |
[START] Does the key exist? If yes: Update record If no: Insert key
References MAPISTORE_ERR_EXIST, MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_FOUND, MAPISTORE_ERR_NOT_INITIALIZED, mapistore_notification_resolver_exist(), mapistore_notification_resolver_get(), and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_resolver_delete | ( | struct mapistore_context * | mstore_ctx, |
const char * | cn, | ||
const char * | host | ||
) |
Unregister a host from a resolver entry
mstore_ctx | pointer to the mapistore context |
cn | the resolver key to lookup |
host | the host entry to delete within record |
References MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_FOUND, MAPISTORE_ERR_NOT_INITIALIZED, mapistore_notification_resolver_get(), and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_resolver_exist | ( | struct mapistore_context * | mstore_ctx, |
const char * | cn | ||
) |
Check if the resolver entry pointer by cn exist
mstore_ctx | pointer to the mapistore context |
cn | the common name to lookup |
References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
Referenced by mapistore_notification_resolver_add().
enum mapistore_error mapistore_notification_resolver_get | ( | TALLOC_CTX * | mem_ctx, |
struct mapistore_context * | mstore_ctx, | ||
const char * | cn, | ||
uint32_t * | countp, | ||
const char *** | hostsp | ||
) |
Get resolver data for a given resolver entry
mem_ctx | pointer to the memory context |
mstore_ctx | pointer to the mapistore context |
cn | the resolver key to lookup |
countp | pointer on the number of hosts returned |
hostsp | pointer on the list of host to return |
References MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
Referenced by mapistore_notification_resolver_add(), and mapistore_notification_resolver_delete().
enum mapistore_error mapistore_notification_session_add | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid, | ||
struct GUID | async_uuid, | ||
const char * | cn | ||
) |
Register and bind asynchronous emsmdb session handle to emsmdb one
mstore_ctx | pointer to the mapistore context |
uuid | the emsmdb session uuid |
async_uuid | the asynchronous emsmdb session uuid |
cn | the common name (username or email) to associate |
References MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_session_delete | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | async_uuid | ||
) |
Unregister and unbind specified asynchronous emsmdb session
mstore_ctx | pointer to the mstore context |
async_uuid | the asynchronous emsmdb session uuid used for computing the session key to be deleted |
References MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_session_exist | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | async_uuid | ||
) |
Check if an asynchronous session context exists
mstore_ctx | pointer to the mapistore context |
async_uuid | the asynchronous emsmdb session uuid to lookup |
References MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_session_get | ( | TALLOC_CTX * | mem_ctx, |
struct mapistore_context * | mstore_ctx, | ||
struct GUID | async_uuid, | ||
struct GUID * | uuid, | ||
char ** | cnp | ||
) |
Retrieve EMSMDB session UUID and user name associated to specified asynchronous emsmdb session UUID
mem_ctx | pointer to the memory context to use to allocate data to return |
mstore_ctx | pointer to the mapistore context |
async_uuid | the GUID of the asynchronous emsmdb session |
uuidp | pointer to the GUID of the emsmdb session |
cnp | pointer on pointer to the common name to return |
References MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_subscription_add | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid, | ||
uint32_t | handle, | ||
uint16_t | flags, | ||
uint64_t | fid, | ||
uint64_t | mid, | ||
uint32_t | count, | ||
enum MAPITAGS * | properties | ||
) |
Add a subscription entry for a MAPI object
mstore_ctx | pointer to the mapistore context |
uuid | the session UUID |
handle | the handle to associate this subscription with |
flags | the notification bitmask to associate to this subscription |
fid | the FolderID where relevant |
mid | the MessageId where relevant |
count | the number of properties when subscribing for a table events |
properties | pointer on an array of MAPI properties to add for table events |
References MAPISTORE_ERR_EXIST, MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, mapistore_notification_subscription_exist(), and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_subscription_delete | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid | ||
) |
Delete the subscription record associated to specified session UUID
mstore_ctx | pointer to the mapistore context |
uuid | the session UUID |
References MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_subscription_delete_by_handle | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid, | ||
uint32_t | handle | ||
) |
Delete the subscription record associated to specified session UUID and referenced by specified handle
mstore_ctx | pointer to the mapistore context |
uuid | the session uuid |
handle | the handle of the entry to delete |
References MAPISTORE_ERR_INVALID_DATA, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_FOUND, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_notification_subscription_exist | ( | struct mapistore_context * | mstore_ctx, |
struct GUID | uuid | ||
) |
Check if a subscription record exist for the given session UUID
mstore_ctx | pointer to the mapistore context |
uuid | the session UUID to lookup |
References MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERR_NOT_AVAILABLE, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
Referenced by mapistore_notification_subscription_add().
enum mapistore_error mapistore_release | ( | struct mapistore_context * | mstore_ctx | ) |
Release the mapistore context and destroy any data associated
mstore_ctx | pointer to the mapistore context |
References MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_replica_mapping_guid_to_replid | ( | struct mapistore_context * | mstore_ctx, |
const char * | username, | ||
const struct GUID * | guidP, | ||
uint16_t * | replidP | ||
) |
Search a replica guid in the database, creates it if it does not exist
mstore_ctx | pointer to the mapistore context |
guidP | the replica guid |
replidP | pointer to the returned replica id |
References MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_replica_mapping_replid_to_guid | ( | struct mapistore_context * | mstore_ctx, |
const char * | username, | ||
uint16_t | replid, | ||
struct GUID * | guidP | ||
) |
Search a replica id in the database
mstore_ctx | pointer to the mapistore context |
replid | the replica id |
guidP | pointer to the returned replica guid |
References MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_search_context_by_uri | ( | struct mapistore_context * | mstore_ctx, |
const char * | uri, | ||
uint32_t * | context_id, | ||
void ** | backend_object | ||
) |
Search for an existing context given its uri
mstore_ctx | pointer to the mapistore context |
uri | the URI to lookup |
context_id | pointer to the context identifier to return |
References mapistore_backend_lookup_by_uri(), MAPISTORE_ERR_NOT_FOUND, MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
enum mapistore_error mapistore_set_connection_info | ( | struct mapistore_context * | mstore_ctx, |
struct ldb_context * | sam_ctx, | ||
struct openchangedb_context * | oc_ctx, | ||
const char * | username | ||
) |
Set connection info for current mapistore context
mstore_ctx | pointer to the mapistore context |
oc_ctx | pointer to the openchange ldb database |
username | pointer to the current username |
References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
void mapistore_set_default_cache_url | ( | const char * | url | ) |
Set the default cache url. If none is set, 127.0.0.1:11211 will be used.
url | default backend url to be used |
Referenced by mapistore_init().
void mapistore_set_default_indexing_url | ( | const char * | url | ) |
Set the default backend url. If none is set, a tdb file per user will be used.
url | default backend url to be used |
Referenced by mapistore_init().
enum mapistore_error mapistore_set_mapping_path | ( | const char * | path | ) |
Set the mapping path
path | pointer to the mapping path |
References MAPISTORE_ERR_NO_DIRECTORY, and MAPISTORE_SUCCESS.
Referenced by mapistore_init().
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |