2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGLdapConnection_H__
23 #define __NGLdapConnection_H__
25 #import <Foundation/NSObject.h>
26 #import <Foundation/NSDate.h>
28 @class NSString, NSArray, NSEnumerator;
32 @interface NGLdapConnection : NSObject
38 NSTimeInterval cacheTimeout;
39 long cacheMaxMemory; /* in bytes */
47 - (id)initWithHostName:(NSString *)_hostName port:(int)_port; // designated init
48 - (id)initWithHostName:(NSString *)_hostName;
52 - (NSString *)hostName;
60 - (BOOL)bindWithMethod:(NSString *)_method
61 binddn:(NSString *)_login credentials:(NSString *)_cred;
65 - (NSEnumerator *)flatSearchAtBaseDN:(NSString *)_base
66 qualifier:(EOQualifier *)_q
67 attributes:(NSArray *)_attributes;
68 - (NSEnumerator *)deepSearchAtBaseDN:(NSString *)_base
69 qualifier:(EOQualifier *)_q
70 attributes:(NSArray *)_attributes;
71 - (NSEnumerator *)baseSearchAtBaseDN:(NSString *)_base
72 qualifier:(EOQualifier *)_q
73 attributes:(NSArray *)_attributes;
75 - (NGLdapEntry *)entryAtDN:(NSString *)_dn attributes:(NSArray *)_attrs;
79 - (void)setCacheTimeout:(NSTimeInterval)_to;
80 - (NSTimeInterval)cacheTimeout;
82 - (void)setCacheMaxMemoryUsage:(long)_maxMem;
83 - (long)cacheMaxMemoryUsage;
85 - (void)setUseCache:(BOOL)_flag;
91 - (void)cacheForgetEntryWithDN:(NSString *)_dn;
95 - (BOOL)addEntry:(NGLdapEntry *)_entry;
96 - (BOOL)removeEntryWithDN:(NSString *)_dn;
97 - (BOOL)modifyEntryWithDN:(NSString *)_dn changes:(NSArray *)_mods;
101 - (NGLdapEntry *)schemaEntry;
102 - (NGLdapEntry *)rootDSE;
103 - (NGLdapEntry *)configEntry;
104 - (NSArray *)namingContexts;
108 @interface NGLdapConnection(PlainPasswordCheck)
110 /* specialized password check routine */
112 - (NSString *)dnForLogin:(NSString *)_login baseDN:(NSString *)_baseDN;
114 + (BOOL)checkPassword:(NSString *)_pwd ofLogin:(NSString *)_login
115 atBaseDN:(NSString *)_baseDN
116 onHost:(NSString *)_hostName port:(int)_port;
120 #endif /* __NGLdapConnection_H__ */