OpenChange mapistore library 2.0 API Documentation

- Main Page
- Files

- File List
- Globals

Functions
mapistore_indexing.c File Reference

MAPISTORE internal indexing functions. More...

`#include <string.h>`
`#include "mapistore.h"`
`#include "mapistore_errors.h"`
`#include "mapistore_private.h"`
`#include <dlinklist.h>`
`#include "libmapi/libmapi_private.h"`
`#include <tdb.h>`

## Functions
_PUBLIC_ enum mapistore_error | mapistore_indexing_add (struct mapistore_context *mstore_ctx, const char *username, struct indexing_context_list **ictxp)
_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)
_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)
_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)
struct indexing_context_list * | mapistore_indexing_search (struct mapistore_context *mstore_ctx, const char *username)
enum mapistore_error | mapistore_indexing_search_existing_fmid (struct indexing_context_list *ictx, uint64_t fmid, bool *IsSoftDeleted)

## Detailed Description

MAPISTORE internal indexing functions.

This file contains functionality to map between folder / message identifiers and backend URI strings.

## Function Documentation

_PUBLIC_ enum mapistore_error mapistore_indexing_add | ( | struct mapistore_context * | mstore_ctx,
|  | const char * | username,
|  | struct indexing_context_list ** | ictxp
| ) |  |

Open connection to indexing database for a given user

Parameters

  mstore_ctx | pointer to the mapistore context
  username | name for which the indexing database has to be created

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References MAPISTORE_ERR_DATABASE_INIT, 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_del_fmid(), mapistore_indexing_record_get_uri(), mapistore_mgmt_register_message(), and mapistore_mgmt_registered_message().

_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

Parameters

  mstore_ctx | pointer to the mapistore context
  context_id | the context identifier referencing the indexing database to update
  fid | the fid to add

Note
  This is a wrapper to the internal common mapistore_indexing_record_add_fmid function.

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

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
| ) |  |

Add a folder or message record to the indexing database

Parameters

  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 add
  type | MAPISTORE_FOLDER or MAPISTORE_MESSAGE

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERROR, mapistore_indexing_add(), and mapistore_indexing_search_existing_fmid().

Referenced by mapistore_indexing_record_add_fid(), and mapistore_indexing_record_add_mid().

_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

Parameters

  mstore_ctx | pointer to the mapistore context
  context_id | the context identifier referencing the indexing database to update
  mid | the mid to add

Note
  This is a wrapper to the internal common mapistore_indexing_record_add_fmid function.

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

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

Parameters

  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

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

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
| ) |  |

Remove a folder or message record from the indexing database

Parameters

  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

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References mapistore_backend_lookup(), MAPISTORE_ERR_DATABASE_OPS, MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERROR, mapistore_indexing_add(), mapistore_indexing_search_existing_fmid(), and MAPISTORE_SUCCESS.

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

Parameters

  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

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

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

Parameters

  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

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References MAPISTORE_ERR_NOT_FOUND, MAPISTORE_ERR_NOT_INITIALIZED, MAPISTORE_ERROR, mapistore_indexing_add(), and MAPISTORE_SUCCESS.

struct indexing_context_list* mapistore_indexing_search | ( | struct mapistore_context * | mstore_ctx,
|  | const char * | username
| ) |  |
| read

Search the indexing record matching the username

Parameters

  mstore_ctx | pointer to the mapistore context
  username | the username to lookup

Returns
  pointer to the tdb_wrap structure on success, otherwise NULL

Referenced by mapistore_indexing_add().

enum mapistore_error mapistore_indexing_search_existing_fmid | ( | struct indexing_context_list * | ictx,
|  | uint64_t | fmid,
|  | bool * | IsSoftDeleted
| ) |  |

Convenient function to check if the folder/message ID passed in parameter already exists in the database or not and whether it is soft deleted or not

Parameters

  ictx | pointer to the indexing context
  fmid | folder/message ID to lookup
  IsSoftDeleted | pointer to boolean returned by the function which indicates whether the record is soft_deleted or not

Returns
  MAPISTORE_SUCCESS if the folder/message ID doesn't exist, otherwise MAPISTORE_ERR_EXIST.

References MAPISTORE_ERR_EXIST, MAPISTORE_ERROR, and MAPISTORE_SUCCESS.

Referenced by mapistore_indexing_record_add_fmid(), and mapistore_indexing_record_del_fmid().

| This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/