2008-01-16 19:47:20 +01:00
|
|
|
/* SOGoCache.h - this file is part of SOGo
|
|
|
|
*
|
2010-12-28 18:42:50 +01:00
|
|
|
* Copyright (C) 2008-2011 Inverse inc.
|
2008-01-16 19:47:20 +01:00
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2008-11-11 01:17:35 +01:00
|
|
|
* Ludovic Marcotte <lmarcotte@inverse.ca>
|
2008-01-16 19:47:20 +01:00
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SOGOCACHE_H
|
|
|
|
#define SOGOCACHE_H
|
|
|
|
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
2009-08-03 17:46:02 +02:00
|
|
|
#include <libmemcached/memcached.h>
|
|
|
|
|
2008-01-16 19:47:20 +01:00
|
|
|
@class NSMutableDictionary;
|
|
|
|
@class NSString;
|
2008-11-12 04:30:13 +01:00
|
|
|
@class NSUserDefaults;
|
2008-01-16 19:47:20 +01:00
|
|
|
|
2010-10-13 15:21:16 +02:00
|
|
|
@class NGImap4Connection;
|
|
|
|
|
2010-09-24 17:24:24 +02:00
|
|
|
@class SOGoGroup;
|
2008-01-16 19:47:20 +01:00
|
|
|
@class SOGoObject;
|
|
|
|
@class SOGoUser;
|
2008-11-12 04:30:13 +01:00
|
|
|
@class SOGoUserDefaults;
|
2008-01-16 19:47:20 +01:00
|
|
|
|
|
|
|
@interface SOGoCache : NSObject
|
|
|
|
{
|
2009-11-16 16:02:14 +01:00
|
|
|
NSMutableDictionary *localCache;
|
2010-10-13 15:21:16 +02:00
|
|
|
NSMutableDictionary *imap4Connections;
|
2009-11-16 16:02:14 +01:00
|
|
|
NSMutableDictionary *cache;
|
2011-07-15 22:30:39 +02:00
|
|
|
BOOL requestsCacheEnabled;
|
2009-11-16 16:02:14 +01:00
|
|
|
NSMutableDictionary *users;
|
2010-09-24 17:24:24 +02:00
|
|
|
NSMutableDictionary *groups;
|
2009-11-29 05:19:32 +01:00
|
|
|
float cleanupInterval;
|
|
|
|
NSString *memcachedServerName;
|
2008-01-16 19:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (SOGoCache *) sharedCache;
|
2009-11-16 16:02:14 +01:00
|
|
|
|
2011-07-15 22:30:39 +02:00
|
|
|
- (void) disableRequestsCache;
|
2011-11-18 16:14:31 +01:00
|
|
|
- (void) disableLocalCache;
|
2011-07-15 22:30:39 +02:00
|
|
|
|
2009-11-16 16:02:14 +01:00
|
|
|
- (void) killCache;
|
2008-01-16 19:47:20 +01:00
|
|
|
|
|
|
|
- (void) registerObject: (id) object
|
|
|
|
withName: (NSString *) name
|
|
|
|
inContainer: (SOGoObject *) container;
|
2011-03-07 19:58:14 +01:00
|
|
|
- (void) unregisterObjectWithName: (NSString *) name
|
|
|
|
inContainer: (SOGoObject *) container;
|
2008-01-16 19:47:20 +01:00
|
|
|
- (id) objectNamed: (NSString *) name
|
|
|
|
inContainer: (SOGoObject *) container;
|
|
|
|
|
2009-09-11 16:38:43 +02:00
|
|
|
- (void) registerUser: (SOGoUser *) user
|
|
|
|
withName: (NSString *) userName;
|
2008-01-16 19:47:20 +01:00
|
|
|
- (id) userNamed: (NSString *) name;
|
|
|
|
|
2010-09-24 17:24:24 +02:00
|
|
|
- (void) registerGroup: (SOGoGroup *) group
|
|
|
|
withName: (NSString *) groupName
|
|
|
|
inDomain: (NSString *) domainName;
|
|
|
|
|
|
|
|
- (id) groupNamed: (NSString *) groupName
|
|
|
|
inDomain: (NSString *) domainName;
|
|
|
|
|
2010-10-13 15:21:16 +02:00
|
|
|
- (void) registerIMAP4Connection: (NGImap4Connection *) connection
|
|
|
|
forKey: (NSString *) key;
|
|
|
|
- (NGImap4Connection *) imap4ConnectionForKey: (NSString *) key;
|
|
|
|
|
2010-01-28 22:42:03 +01:00
|
|
|
/* NSDictionary-like methods */
|
|
|
|
- (void) setValue: (NSString *) value forKey: (NSString *) key;
|
|
|
|
- (NSString *) valueForKey: (NSString *) key;
|
|
|
|
- (void) removeValueForKey: (NSString *) key;
|
|
|
|
|
2009-11-19 18:08:47 +01:00
|
|
|
- (void) setUserAttributes: (NSString *) attributes
|
|
|
|
forLogin: (NSString *) login;
|
|
|
|
- (NSString *) userAttributesForLogin: (NSString *) theLogin;
|
2008-11-12 04:30:13 +01:00
|
|
|
|
2009-11-19 18:08:47 +01:00
|
|
|
- (void) setUserDefaults: (NSString *) attributes
|
|
|
|
forLogin: (NSString *) login;
|
|
|
|
- (NSString *) userDefaultsForLogin: (NSString *) theLogin;
|
|
|
|
|
|
|
|
- (void) setUserSettings: (NSString *) attributes
|
|
|
|
forLogin: (NSString *) login;
|
|
|
|
- (NSString *) userSettingsForLogin: (NSString *) theLogin;
|
2009-03-03 20:08:02 +01:00
|
|
|
|
2010-12-28 18:42:50 +01:00
|
|
|
//
|
|
|
|
// CAS support
|
|
|
|
//
|
2010-01-28 22:42:03 +01:00
|
|
|
- (NSString *) CASTicketFromIdentifier: (NSString *) identifier;
|
|
|
|
- (NSString *) CASSessionWithTicket: (NSString *) ticket;
|
|
|
|
- (void) setCASSession: (NSString *) casSession
|
|
|
|
withTicket: (NSString *) ticket
|
|
|
|
forIdentifier: (NSString *) identifier;
|
|
|
|
|
|
|
|
- (NSString *) CASPGTIdFromPGTIOU: (NSString *) pgtIou;
|
|
|
|
- (void) setCASPGTId: (NSString *) pgtId
|
|
|
|
forPGTIOU: (NSString *) pgtIou;
|
|
|
|
|
2010-12-28 18:42:50 +01:00
|
|
|
//
|
|
|
|
// ACL caching support
|
|
|
|
//
|
2010-10-15 20:30:08 +02:00
|
|
|
- (void) setACLs: (NSDictionary *) theACLs
|
|
|
|
forPath: (NSString *) thePath;
|
|
|
|
- (NSMutableDictionary *) aclsForPath: (NSString *) thePath;
|
|
|
|
|
2008-01-16 19:47:20 +01:00
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* SOGOCACHE_H */
|