2008-01-16 19:47:20 +01:00
|
|
|
/* SOGoCache.h - this file is part of SOGo
|
|
|
|
*
|
2009-02-24 02:54:59 +01:00
|
|
|
* Copyright (C) 2008-2009 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
|
|
|
|
|
|
|
@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;
|
|
|
|
NSMutableDictionary *cache;
|
|
|
|
NSMutableDictionary *users;
|
2009-11-29 05:19:32 +01:00
|
|
|
float cleanupInterval;
|
|
|
|
NSString *memcachedServerName;
|
2008-11-11 02:52:56 +01:00
|
|
|
@private
|
2009-08-03 17:46:02 +02:00
|
|
|
memcached_server_st *servers;
|
|
|
|
memcached_st *handle;
|
2008-01-16 19:47:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (SOGoCache *) sharedCache;
|
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;
|
|
|
|
- (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-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-01-28 22:42:03 +01:00
|
|
|
/* CAS support */
|
|
|
|
- (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;
|
|
|
|
|
2008-01-16 19:47:20 +01:00
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* SOGOCACHE_H */
|