MAPISTORE internal indexing functions. More...
#include "mapistore.h"
#include "mapistore_errors.h"
#include "mapistore_private.h"
#include "backends/indexing_tdb.h"
#include "backends/indexing_mysql.h"
#include "mapiproxy/libmapiproxy/libmapiproxy.h"
Functions | |
_PUBLIC_ enum mapistore_error | mapistore_indexing_add (struct mapistore_context *mstore_ctx, const char *username, struct indexing_context **ictxp) |
_PUBLIC_ enum mapistore_error | mapistore_indexing_get_new_folderID (struct mapistore_context *mstore_ctx, uint64_t *fid) |
_PUBLIC_ enum mapistore_error | mapistore_indexing_get_new_folderID_as_user (struct mapistore_context *mstore_ctx, const char *username, uint64_t *fid) |
_PUBLIC_ 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) |
_PUBLIC_ enum mapistore_error | mapistore_indexing_record_add_fid (struct mapistore_context *mstore_ctx, uint32_t context_id, const char *username, uint64_t fid) |
enum mapistore_error | mapistore_indexing_record_add_fmid (struct mapistore_context *mstore_ctx, uint32_t context_id, const char *username, uint64_t fmid, int type) |
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) |
_PUBLIC_ enum mapistore_error | mapistore_indexing_record_add_mid (struct mapistore_context *mstore_ctx, uint32_t context_id, const char *username, uint64_t mid) |
_PUBLIC_ 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) |
enum mapistore_error | mapistore_indexing_record_del_fmid (struct mapistore_context *mstore_ctx, uint32_t context_id, const char *username, uint64_t fmid, uint8_t flags, int type) |
_PUBLIC_ 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) |
_PUBLIC_ 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) |
_PUBLIC_ enum mapistore_error | mapistore_indexing_reserve_fmid_range (struct mapistore_context *mstore_ctx, uint64_t range_len, uint64_t *first_fmidp) |
struct indexing_context * | mapistore_indexing_search (struct mapistore_context *mstore_ctx, const char *username) |
_PUBLIC_ void | mapistore_set_default_cache_url (const char *url) |
_PUBLIC_ void | mapistore_set_default_indexing_url (const char *url) |
MAPISTORE internal indexing functions.
This file contains functionality to map between folder / message identifiers and backend URI strings.
_PUBLIC_ enum mapistore_error mapistore_indexing_add | ( | struct mapistore_context * | mstore_ctx, |
const char * | username, | ||
struct indexing_context ** | ictxp | ||
) |
Open connection to indexing database for a given user
mstore_ctx | pointer to the mapistore context |
username | name for which the indexing database has to be created |
References MAPISTORE_ERR_NOT_INITIALIZED, MAPISTORE_ERROR, mapistore_indexing_search(), and MAPISTORE_SUCCESS.
Referenced by mapistore_add_context(), mapistore_indexing_record_add_fmid(), mapistore_indexing_record_add_fmid_for_uri(), mapistore_indexing_record_del_fmid(), and mapistore_indexing_record_get_uri().
_PUBLIC_ 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().
_PUBLIC_ 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().
_PUBLIC_ 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.
_PUBLIC_ 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 | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
const char * | username, | ||
uint64_t | fmid, | ||
int | type | ||
) |
Add a folder or message record to the indexing database
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 |
type | MAPISTORE_FOLDER or MAPISTORE_MESSAGE |
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NO_MEMORY, MAPISTORE_ERROR, mapistore_indexing_add(), and MAPISTORE_SUCCESS.
Referenced by mapistore_indexing_record_add_fid(), and mapistore_indexing_record_add_mid().
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().
_PUBLIC_ 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().
_PUBLIC_ 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_fmid | ( | struct mapistore_context * | mstore_ctx, |
uint32_t | context_id, | ||
const char * | username, | ||
uint64_t | fmid, | ||
uint8_t | flags, | ||
int | type | ||
) |
Remove a folder or message record from the indexing database
mstore_ctx | pointer to the mapistore context |
context_id | the context identifier referencing the indexing database to update |
fmid | the folder or message ID to delete |
flags | the type of deletion MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE |
type | MAPISTORE_FOLDER or MAPISTORE_MESSAGE |
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERROR, and mapistore_indexing_add().
Referenced by mapistore_indexing_record_del_fid(), and mapistore_indexing_record_del_mid().
_PUBLIC_ 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().
_PUBLIC_ 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().
_PUBLIC_ 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 indexing_context* mapistore_indexing_search | ( | struct mapistore_context * | mstore_ctx, |
const char * | username | ||
) |
Search the indexing record matching the username
mstore_ctx | pointer to the mapistore context |
username | the username to lookup |
Referenced by mapistore_indexing_add(), and mapistore_indexing_reserve_fmid_range().
_PUBLIC_ 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().
_PUBLIC_ 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().
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |