Moved to abstract index_context instead of tdb_wrap
parent
660f39a980
commit
33b353b974
|
@ -61,10 +61,10 @@
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listAllContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
+ (enum mapistore_error) createRootFolder: (NSString **) mapistoreUriP
|
||||
withFID: (uint64_t ) fid
|
||||
|
@ -75,11 +75,11 @@
|
|||
+ (int) openContext: (MAPIStoreContext **) contextPtr
|
||||
withURI: (const char *) newUri
|
||||
connectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb;
|
||||
andTDBIndexing: (struct indexing_context *) indexing;
|
||||
|
||||
- (id) initFromURL: (NSURL *) newUri
|
||||
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb;
|
||||
andTDBIndexing: (struct indexing_context *) indexing;
|
||||
|
||||
- (NSURL *) url;
|
||||
- (struct mapistore_connection_info *) connectionInfo;
|
||||
|
|
|
@ -100,7 +100,7 @@ static NSMutableDictionary *contextClassMapping;
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listAllContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_contexts_list *list, *current;
|
||||
|
@ -112,7 +112,7 @@ static NSMutableDictionary *contextClassMapping;
|
|||
list = NULL;
|
||||
|
||||
userContext = [MAPIStoreUserContext userContextWithUsername: userName
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
[userContext activateWithUser: [userContext sogoUser]];
|
||||
|
||||
classes = GSObjCAllSubclassesOfClass (self);
|
||||
|
@ -121,7 +121,7 @@ static NSMutableDictionary *contextClassMapping;
|
|||
{
|
||||
currentClass = [classes objectAtIndex: count];
|
||||
current = [currentClass listContextsForUser: userName
|
||||
withTDBIndexing: indexingTdb
|
||||
withIndexing: indexing
|
||||
inMemCtx: memCtx];
|
||||
if (current)
|
||||
DLIST_CONCATENATE(list, current, void);
|
||||
|
@ -131,7 +131,7 @@ static NSMutableDictionary *contextClassMapping;
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
return NULL;
|
||||
|
@ -216,7 +216,7 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
+ (int) openContext: (MAPIStoreContext **) contextPtr
|
||||
withURI: (const char *) newUri
|
||||
connectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
andTDBIndexing: (struct indexing_context *) indexing
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
Class contextClass;
|
||||
|
@ -239,7 +239,7 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
{
|
||||
context = [[contextClass alloc] initFromURL: baseURL
|
||||
withConnectionInfo: newConnInfo
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
if (context)
|
||||
{
|
||||
[context autorelease];
|
||||
|
@ -272,7 +272,7 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
|
||||
- (id) initFromURL: (NSURL *) newUrl
|
||||
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
andTDBIndexing: (struct indexing_context *) indexing
|
||||
{
|
||||
NSString *username;
|
||||
|
||||
|
@ -291,7 +291,7 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
|
||||
ASSIGN (userContext,
|
||||
[MAPIStoreUserContext userContextWithUsername: username
|
||||
andTDBIndexing: indexingTdb]);
|
||||
andTDBIndexing: indexing]);
|
||||
|
||||
#if 0
|
||||
mapistore_mgmt_backend_register_user (newConnInfo,
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_contexts_list *firstContext = NULL, *context;
|
||||
|
@ -72,7 +72,7 @@
|
|||
inContainer: nil];
|
||||
[root setOwner: userName];
|
||||
userContext = [MAPIStoreUserContext userContextWithUsername: userName
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
[userContext ensureFolderTableExists];
|
||||
[root setTableUrl: [userContext folderTableURL]];
|
||||
names = [root toManyRelationshipKeys];
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_contexts_list *firstContext = NULL, *context;
|
||||
|
@ -79,7 +79,7 @@
|
|||
if (moduleName)
|
||||
{
|
||||
userContext = [MAPIStoreUserContext userContextWithUsername: userName
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
parentFolder = [[userContext rootFolders] objectForKey: moduleName];
|
||||
baseUrl = [NSString stringWithFormat: @"sogo://%@@%@/",
|
||||
userName, moduleName];
|
||||
|
|
|
@ -83,7 +83,7 @@ MakeDisplayFolderName (NSString *folderName)
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_contexts_list *firstContext = NULL, *context;
|
||||
|
@ -100,7 +100,7 @@ MakeDisplayFolderName (NSString *folderName)
|
|||
WOContext *woContext;
|
||||
|
||||
userContext = [MAPIStoreUserContext userContextWithUsername: userName
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
accountFolder = [[userContext rootFolders] objectForKey: @"mail"];
|
||||
woContext = [userContext woContext];
|
||||
|
||||
|
@ -245,7 +245,7 @@ MakeDisplayFolderName (NSString *folderName)
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_contexts_list *context;
|
||||
|
@ -256,7 +256,7 @@ MakeDisplayFolderName (NSString *folderName)
|
|||
WOContext *woContext;
|
||||
|
||||
userContext = [MAPIStoreUserContext userContextWithUsername: userName
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
accountFolder = [[userContext rootFolders] objectForKey: @"mail"];
|
||||
woContext = [userContext woContext];
|
||||
|
||||
|
|
|
@ -32,17 +32,17 @@
|
|||
{
|
||||
void *memCtx;
|
||||
NSString *username;
|
||||
struct tdb_wrap *indexing;
|
||||
struct indexing_context *indexing;
|
||||
NSMutableDictionary *mapping; /* FID/MID -> url */
|
||||
NSMutableDictionary *reverseMapping; /* url -> FID/MID */
|
||||
NSUInteger useCount;
|
||||
}
|
||||
|
||||
+ (id) mappingForUsername: (NSString *) username
|
||||
withIndexing: (struct tdb_wrap *) indexing;
|
||||
withIndexing: (struct indexing_context *) indexing;
|
||||
|
||||
- (id) initForUsername: (NSString *) username
|
||||
withIndexing: (struct tdb_wrap *) indexing;
|
||||
withIndexing: (struct indexing_context *) indexing;
|
||||
|
||||
|
||||
- (void) increaseUseCount;
|
||||
|
|
|
@ -40,10 +40,6 @@
|
|||
#include <talloc.h>
|
||||
#include <tdb.h>
|
||||
|
||||
struct tdb_wrap {
|
||||
struct tdb_context *tdb;
|
||||
};
|
||||
|
||||
static NSMutableDictionary *mappingRegistry = nil;
|
||||
|
||||
@implementation MAPIStoreMapping
|
||||
|
@ -103,7 +99,7 @@ MAPIStoreMappingTDBTraverse (TDB_CONTEXT *ctx, TDB_DATA data1, TDB_DATA data2,
|
|||
}
|
||||
|
||||
+ (id) mappingForUsername: (NSString *) username
|
||||
withIndexing: (struct tdb_wrap *) indexing
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
{
|
||||
id mapping;
|
||||
|
||||
|
@ -153,7 +149,7 @@ MAPIStoreMappingTDBTraverse (TDB_CONTEXT *ctx, TDB_DATA data1, TDB_DATA data2,
|
|||
}
|
||||
|
||||
- (id) initForUsername: (NSString *) newUsername
|
||||
withIndexing: (struct tdb_wrap *) newIndexing
|
||||
withIndexing: (struct indexing_context *) newIndexing
|
||||
{
|
||||
NSString *idNbr, *uri;
|
||||
NSArray *keys;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
}
|
||||
|
||||
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
|
||||
withTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
withIndexing: (struct indexing_context *) indexing
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
struct mapistore_contexts_list *context;
|
||||
|
|
|
@ -144,7 +144,7 @@ sogo_backend_init (void)
|
|||
static enum mapistore_error
|
||||
sogo_backend_create_context(TALLOC_CTX *mem_ctx,
|
||||
struct mapistore_connection_info *conn_info,
|
||||
struct tdb_wrap *indexingTdb,
|
||||
struct indexing_context *indexing,
|
||||
const char *uri, void **context_object)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
|
@ -161,7 +161,7 @@ sogo_backend_create_context(TALLOC_CTX *mem_ctx,
|
|||
rc = [MAPIStoreContextK openContext: &context
|
||||
withURI: uri
|
||||
connectionInfo: conn_info
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
*context_object = [context tallocWrapper: mem_ctx];
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ static enum mapistore_error
|
|||
sogo_backend_create_root_folder (const char *username,
|
||||
enum mapistore_context_role role,
|
||||
uint64_t fid, const char *name,
|
||||
// struct tdb_wrap *indexingTdb,
|
||||
// struct indexing_context *indexing,
|
||||
TALLOC_CTX *mem_ctx, char **mapistore_urip)
|
||||
{
|
||||
NSAutoreleasePool *pool;
|
||||
|
@ -213,7 +213,7 @@ sogo_backend_create_root_folder (const char *username,
|
|||
}
|
||||
|
||||
static enum mapistore_error
|
||||
sogo_backend_list_contexts(const char *username, struct tdb_wrap *indexingTdb,
|
||||
sogo_backend_list_contexts(const char *username, struct indexing_context *indexing,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct mapistore_contexts_list **contexts_listp)
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ sogo_backend_list_contexts(const char *username, struct tdb_wrap *indexingTdb,
|
|||
{
|
||||
userName = [NSString stringWithUTF8String: username];
|
||||
*contexts_listp = [MAPIStoreContextK listAllContextsForUser: userName
|
||||
withTDBIndexing: indexingTdb
|
||||
withIndexing: indexing
|
||||
inMemCtx: mem_ctx];
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -63,10 +63,10 @@
|
|||
}
|
||||
|
||||
+ (id) userContextWithUsername: (NSString *) username
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb;
|
||||
andTDBIndexing: (struct indexing_context *) indexing;
|
||||
|
||||
- (id) initWithUsername: (NSString *) newUsername
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb;
|
||||
andTDBIndexing: (struct indexing_context *) indexing;
|
||||
|
||||
- (NSString *) username;
|
||||
- (SOGoUser *) sogoUser;
|
||||
|
|
|
@ -60,7 +60,7 @@ static NSMapTable *contextsTable = nil;
|
|||
}
|
||||
|
||||
+ (id) userContextWithUsername: (NSString *) username
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb;
|
||||
andTDBIndexing: (struct indexing_context *) indexing;
|
||||
{
|
||||
id userContext;
|
||||
|
||||
|
@ -68,7 +68,7 @@ static NSMapTable *contextsTable = nil;
|
|||
if (!userContext)
|
||||
{
|
||||
userContext = [[self alloc] initWithUsername: username
|
||||
andTDBIndexing: indexingTdb];
|
||||
andTDBIndexing: indexing];
|
||||
[userContext autorelease];
|
||||
[contextsTable setObject: userContext forKey: username];
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ static NSMapTable *contextsTable = nil;
|
|||
}
|
||||
|
||||
- (id) initWithUsername: (NSString *) newUsername
|
||||
andTDBIndexing: (struct tdb_wrap *) indexingTdb
|
||||
andTDBIndexing: (struct indexing_context *) indexing
|
||||
{
|
||||
NSString *userPassword;
|
||||
|
||||
|
@ -133,9 +133,9 @@ static NSMapTable *contextsTable = nil;
|
|||
{
|
||||
/* "username" will be retained by table */
|
||||
username = newUsername;
|
||||
if (indexingTdb)
|
||||
if (indexing)
|
||||
ASSIGN (mapping, [MAPIStoreMapping mappingForUsername: username
|
||||
withIndexing: indexingTdb]);
|
||||
withIndexing: indexing]);
|
||||
|
||||
authenticator = [MAPIStoreAuthenticator new];
|
||||
[authenticator setUsername: username];
|
||||
|
|
Loading…
Reference in New Issue