mapiproxy/modules/mpm_cache_ldb.c File Reference

LDB routines for the cache module. More...

#include "mapiproxy/dcesrv_mapiproxy.h"
#include "mapiproxy/libmapiproxy/libmapiproxy.h"
#include "mapiproxy/modules/mpm_cache.h"
#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.h"
#include <util/debug.h>

Functions

NTSTATUS mpm_cache_ldb_add_attachment (TALLOC_CTX *mem_ctx, struct ldb_context *ldb_ctx, struct mpm_attachment *attach)
static NTSTATUS mpm_cache_ldb_add_folder (TALLOC_CTX *mem_ctx, struct ldb_context *ldb_ctx, uint64_t FolderId)
NTSTATUS mpm_cache_ldb_add_message (TALLOC_CTX *mem_ctx, struct ldb_context *ldb_ctx, struct mpm_message *message)
NTSTATUS mpm_cache_ldb_add_stream (struct mpm_cache *mpm, struct ldb_context *ldb_ctx, struct mpm_stream *stream)
NTSTATUS mpm_cache_ldb_createdb (struct dcesrv_context *dce_ctx, const char *database, struct ldb_context **ldb_ctx)

Detailed Description

LDB routines for the cache module.


Function Documentation

NTSTATUS mpm_cache_ldb_add_attachment ( TALLOC_CTX *  mem_ctx,
struct ldb_context *  ldb_ctx,
struct mpm_attachment attach 
)

Add an attachment record to the TDB store

Parameters:
mem_ctx pointer to the memory context
ldb_ctx pointer to the LDB context
attach pointer to the mpm_attachment entry
Returns:
NT_STATUS_OK on success, otherwise a NT error

References mpm_attachment::AttachmentID, mpm_message::FolderId, mpm_attachment::message, mpm_message::MessageId, and MPM_LOCATION.

Referenced by cache_push_OpenAttach().

static NTSTATUS mpm_cache_ldb_add_folder ( TALLOC_CTX *  mem_ctx,
struct ldb_context *  ldb_ctx,
uint64_t  FolderId 
) [static]

Add a folder record to the TDB store

Parameters:
mem_ctx pointer to the memory context
ldb_ctx pointer to the LDB context
FolderId the ID we will be using to uniquely create the record
Returns:
NT_STATUS_OK on success, otherwise NT_STATUS_NOT_FOUND

References MPM_LOCATION.

Referenced by mpm_cache_ldb_add_message().

NTSTATUS mpm_cache_ldb_add_message ( TALLOC_CTX *  mem_ctx,
struct ldb_context *  ldb_ctx,
struct mpm_message message 
)

Add a message record to the TDB store

Parameters:
mem_ctx pointer to the memory context
ldb_ctx pointer to the LDB context
message pointer to the mpm_message entry with the folder and message ID
Returns:
NT_STATUS_OK on success, otherwise a NT error

References mpm_message::FolderId, mpm_message::MessageId, mpm_cache_ldb_add_folder(), and MPM_LOCATION.

Referenced by cache_push_OpenMessage().

NTSTATUS mpm_cache_ldb_add_stream ( struct mpm_cache mpm,
struct ldb_context *  ldb_ctx,
struct mpm_stream stream 
)

Add stream references to a message or attachment in the TDB store

Parameters:
mpm pointer to the cache module general structure
ldb_ctx pointer to the LDB context
stream pointer to the mpm_stream entry
Returns:
NT_STATUS_OK on success, otherwise NT error

References mpm_stream::ahead, mpm_stream::attachment, mpm_attachment::AttachmentID, mpm_stream::cached, mpm_stream::filename, mpm_message::FolderId, mpm_stream::message, mpm_attachment::message, mpm_message::MessageId, mpm_cache_stream_open(), MPM_LOCATION, mpm_stream::PropertyTag, and mpm_stream::StreamSize.

Referenced by cache_push_OpenStream().

NTSTATUS mpm_cache_ldb_createdb ( struct dcesrv_context *  dce_ctx,
const char *  database,
struct ldb_context **  ldb_ctx 
)

Create the cache database

Parameters:
dce_ctx pointer to the session context
database the complete path to the tdb store
ldb_ctx pointer to pointer on the the LDB context
Returns:
NT_STATUS_OK on success, otherwise NT_ERROR: NT_STATUS_NO_MEMORY, NT_STATUS_NOT_FOUND.

Referenced by cache_init().


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