3 // MICOsec --- a free CORBA Security implementation
4 // Copyright (C) 2000 ObjectSecurity Ltd.
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Library General Public
8 // License as published by the Free Software Foundation; either
9 // version 2 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Library General Public License for more details.
16 // You should have received a copy of the GNU Library General Public
17 // License along with this library; if not, write to the Free
18 // Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 // Send comments and/or bug reports to:
21 // micosec@objectsecurity.com
24 #ifndef __ODM_IMPL_H__
25 #define __ODM_IMPL_H__
37 find_record(std::string& key, MICOSODM::Manager_impl* odm);
40 remove_record(std::string& key, MICOSODM::Manager_impl* odm);
44 (MICOSODM::Manager_impl* odm,
45 PortableServer::LifespanPolicyValue p);
47 extern PortableServer::LifespanPolicyValue
48 get_lspolicy(MICOSODM::Manager_impl* odm);
50 // ODM options (-ODMConfig)
56 parse (CORBA::ORB_ptr, int&, char* []);
59 operator[](const char *);
62 std::map<std::string, std::string, std::less<std::string> > options_;
65 extern MICO_EXPORT ODMOptions odmopts;
73 ODMRecord(const ODMRecord& s);
76 operator=(const ODMRecord& s);
78 ObjectDomainMapping::Manager::ODMGranularity gran_;
79 SecurityDomain::NameList dnamelist_; // Domain Namelist
82 PortableServer::LifespanPolicyValue pol_;
85 typedef std::map<std::string, ODMRecord *, std::less<std::string> > DomainMap;
90 AllDomainList(std::ostream* o = &std::cout)
99 load_config(const char* conffile);
105 save_config(const char* conffile);
108 DomainMap all_domains_;
116 : public ObjectDomainMapping::Manager
119 Manager_impl* parent_;
120 Manager_impl* def_parent_;
121 // ObjectDomainMapping::Manager::ODMGranularity gran;
123 std::string def_key_;
124 // PortableServer::POA_ptr poa;
125 PortableServer::LifespanPolicyValue pol_;
126 AllDomainList* domains_;
130 opaque_to_string(const Security::Opaque& key);
134 Manager_impl(AllDomainList* domains);
139 (ODMGranularity granularity,
140 const Security::Opaque& key,
141 const SecurityDomain::NameList& domain_name_list);
143 virtual SecurityDomain::NameList*
144 get_domain_names(const Security::Opaque& key);
147 remove_domain_names(const Security::Opaque& key);
151 (const Security::Opaque& key,
152 ObjectDomainMapping::Manager_ptr odm);
155 set_default_parent_odm(ObjectDomainMapping::Manager_ptr odm);
158 set_default_name_key(const SecurityDomain::NameList& domain_name_list);
161 find_record(std::string& key, MICOSODM::Manager_impl* odm);
164 remove_record(std::string& key, MICOSODM::Manager_impl* odm);
168 (MICOSODM::Manager_impl* odm,
169 PortableServer::LifespanPolicyValue p);
171 friend PortableServer::LifespanPolicyValue
172 get_lspolicy(MICOSODM::Manager_impl* odm);
176 // Manager Factory interface
179 : public ObjectDomainMapping::Factory {
184 virtual ObjectDomainMapping::Manager_ptr
188 virtual CORBA::Boolean
189 load_config_file(const char* cf);
191 virtual CORBA::Boolean
192 save_config_file(const char* cf);
194 AllDomainList* domains_;
198 : public ObjectDomainMapping::ODM
201 Factory_impl* cur_factory_;
205 { cur_factory_ = NULL; }
209 virtual ObjectDomainMapping::Factory_ptr
212 cur_factory_ = new Factory_impl;
216 virtual ObjectDomainMapping::Factory_ptr current()
217 { return cur_factory_; }
221 #endif // __ODM_IMPL_H__