00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "Iconf.h"
00028 #include <Sockets/XmlNode.h>
00029 #include <Sockets/XmlException.h>
00030 #include <Sockets/Utility.h>
00031
00032 namespace AJP13 {
00033
00035 namespace net_alhem_1_0_server {
00036
00037
00038 Security::Security()
00039 {
00040 }
00041
00042
00043
00044 Security::Security(const Xml::XmlNode& it)
00045 {
00046 FromXml(it);
00047 }
00048
00049
00050
00051 void Security::FromXml(const Xml::XmlNode& it)
00052 {
00053 {
00054 Xml::XmlNode n(it, "group");
00055 while (n)
00056 {
00057 net_alhem_1_0_server::Security::Group_t tmp(n);
00058 _element_group.push_back( tmp );
00059 ++n;
00060 }
00061 }
00062 if (!it.Exists("basicAuthentication"))
00063 throw Xml::XmlException("missing required node in element 'security': basicAuthentication");
00064 {
00065 Xml::XmlNode n(it, "basicAuthentication");
00066 if (n)
00067 _element_basicAuthentication.FromXml( n );
00068 }
00069 if (!it.Exists("authorization"))
00070 throw Xml::XmlException("missing required node in element 'security': authorization");
00071 {
00072 Xml::XmlNode n(it, "authorization");
00073 if (n)
00074 _element_authorization.FromXml( n );
00075 }
00076 }
00077
00078
00079
00080 const std::string Security::ToString(const std::string& name) const
00081 {
00082 std::string r;
00083 if (!name.empty())
00084 r += "<" + name + ">";
00085 for (std::list<net_alhem_1_0_server::Security::Group_t>::const_iterator it = _element_group.begin(); it != _element_group.end(); it++)
00086 {
00087 const net_alhem_1_0_server::Security::Group_t& ref = *it;
00088 r += ref.ToString("group");
00089 }
00090 r += _element_basicAuthentication.ToString("basicAuthentication");
00091 r += _element_authorization.ToString("authorization");
00092 if (!name.empty())
00093 r += "</" + name + ">";
00094 return r;
00095 }
00096
00097
00098
00099 bool Security::IsSet() const
00100 {
00101 return GroupIsSet() || BasicAuthenticationIsSet() || AuthorizationIsSet();
00102 }
00103
00104
00105
00106 const std::list<net_alhem_1_0_server::Security::Group_t>& Security::GetGroup() const
00107 {
00108 return _element_group;
00109 }
00110
00111
00112 std::list<net_alhem_1_0_server::Security::Group_t>& Security::GetGroup()
00113 {
00114 return _element_group;
00115 }
00116
00117
00118 void Security::SetGroup(const std::list<net_alhem_1_0_server::Security::Group_t>& group)
00119 {
00120 _element_group = group;
00121 }
00122
00123
00124
00125 const net_alhem_1_0_server::Security::BasicAuthentication_t& Security::GetBasicAuthentication() const
00126 {
00127 return _element_basicAuthentication;
00128 }
00129
00130
00131 net_alhem_1_0_server::Security::BasicAuthentication_t& Security::GetBasicAuthentication()
00132 {
00133 return _element_basicAuthentication;
00134 }
00135
00136
00137 void Security::SetBasicAuthentication(const net_alhem_1_0_server::Security::BasicAuthentication_t& basicAuthentication)
00138 {
00139 _element_basicAuthentication = basicAuthentication;
00140 }
00141
00142
00143
00144 const net_alhem_1_0_server::Security::Authorization_t& Security::GetAuthorization() const
00145 {
00146 return _element_authorization;
00147 }
00148
00149
00150 net_alhem_1_0_server::Security::Authorization_t& Security::GetAuthorization()
00151 {
00152 return _element_authorization;
00153 }
00154
00155
00156 void Security::SetAuthorization(const net_alhem_1_0_server::Security::Authorization_t& authorization)
00157 {
00158 _element_authorization = authorization;
00159 }
00160
00161
00162
00163 bool Security::GroupIsSet() const
00164 {
00165 return !_element_group.empty();
00166 }
00167
00168
00169
00170 bool Security::BasicAuthenticationIsSet() const
00171 {
00172 return _element_basicAuthentication.IsSet();
00173 }
00174
00175
00176
00177 bool Security::AuthorizationIsSet() const
00178 {
00179 return _element_authorization.IsSet();
00180 }
00181
00182
00183
00184 Security::Group_t::Group_t()
00185 : _attribute_name_is_set(false)
00186 {
00187 }
00188
00189
00190
00191 Security::Group_t::Group_t(const Xml::XmlNode& it)
00192 : _attribute_name_is_set(false)
00193 {
00194 FromXml(it);
00195 }
00196
00197
00198
00199 void Security::Group_t::FromXml(const Xml::XmlNode& it)
00200 {
00201 SetName(it.GetProperty("name"));
00202 }
00203
00204
00205
00206 const std::string Security::Group_t::ToString(const std::string& name) const
00207 {
00208 std::string r;
00209 if (!name.empty())
00210 r += "<" + name;
00211 r += " name='" + GetName() + "'";
00212 r += ">";
00213 if (!name.empty())
00214 r += "</" + name + ">";
00215 return r;
00216 }
00217
00218
00219
00220 bool Security::Group_t::IsSet() const
00221 {
00222 return NameIsSet();
00223 }
00224
00225
00226
00227 const std::string& Security::Group_t::GetName() const
00228 {
00229 return _attribute_name;
00230 }
00231
00232
00233 void Security::Group_t::SetName(const std::string& name)
00234 {
00235 _attribute_name = name;
00236 _attribute_name_is_set = true;
00237 }
00238
00239
00240
00241 Security::BasicAuthentication_t::BasicAuthentication_t()
00242 : _attribute_name_is_set(false)
00243 {
00244 }
00245
00246
00247
00248 Security::BasicAuthentication_t::BasicAuthentication_t(const Xml::XmlNode& it)
00249 : _attribute_name_is_set(false)
00250 {
00251 FromXml(it);
00252 }
00253
00254
00255
00256 void Security::BasicAuthentication_t::FromXml(const Xml::XmlNode& it)
00257 {
00258 if (!it.Exists("user"))
00259 throw Xml::XmlException("missing required node in element 'basicAuthentication_t': user");
00260 {
00261 Xml::XmlNode n(it, "user");
00262 if (n)
00263 _element_user.FromXml( n );
00264 }
00265 SetName(it.GetProperty("name"));
00266 }
00267
00268
00269
00270 const std::string Security::BasicAuthentication_t::ToString(const std::string& name) const
00271 {
00272 std::string r;
00273 if (!name.empty())
00274 r += "<" + name;
00275 r += " name='" + GetName() + "'";
00276 r += ">";
00277 r += _element_user.ToString("user");
00278 if (!name.empty())
00279 r += "</" + name + ">";
00280 return r;
00281 }
00282
00283
00284
00285 bool Security::BasicAuthentication_t::IsSet() const
00286 {
00287 return UserIsSet() || NameIsSet();
00288 }
00289
00290
00291
00292 const net_alhem_1_0_server::Security::BasicAuthentication_t::User_t& Security::BasicAuthentication_t::GetUser() const
00293 {
00294 return _element_user;
00295 }
00296
00297
00298 net_alhem_1_0_server::Security::BasicAuthentication_t::User_t& Security::BasicAuthentication_t::GetUser()
00299 {
00300 return _element_user;
00301 }
00302
00303
00304 void Security::BasicAuthentication_t::SetUser(const net_alhem_1_0_server::Security::BasicAuthentication_t::User_t& user)
00305 {
00306 _element_user = user;
00307 }
00308
00309
00310
00311 bool Security::BasicAuthentication_t::UserIsSet() const
00312 {
00313 return _element_user.IsSet();
00314 }
00315
00316
00317
00318 const std::string& Security::BasicAuthentication_t::GetName() const
00319 {
00320 return _attribute_name;
00321 }
00322
00323
00324 void Security::BasicAuthentication_t::SetName(const std::string& name)
00325 {
00326 _attribute_name = name;
00327 _attribute_name_is_set = true;
00328 }
00329
00330
00331
00332 Security::BasicAuthentication_t::User_t::User_t()
00333 : _attribute_login_is_set(false)
00334 , _attribute_auth_is_set(false)
00335 , _attribute_name_is_set(false)
00336 , _attribute_groups_is_set(false)
00337 {
00338 }
00339
00340
00341
00342 Security::BasicAuthentication_t::User_t::User_t(const Xml::XmlNode& it)
00343 : _attribute_login_is_set(false)
00344 , _attribute_auth_is_set(false)
00345 , _attribute_name_is_set(false)
00346 , _attribute_groups_is_set(false)
00347 {
00348 FromXml(it);
00349 }
00350
00351
00352
00353 void Security::BasicAuthentication_t::User_t::FromXml(const Xml::XmlNode& it)
00354 {
00355 SetLogin(it.GetProperty("login"));
00356 SetAuth(it.GetProperty("auth"));
00357 SetName(it.GetProperty("name"));
00358 SetGroups(it.GetProperty("groups"));
00359 }
00360
00361
00362
00363 const std::string Security::BasicAuthentication_t::User_t::ToString(const std::string& name) const
00364 {
00365 std::string r;
00366 if (!name.empty())
00367 r += "<" + name;
00368 r += " login='" + GetLogin() + "'";
00369 r += " auth='" + GetAuth() + "'";
00370 r += " name='" + GetName() + "'";
00371 r += " groups='" + GetGroups() + "'";
00372 r += ">";
00373 if (!name.empty())
00374 r += "</" + name + ">";
00375 return r;
00376 }
00377
00378
00379
00380 bool Security::BasicAuthentication_t::User_t::IsSet() const
00381 {
00382 return LoginIsSet() || AuthIsSet() || NameIsSet() || GroupsIsSet();
00383 }
00384
00385
00386
00387 const std::string& Security::BasicAuthentication_t::User_t::GetLogin() const
00388 {
00389 return _attribute_login;
00390 }
00391
00392
00393 void Security::BasicAuthentication_t::User_t::SetLogin(const std::string& login)
00394 {
00395 _attribute_login = login;
00396 _attribute_login_is_set = true;
00397 }
00398
00399
00400
00401 const std::string& Security::BasicAuthentication_t::User_t::GetAuth() const
00402 {
00403 return _attribute_auth;
00404 }
00405
00406
00407 void Security::BasicAuthentication_t::User_t::SetAuth(const std::string& auth)
00408 {
00409 _attribute_auth = auth;
00410 _attribute_auth_is_set = true;
00411 }
00412
00413
00414
00415 const std::string& Security::BasicAuthentication_t::User_t::GetName() const
00416 {
00417 return _attribute_name;
00418 }
00419
00420
00421 void Security::BasicAuthentication_t::User_t::SetName(const std::string& name)
00422 {
00423 _attribute_name = name;
00424 _attribute_name_is_set = true;
00425 }
00426
00427
00428
00429 const std::string& Security::BasicAuthentication_t::User_t::GetGroups() const
00430 {
00431 return _attribute_groups;
00432 }
00433
00434
00435 void Security::BasicAuthentication_t::User_t::SetGroups(const std::string& groups)
00436 {
00437 _attribute_groups = groups;
00438 _attribute_groups_is_set = true;
00439 }
00440
00441
00442
00443 Security::Authorization_t::Authorization_t()
00444 : _attribute_name_is_set(false)
00445 , _attribute_level_is_set(false)
00446 {
00447 }
00448
00449
00450
00451 Security::Authorization_t::Authorization_t(const Xml::XmlNode& it)
00452 : _attribute_name_is_set(false)
00453 , _attribute_level_is_set(false)
00454 {
00455 FromXml(it);
00456 }
00457
00458
00459
00460 void Security::Authorization_t::FromXml(const Xml::XmlNode& it)
00461 {
00462 {
00463 Xml::XmlNode n(it, "group");
00464 while (n)
00465 {
00466 _element_group.push_back( n.GetContent() );
00467 ++n;
00468 }
00469 }
00470 {
00471 Xml::XmlNode n(it, "user");
00472 while (n)
00473 {
00474 _element_user.push_back( n.GetContent() );
00475 ++n;
00476 }
00477 }
00478 SetName(it.GetProperty("name"));
00479 SetLevel(it.GetProperty("level"));
00480 }
00481
00482
00483
00484 const std::string Security::Authorization_t::ToString(const std::string& name) const
00485 {
00486 std::string r;
00487 if (!name.empty())
00488 r += "<" + name;
00489 r += " name='" + GetName() + "'";
00490 r += " level='" + GetLevel() + "'";
00491 r += ">";
00492 for (std::list<std::string>::const_iterator it = _element_group.begin(); it != _element_group.end(); it++)
00493 {
00494 r += "<group>" + *it + "</group>";
00495 }
00496 for (std::list<std::string>::const_iterator it = _element_user.begin(); it != _element_user.end(); it++)
00497 {
00498 r += "<user>" + *it + "</user>";
00499 }
00500 if (!name.empty())
00501 r += "</" + name + ">";
00502 return r;
00503 }
00504
00505
00506
00507 bool Security::Authorization_t::IsSet() const
00508 {
00509 return GroupIsSet() || UserIsSet() || NameIsSet() || LevelIsSet();
00510 }
00511
00512
00513
00514 const std::list<std::string>& Security::Authorization_t::GetGroup() const
00515 {
00516 return _element_group;
00517 }
00518
00519
00520 std::list<std::string>& Security::Authorization_t::GetGroup()
00521 {
00522 return _element_group;
00523 }
00524
00525
00526 void Security::Authorization_t::SetGroup(const std::list<std::string>& group)
00527 {
00528 _element_group = group;
00529 }
00530
00531
00532
00533 const std::list<std::string>& Security::Authorization_t::GetUser() const
00534 {
00535 return _element_user;
00536 }
00537
00538
00539 std::list<std::string>& Security::Authorization_t::GetUser()
00540 {
00541 return _element_user;
00542 }
00543
00544
00545 void Security::Authorization_t::SetUser(const std::list<std::string>& user)
00546 {
00547 _element_user = user;
00548 }
00549
00550
00551
00552 bool Security::Authorization_t::GroupIsSet() const
00553 {
00554 return !_element_group.empty();
00555 }
00556
00557
00558
00559 bool Security::Authorization_t::UserIsSet() const
00560 {
00561 return !_element_user.empty();
00562 }
00563
00564
00565
00566 const std::string& Security::Authorization_t::GetName() const
00567 {
00568 return _attribute_name;
00569 }
00570
00571
00572 void Security::Authorization_t::SetName(const std::string& name)
00573 {
00574 _attribute_name = name;
00575 _attribute_name_is_set = true;
00576 }
00577
00578
00579
00580 const std::string& Security::Authorization_t::GetLevel() const
00581 {
00582 return _attribute_level;
00583 }
00584
00585
00586 void Security::Authorization_t::SetLevel(const std::string& level)
00587 {
00588 _attribute_level = level;
00589 _attribute_level_is_set = true;
00590 }
00591
00592
00593
00594 Log::Log()
00595 : _attribute_filename_is_set(false)
00596 , _attribute_type_is_set(false)
00597 , _attribute_format_is_set(false)
00598 {
00599 }
00600
00601
00602
00603 Log::Log(const Xml::XmlNode& it)
00604 : _attribute_filename_is_set(false)
00605 , _attribute_type_is_set(false)
00606 , _attribute_format_is_set(false)
00607 {
00608 FromXml(it);
00609 }
00610
00611
00612
00613 void Log::FromXml(const Xml::XmlNode& it)
00614 {
00615 SetFilename(it.GetProperty("filename"));
00616 SetType(it.GetProperty("type"));
00617 if (it.PropertyExists("format"))
00618 SetFormat(it.GetProperty("format"));
00619 }
00620
00621
00622
00623 const std::string Log::ToString(const std::string& name) const
00624 {
00625 std::string r;
00626 if (!name.empty())
00627 r += "<" + name;
00628 r += " filename='" + GetFilename() + "'";
00629 r += " type='" + GetType() + "'";
00630 if (FormatIsSet())
00631 r += " format='" + GetFormat() + "'";
00632 r += ">";
00633 if (!name.empty())
00634 r += "</" + name + ">";
00635 return r;
00636 }
00637
00638
00639
00640 bool Log::IsSet() const
00641 {
00642 return FilenameIsSet() || TypeIsSet() || FormatIsSet();
00643 }
00644
00645
00646
00647 const std::string& Log::GetFilename() const
00648 {
00649 return _attribute_filename;
00650 }
00651
00652
00653 void Log::SetFilename(const std::string& filename)
00654 {
00655 _attribute_filename = filename;
00656 _attribute_filename_is_set = true;
00657 }
00658
00659
00660
00661 const std::string& Log::GetType() const
00662 {
00663 return _attribute_type;
00664 }
00665
00666
00667 void Log::SetType(const std::string& type)
00668 {
00669 _attribute_type = type;
00670 _attribute_type_is_set = true;
00671 }
00672
00673
00674
00675 const std::string& Log::GetFormat() const
00676 {
00677 return _attribute_format;
00678 }
00679
00680
00681 void Log::SetFormat(const std::string& format)
00682 {
00683 _attribute_format = format;
00684 _attribute_format_is_set = true;
00685 }
00686
00687
00688
00689 Hosts::Hosts()
00690 {
00691 }
00692
00693
00694
00695 Hosts::Hosts(const Xml::XmlNode& it)
00696 {
00697 FromXml(it);
00698 }
00699
00700
00701
00702 void Hosts::FromXml(const Xml::XmlNode& it)
00703 {
00704 if (!it.Exists("hostDefaults"))
00705 throw Xml::XmlException("missing required node in element 'hosts': hostDefaults");
00706 {
00707 Xml::XmlNode n(it, "hostDefaults");
00708 if (n)
00709 _element_hostDefaults.FromXml( n );
00710 }
00711 {
00712 Xml::XmlNode n(it, "host");
00713 while (n)
00714 {
00715 net_alhem_1_0_server::Hosts::Host_t tmp(n);
00716 _element_host.push_back( tmp );
00717 ++n;
00718 }
00719 }
00720 if (!it.Exists("defaultHost"))
00721 throw Xml::XmlException("missing required node in element 'hosts': defaultHost");
00722 {
00723 Xml::XmlNode n(it, "defaultHost");
00724 if (n)
00725 _element_defaultHost.FromXml( n );
00726 }
00727 if (!it.Exists("extendLog"))
00728 throw Xml::XmlException("missing required node in element 'hosts': extendLog");
00729 {
00730 Xml::XmlNode n(it, "extendLog");
00731 if (n)
00732 _element_extendLog.FromXml( n );
00733 }
00734 }
00735
00736
00737
00738 const std::string Hosts::ToString(const std::string& name) const
00739 {
00740 std::string r;
00741 if (!name.empty())
00742 r += "<" + name + ">";
00743 r += _element_hostDefaults.ToString("hostDefaults");
00744 for (std::list<net_alhem_1_0_server::Hosts::Host_t>::const_iterator it = _element_host.begin(); it != _element_host.end(); it++)
00745 {
00746 const net_alhem_1_0_server::Hosts::Host_t& ref = *it;
00747 r += ref.ToString("host");
00748 }
00749 r += _element_defaultHost.ToString("defaultHost");
00750 r += _element_extendLog.ToString("extendLog");
00751 if (!name.empty())
00752 r += "</" + name + ">";
00753 return r;
00754 }
00755
00756
00757
00758 bool Hosts::IsSet() const
00759 {
00760 return HostDefaultsIsSet() || HostIsSet() || DefaultHostIsSet() || ExtendLogIsSet();
00761 }
00762
00763
00764
00765 const net_alhem_1_0_server::Hosts::HostDefaults_t& Hosts::GetHostDefaults() const
00766 {
00767 return _element_hostDefaults;
00768 }
00769
00770
00771 net_alhem_1_0_server::Hosts::HostDefaults_t& Hosts::GetHostDefaults()
00772 {
00773 return _element_hostDefaults;
00774 }
00775
00776
00777 void Hosts::SetHostDefaults(const net_alhem_1_0_server::Hosts::HostDefaults_t& hostDefaults)
00778 {
00779 _element_hostDefaults = hostDefaults;
00780 }
00781
00782
00783
00784 const std::list<net_alhem_1_0_server::Hosts::Host_t>& Hosts::GetHost() const
00785 {
00786 return _element_host;
00787 }
00788
00789
00790 std::list<net_alhem_1_0_server::Hosts::Host_t>& Hosts::GetHost()
00791 {
00792 return _element_host;
00793 }
00794
00795
00796 void Hosts::SetHost(const std::list<net_alhem_1_0_server::Hosts::Host_t>& host)
00797 {
00798 _element_host = host;
00799 }
00800
00801
00802
00803 const net_alhem_1_0_server::Hosts::DefaultHost_t& Hosts::GetDefaultHost() const
00804 {
00805 return _element_defaultHost;
00806 }
00807
00808
00809 net_alhem_1_0_server::Hosts::DefaultHost_t& Hosts::GetDefaultHost()
00810 {
00811 return _element_defaultHost;
00812 }
00813
00814
00815 void Hosts::SetDefaultHost(const net_alhem_1_0_server::Hosts::DefaultHost_t& defaultHost)
00816 {
00817 _element_defaultHost = defaultHost;
00818 }
00819
00820
00821
00822 const net_alhem_1_0_server::Hosts::ExtendLog_t& Hosts::GetExtendLog() const
00823 {
00824 return _element_extendLog;
00825 }
00826
00827
00828 net_alhem_1_0_server::Hosts::ExtendLog_t& Hosts::GetExtendLog()
00829 {
00830 return _element_extendLog;
00831 }
00832
00833
00834 void Hosts::SetExtendLog(const net_alhem_1_0_server::Hosts::ExtendLog_t& extendLog)
00835 {
00836 _element_extendLog = extendLog;
00837 }
00838
00839
00840
00841 bool Hosts::HostDefaultsIsSet() const
00842 {
00843 return _element_hostDefaults.IsSet();
00844 }
00845
00846
00847
00848 bool Hosts::HostIsSet() const
00849 {
00850 return !_element_host.empty();
00851 }
00852
00853
00854
00855 bool Hosts::DefaultHostIsSet() const
00856 {
00857 return _element_defaultHost.IsSet();
00858 }
00859
00860
00861
00862 bool Hosts::ExtendLogIsSet() const
00863 {
00864 return _element_extendLog.IsSet();
00865 }
00866
00867
00868
00869 Hosts::HostDefaults_t::HostDefaults_t()
00870 : _element_documents_is_set(false)
00871 , _element_scripts_is_set(false)
00872 , _element_logs_is_set(false)
00873 , _element_indexDocument_is_set(false)
00874 {
00875 }
00876
00877
00878
00879 Hosts::HostDefaults_t::HostDefaults_t(const Xml::XmlNode& it)
00880 : _element_documents_is_set(false)
00881 , _element_scripts_is_set(false)
00882 , _element_logs_is_set(false)
00883 , _element_indexDocument_is_set(false)
00884 {
00885 FromXml(it);
00886 }
00887
00888
00889
00890 void Hosts::HostDefaults_t::FromXml(const Xml::XmlNode& it)
00891 {
00892 if (it.Exists("documents"))
00893 SetDocuments( it["documents"] );
00894 if (it.Exists("scripts"))
00895 SetScripts( it["scripts"] );
00896 if (it.Exists("logs"))
00897 SetLogs( it["logs"] );
00898 if (it.Exists("indexDocument"))
00899 SetIndexDocument( it["indexDocument"] );
00900 {
00901 Xml::XmlNode n(it, "log");
00902 while (n)
00903 {
00904 net_alhem_1_0_server::Log tmp(n);
00905 _element_log.push_back( tmp );
00906 ++n;
00907 }
00908 }
00909 }
00910
00911
00912
00913 const std::string Hosts::HostDefaults_t::ToString(const std::string& name) const
00914 {
00915 std::string r;
00916 if (!name.empty())
00917 r += "<" + name + ">";
00918 if (_element_documents_is_set)
00919 r += "<documents>" + _element_documents + "</documents>";
00920 if (_element_scripts_is_set)
00921 r += "<scripts>" + _element_scripts + "</scripts>";
00922 if (_element_logs_is_set)
00923 r += "<logs>" + _element_logs + "</logs>";
00924 if (_element_indexDocument_is_set)
00925 r += "<indexDocument>" + _element_indexDocument + "</indexDocument>";
00926 for (std::list<net_alhem_1_0_server::Log>::const_iterator it = _element_log.begin(); it != _element_log.end(); it++)
00927 {
00928 const net_alhem_1_0_server::Log& ref = *it;
00929 r += ref.ToString("log");
00930 }
00931 if (!name.empty())
00932 r += "</" + name + ">";
00933 return r;
00934 }
00935
00936
00937
00938 bool Hosts::HostDefaults_t::IsSet() const
00939 {
00940 return DocumentsIsSet() || ScriptsIsSet() || LogsIsSet() || IndexDocumentIsSet() || LogIsSet();
00941 }
00942
00943
00944
00945 const std::string& Hosts::HostDefaults_t::GetDocuments() const
00946 {
00947 return _element_documents;
00948 }
00949
00950
00951 void Hosts::HostDefaults_t::SetDocuments(const std::string& documents)
00952 {
00953 _element_documents = documents;
00954 _element_documents_is_set = true;
00955 }
00956
00957
00958
00959 const std::string& Hosts::HostDefaults_t::GetScripts() const
00960 {
00961 return _element_scripts;
00962 }
00963
00964
00965 void Hosts::HostDefaults_t::SetScripts(const std::string& scripts)
00966 {
00967 _element_scripts = scripts;
00968 _element_scripts_is_set = true;
00969 }
00970
00971
00972
00973 const std::string& Hosts::HostDefaults_t::GetLogs() const
00974 {
00975 return _element_logs;
00976 }
00977
00978
00979 void Hosts::HostDefaults_t::SetLogs(const std::string& logs)
00980 {
00981 _element_logs = logs;
00982 _element_logs_is_set = true;
00983 }
00984
00985
00986
00987 const std::string& Hosts::HostDefaults_t::GetIndexDocument() const
00988 {
00989 return _element_indexDocument;
00990 }
00991
00992
00993 void Hosts::HostDefaults_t::SetIndexDocument(const std::string& indexDocument)
00994 {
00995 _element_indexDocument = indexDocument;
00996 _element_indexDocument_is_set = true;
00997 }
00998
00999
01000
01001 const std::list<net_alhem_1_0_server::Log>& Hosts::HostDefaults_t::GetLog() const
01002 {
01003 return _element_log;
01004 }
01005
01006
01007 std::list<net_alhem_1_0_server::Log>& Hosts::HostDefaults_t::GetLog()
01008 {
01009 return _element_log;
01010 }
01011
01012
01013 void Hosts::HostDefaults_t::SetLog(const std::list<net_alhem_1_0_server::Log>& log)
01014 {
01015 _element_log = log;
01016 }
01017
01018
01019
01020 bool Hosts::HostDefaults_t::LogIsSet() const
01021 {
01022 return !_element_log.empty();
01023 }
01024
01025
01026
01027 Hosts::Host_t::Host_t()
01028 : _element_documents_is_set(false)
01029 , _element_scripts_is_set(false)
01030 , _element_logs_is_set(false)
01031 , _element_indexDocument_is_set(false)
01032 , _element_pre_is_set(false)
01033 , _attribute_name_is_set(false)
01034 , _attribute_rootDir_is_set(false)
01035 {
01036 }
01037
01038
01039
01040 Hosts::Host_t::Host_t(const Xml::XmlNode& it)
01041 : _element_documents_is_set(false)
01042 , _element_scripts_is_set(false)
01043 , _element_logs_is_set(false)
01044 , _element_indexDocument_is_set(false)
01045 , _element_pre_is_set(false)
01046 , _attribute_name_is_set(false)
01047 , _attribute_rootDir_is_set(false)
01048 {
01049 FromXml(it);
01050 }
01051
01052
01053
01054 void Hosts::Host_t::FromXml(const Xml::XmlNode& it)
01055 {
01056 if (it.Exists("documents"))
01057 SetDocuments( it["documents"] );
01058 if (it.Exists("scripts"))
01059 SetScripts( it["scripts"] );
01060 if (it.Exists("logs"))
01061 SetLogs( it["logs"] );
01062 if (it.Exists("indexDocument"))
01063 SetIndexDocument( it["indexDocument"] );
01064 {
01065 Xml::XmlNode n(it, "log");
01066 while (n)
01067 {
01068 net_alhem_1_0_server::Log tmp(n);
01069 _element_log.push_back( tmp );
01070 ++n;
01071 }
01072 }
01073 {
01074 Xml::XmlNode n(it, "alias");
01075 if (n)
01076 _element_alias.FromXml( n );
01077 }
01078 {
01079 Xml::XmlNode n(it, "ssl");
01080 if (n)
01081 _element_ssl.FromXml( n );
01082 }
01083 if (it.Exists("pre"))
01084 SetPre( it["pre"] );
01085 {
01086 Xml::XmlNode n(it, "mount");
01087 while (n)
01088 {
01089 net_alhem_1_0_server::Hosts::Host_t::Mount_t tmp(n);
01090 _element_mount.push_back( tmp );
01091 ++n;
01092 }
01093 }
01094 {
01095 Xml::XmlNode n(it, "secure");
01096 while (n)
01097 {
01098 net_alhem_1_0_server::Hosts::Host_t::Secure_t tmp(n);
01099 _element_secure.push_back( tmp );
01100 ++n;
01101 }
01102 }
01103 SetName(it.GetProperty("name"));
01104 SetRootDir(it.GetProperty("rootDir"));
01105 }
01106
01107
01108
01109 const std::string Hosts::Host_t::ToString(const std::string& name) const
01110 {
01111 std::string r;
01112 if (!name.empty())
01113 r += "<" + name;
01114 r += " name='" + GetName() + "'";
01115 r += " rootDir='" + GetRootDir() + "'";
01116 r += ">";
01117 if (_element_documents_is_set)
01118 r += "<documents>" + _element_documents + "</documents>";
01119 if (_element_scripts_is_set)
01120 r += "<scripts>" + _element_scripts + "</scripts>";
01121 if (_element_logs_is_set)
01122 r += "<logs>" + _element_logs + "</logs>";
01123 if (_element_indexDocument_is_set)
01124 r += "<indexDocument>" + _element_indexDocument + "</indexDocument>";
01125 for (std::list<net_alhem_1_0_server::Log>::const_iterator it = _element_log.begin(); it != _element_log.end(); it++)
01126 {
01127 const net_alhem_1_0_server::Log& ref = *it;
01128 r += ref.ToString("log");
01129 }
01130 r += _element_alias.ToString("alias");
01131 r += _element_ssl.ToString("ssl");
01132 if (_element_pre_is_set)
01133 r += "<pre>" + _element_pre + "</pre>";
01134 for (std::list<net_alhem_1_0_server::Hosts::Host_t::Mount_t>::const_iterator it = _element_mount.begin(); it != _element_mount.end(); it++)
01135 {
01136 const net_alhem_1_0_server::Hosts::Host_t::Mount_t& ref = *it;
01137 r += ref.ToString("mount");
01138 }
01139 for (std::list<net_alhem_1_0_server::Hosts::Host_t::Secure_t>::const_iterator it = _element_secure.begin(); it != _element_secure.end(); it++)
01140 {
01141 const net_alhem_1_0_server::Hosts::Host_t::Secure_t& ref = *it;
01142 r += ref.ToString("secure");
01143 }
01144 if (!name.empty())
01145 r += "</" + name + ">";
01146 return r;
01147 }
01148
01149
01150
01151 bool Hosts::Host_t::IsSet() const
01152 {
01153 return DocumentsIsSet() || ScriptsIsSet() || LogsIsSet() || IndexDocumentIsSet() || LogIsSet() || AliasIsSet() || SslIsSet() || PreIsSet() || MountIsSet() || SecureIsSet() || NameIsSet() || RootDirIsSet();
01154 }
01155
01156
01157
01158 const std::string& Hosts::Host_t::GetDocuments() const
01159 {
01160 return _element_documents;
01161 }
01162
01163
01164 void Hosts::Host_t::SetDocuments(const std::string& documents)
01165 {
01166 _element_documents = documents;
01167 _element_documents_is_set = true;
01168 }
01169
01170
01171
01172 const std::string& Hosts::Host_t::GetScripts() const
01173 {
01174 return _element_scripts;
01175 }
01176
01177
01178 void Hosts::Host_t::SetScripts(const std::string& scripts)
01179 {
01180 _element_scripts = scripts;
01181 _element_scripts_is_set = true;
01182 }
01183
01184
01185
01186 const std::string& Hosts::Host_t::GetLogs() const
01187 {
01188 return _element_logs;
01189 }
01190
01191
01192 void Hosts::Host_t::SetLogs(const std::string& logs)
01193 {
01194 _element_logs = logs;
01195 _element_logs_is_set = true;
01196 }
01197
01198
01199
01200 const std::string& Hosts::Host_t::GetIndexDocument() const
01201 {
01202 return _element_indexDocument;
01203 }
01204
01205
01206 void Hosts::Host_t::SetIndexDocument(const std::string& indexDocument)
01207 {
01208 _element_indexDocument = indexDocument;
01209 _element_indexDocument_is_set = true;
01210 }
01211
01212
01213
01214 const std::list<net_alhem_1_0_server::Log>& Hosts::Host_t::GetLog() const
01215 {
01216 return _element_log;
01217 }
01218
01219
01220 std::list<net_alhem_1_0_server::Log>& Hosts::Host_t::GetLog()
01221 {
01222 return _element_log;
01223 }
01224
01225
01226 void Hosts::Host_t::SetLog(const std::list<net_alhem_1_0_server::Log>& log)
01227 {
01228 _element_log = log;
01229 }
01230
01231
01232
01233 const net_alhem_1_0_server::Hosts::Host_t::Alias_t& Hosts::Host_t::GetAlias() const
01234 {
01235 return _element_alias;
01236 }
01237
01238
01239 net_alhem_1_0_server::Hosts::Host_t::Alias_t& Hosts::Host_t::GetAlias()
01240 {
01241 return _element_alias;
01242 }
01243
01244
01245 void Hosts::Host_t::SetAlias(const net_alhem_1_0_server::Hosts::Host_t::Alias_t& alias)
01246 {
01247 _element_alias = alias;
01248 }
01249
01250
01251
01252 const net_alhem_1_0_server::Hosts::Host_t::Ssl_t& Hosts::Host_t::GetSsl() const
01253 {
01254 return _element_ssl;
01255 }
01256
01257
01258 net_alhem_1_0_server::Hosts::Host_t::Ssl_t& Hosts::Host_t::GetSsl()
01259 {
01260 return _element_ssl;
01261 }
01262
01263
01264 void Hosts::Host_t::SetSsl(const net_alhem_1_0_server::Hosts::Host_t::Ssl_t& ssl)
01265 {
01266 _element_ssl = ssl;
01267 }
01268
01269
01270
01271 const std::string& Hosts::Host_t::GetPre() const
01272 {
01273 return _element_pre;
01274 }
01275
01276
01277 void Hosts::Host_t::SetPre(const std::string& pre)
01278 {
01279 _element_pre = pre;
01280 _element_pre_is_set = true;
01281 }
01282
01283
01284
01285 const std::list<net_alhem_1_0_server::Hosts::Host_t::Mount_t>& Hosts::Host_t::GetMount() const
01286 {
01287 return _element_mount;
01288 }
01289
01290
01291 std::list<net_alhem_1_0_server::Hosts::Host_t::Mount_t>& Hosts::Host_t::GetMount()
01292 {
01293 return _element_mount;
01294 }
01295
01296
01297 void Hosts::Host_t::SetMount(const std::list<net_alhem_1_0_server::Hosts::Host_t::Mount_t>& mount)
01298 {
01299 _element_mount = mount;
01300 }
01301
01302
01303
01304 const std::list<net_alhem_1_0_server::Hosts::Host_t::Secure_t>& Hosts::Host_t::GetSecure() const
01305 {
01306 return _element_secure;
01307 }
01308
01309
01310 std::list<net_alhem_1_0_server::Hosts::Host_t::Secure_t>& Hosts::Host_t::GetSecure()
01311 {
01312 return _element_secure;
01313 }
01314
01315
01316 void Hosts::Host_t::SetSecure(const std::list<net_alhem_1_0_server::Hosts::Host_t::Secure_t>& secure)
01317 {
01318 _element_secure = secure;
01319 }
01320
01321
01322
01323 bool Hosts::Host_t::LogIsSet() const
01324 {
01325 return !_element_log.empty();
01326 }
01327
01328
01329
01330 bool Hosts::Host_t::AliasIsSet() const
01331 {
01332 return _element_alias.IsSet();
01333 }
01334
01335
01336
01337 bool Hosts::Host_t::SslIsSet() const
01338 {
01339 return _element_ssl.IsSet();
01340 }
01341
01342
01343
01344 bool Hosts::Host_t::MountIsSet() const
01345 {
01346 return !_element_mount.empty();
01347 }
01348
01349
01350
01351 bool Hosts::Host_t::SecureIsSet() const
01352 {
01353 return !_element_secure.empty();
01354 }
01355
01356
01357
01358 const std::string& Hosts::Host_t::GetName() const
01359 {
01360 return _attribute_name;
01361 }
01362
01363
01364 void Hosts::Host_t::SetName(const std::string& name)
01365 {
01366 _attribute_name = name;
01367 _attribute_name_is_set = true;
01368 }
01369
01370
01371
01372 const std::string& Hosts::Host_t::GetRootDir() const
01373 {
01374 return _attribute_rootDir;
01375 }
01376
01377
01378 void Hosts::Host_t::SetRootDir(const std::string& rootDir)
01379 {
01380 _attribute_rootDir = rootDir;
01381 _attribute_rootDir_is_set = true;
01382 }
01383
01384
01385
01386 Hosts::Host_t::Alias_t::Alias_t()
01387 : _attribute_name_is_set(false)
01388 , _attribute_redirect_is_set(false)
01389 {
01390 }
01391
01392
01393
01394 Hosts::Host_t::Alias_t::Alias_t(const Xml::XmlNode& it)
01395 : _attribute_name_is_set(false)
01396 , _attribute_redirect_is_set(false)
01397 {
01398 FromXml(it);
01399 }
01400
01401
01402
01403 void Hosts::Host_t::Alias_t::FromXml(const Xml::XmlNode& it)
01404 {
01405 SetName(it.GetProperty("name"));
01406 SetRedirect(it.GetProperty("redirect"));
01407 }
01408
01409
01410
01411 const std::string Hosts::Host_t::Alias_t::ToString(const std::string& name) const
01412 {
01413 std::string r;
01414 if (!name.empty())
01415 r += "<" + name;
01416 r += " name='" + GetName() + "'";
01417 r += " redirect='" + GetRedirect() + "'";
01418 r += ">";
01419 if (!name.empty())
01420 r += "</" + name + ">";
01421 return r;
01422 }
01423
01424
01425
01426 bool Hosts::Host_t::Alias_t::IsSet() const
01427 {
01428 return NameIsSet() || RedirectIsSet();
01429 }
01430
01431
01432
01433 const std::string& Hosts::Host_t::Alias_t::GetName() const
01434 {
01435 return _attribute_name;
01436 }
01437
01438
01439 void Hosts::Host_t::Alias_t::SetName(const std::string& name)
01440 {
01441 _attribute_name = name;
01442 _attribute_name_is_set = true;
01443 }
01444
01445
01446
01447 const std::string& Hosts::Host_t::Alias_t::GetRedirect() const
01448 {
01449 return _attribute_redirect;
01450 }
01451
01452
01453 void Hosts::Host_t::Alias_t::SetRedirect(const std::string& redirect)
01454 {
01455 _attribute_redirect = redirect;
01456 _attribute_redirect_is_set = true;
01457 }
01458
01459
01460
01461 Hosts::Host_t::Ssl_t::Ssl_t()
01462 : _element_certFile_is_set(false)
01463 , _element_keyFile_is_set(false)
01464 , _element_keyAuth_is_set(false)
01465 {
01466 }
01467
01468
01469
01470 Hosts::Host_t::Ssl_t::Ssl_t(const Xml::XmlNode& it)
01471 : _element_certFile_is_set(false)
01472 , _element_keyFile_is_set(false)
01473 , _element_keyAuth_is_set(false)
01474 {
01475 FromXml(it);
01476 }
01477
01478
01479
01480 void Hosts::Host_t::Ssl_t::FromXml(const Xml::XmlNode& it)
01481 {
01482 if (!it.Exists("certFile"))
01483 throw Xml::XmlException("missing required node in element 'ssl_t': certFile");
01484 SetCertFile( it["certFile"] );
01485 if (!it.Exists("keyFile"))
01486 throw Xml::XmlException("missing required node in element 'ssl_t': keyFile");
01487 SetKeyFile( it["keyFile"] );
01488 if (!it.Exists("keyAuth"))
01489 throw Xml::XmlException("missing required node in element 'ssl_t': keyAuth");
01490 SetKeyAuth( it["keyAuth"] );
01491 }
01492
01493
01494
01495 const std::string Hosts::Host_t::Ssl_t::ToString(const std::string& name) const
01496 {
01497 std::string r;
01498 if (!name.empty())
01499 r += "<" + name + ">";
01500 r += "<certFile>" + _element_certFile + "</certFile>";
01501 r += "<keyFile>" + _element_keyFile + "</keyFile>";
01502 r += "<keyAuth>" + _element_keyAuth + "</keyAuth>";
01503 if (!name.empty())
01504 r += "</" + name + ">";
01505 return r;
01506 }
01507
01508
01509
01510 bool Hosts::Host_t::Ssl_t::IsSet() const
01511 {
01512 return CertFileIsSet() || KeyFileIsSet() || KeyAuthIsSet();
01513 }
01514
01515
01516
01517 const std::string& Hosts::Host_t::Ssl_t::GetCertFile() const
01518 {
01519 return _element_certFile;
01520 }
01521
01522
01523 void Hosts::Host_t::Ssl_t::SetCertFile(const std::string& certFile)
01524 {
01525 _element_certFile = certFile;
01526 _element_certFile_is_set = true;
01527 }
01528
01529
01530
01531 const std::string& Hosts::Host_t::Ssl_t::GetKeyFile() const
01532 {
01533 return _element_keyFile;
01534 }
01535
01536
01537 void Hosts::Host_t::Ssl_t::SetKeyFile(const std::string& keyFile)
01538 {
01539 _element_keyFile = keyFile;
01540 _element_keyFile_is_set = true;
01541 }
01542
01543
01544
01545 const std::string& Hosts::Host_t::Ssl_t::GetKeyAuth() const
01546 {
01547 return _element_keyAuth;
01548 }
01549
01550
01551 void Hosts::Host_t::Ssl_t::SetKeyAuth(const std::string& keyAuth)
01552 {
01553 _element_keyAuth = keyAuth;
01554 _element_keyAuth_is_set = true;
01555 }
01556
01557
01558
01559 Hosts::Host_t::Mount_t::Mount_t()
01560 : _attribute_uri_is_set(false)
01561 , _attribute_jobber_is_set(false)
01562 , _attribute_strip_is_set(false)
01563 , _attribute_path_is_set(false)
01564 {
01565 }
01566
01567
01568
01569 Hosts::Host_t::Mount_t::Mount_t(const Xml::XmlNode& it)
01570 : _attribute_uri_is_set(false)
01571 , _attribute_jobber_is_set(false)
01572 , _attribute_strip_is_set(false)
01573 , _attribute_path_is_set(false)
01574 {
01575 FromXml(it);
01576 }
01577
01578
01579
01580 void Hosts::Host_t::Mount_t::FromXml(const Xml::XmlNode& it)
01581 {
01582 SetUri(it.GetProperty("uri"));
01583 SetJobber(it.GetProperty("jobber"));
01584 if (it.PropertyExists("strip"))
01585 SetStrip(it.GetProperty("strip"));
01586 if (it.PropertyExists("path"))
01587 SetPath(it.GetProperty("path"));
01588 }
01589
01590
01591
01592 const std::string Hosts::Host_t::Mount_t::ToString(const std::string& name) const
01593 {
01594 std::string r;
01595 if (!name.empty())
01596 r += "<" + name;
01597 r += " uri='" + GetUri() + "'";
01598 r += " jobber='" + GetJobber() + "'";
01599 if (StripIsSet())
01600 r += " strip='" + GetStrip() + "'";
01601 if (PathIsSet())
01602 r += " path='" + GetPath() + "'";
01603 r += ">";
01604 if (!name.empty())
01605 r += "</" + name + ">";
01606 return r;
01607 }
01608
01609
01610
01611 bool Hosts::Host_t::Mount_t::IsSet() const
01612 {
01613 return UriIsSet() || JobberIsSet() || StripIsSet() || PathIsSet();
01614 }
01615
01616
01617
01618 const std::string& Hosts::Host_t::Mount_t::GetUri() const
01619 {
01620 return _attribute_uri;
01621 }
01622
01623
01624 void Hosts::Host_t::Mount_t::SetUri(const std::string& uri)
01625 {
01626 _attribute_uri = uri;
01627 _attribute_uri_is_set = true;
01628 }
01629
01630
01631
01632 const std::string& Hosts::Host_t::Mount_t::GetJobber() const
01633 {
01634 return _attribute_jobber;
01635 }
01636
01637
01638 void Hosts::Host_t::Mount_t::SetJobber(const std::string& jobber)
01639 {
01640 _attribute_jobber = jobber;
01641 _attribute_jobber_is_set = true;
01642 }
01643
01644
01645
01646 const std::string& Hosts::Host_t::Mount_t::GetStrip() const
01647 {
01648 return _attribute_strip;
01649 }
01650
01651
01652 void Hosts::Host_t::Mount_t::SetStrip(const std::string& strip)
01653 {
01654 _attribute_strip = strip;
01655 _attribute_strip_is_set = true;
01656 }
01657
01658
01659
01660 const std::string& Hosts::Host_t::Mount_t::GetPath() const
01661 {
01662 return _attribute_path;
01663 }
01664
01665
01666 void Hosts::Host_t::Mount_t::SetPath(const std::string& path)
01667 {
01668 _attribute_path = path;
01669 _attribute_path_is_set = true;
01670 }
01671
01672
01673
01674 Hosts::Host_t::Secure_t::Secure_t()
01675 : _attribute_uri_is_set(false)
01676 , _attribute_basicAuthentication_is_set(false)
01677 , _attribute_authorization_is_set(false)
01678 {
01679 }
01680
01681
01682
01683 Hosts::Host_t::Secure_t::Secure_t(const Xml::XmlNode& it)
01684 : _attribute_uri_is_set(false)
01685 , _attribute_basicAuthentication_is_set(false)
01686 , _attribute_authorization_is_set(false)
01687 {
01688 FromXml(it);
01689 }
01690
01691
01692
01693 void Hosts::Host_t::Secure_t::FromXml(const Xml::XmlNode& it)
01694 {
01695 SetUri(it.GetProperty("uri"));
01696 if (it.PropertyExists("basicAuthentication"))
01697 SetBasicAuthentication(it.GetProperty("basicAuthentication"));
01698 if (it.PropertyExists("authorization"))
01699 SetAuthorization(it.GetProperty("authorization"));
01700 }
01701
01702
01703
01704 const std::string Hosts::Host_t::Secure_t::ToString(const std::string& name) const
01705 {
01706 std::string r;
01707 if (!name.empty())
01708 r += "<" + name;
01709 r += " uri='" + GetUri() + "'";
01710 if (BasicAuthenticationIsSet())
01711 r += " basicAuthentication='" + GetBasicAuthentication() + "'";
01712 if (AuthorizationIsSet())
01713 r += " authorization='" + GetAuthorization() + "'";
01714 r += ">";
01715 if (!name.empty())
01716 r += "</" + name + ">";
01717 return r;
01718 }
01719
01720
01721
01722 bool Hosts::Host_t::Secure_t::IsSet() const
01723 {
01724 return UriIsSet() || BasicAuthenticationIsSet() || AuthorizationIsSet();
01725 }
01726
01727
01728
01729 const std::string& Hosts::Host_t::Secure_t::GetUri() const
01730 {
01731 return _attribute_uri;
01732 }
01733
01734
01735 void Hosts::Host_t::Secure_t::SetUri(const std::string& uri)
01736 {
01737 _attribute_uri = uri;
01738 _attribute_uri_is_set = true;
01739 }
01740
01741
01742
01743 const std::string& Hosts::Host_t::Secure_t::GetBasicAuthentication() const
01744 {
01745 return _attribute_basicAuthentication;
01746 }
01747
01748
01749 void Hosts::Host_t::Secure_t::SetBasicAuthentication(const std::string& basicAuthentication)
01750 {
01751 _attribute_basicAuthentication = basicAuthentication;
01752 _attribute_basicAuthentication_is_set = true;
01753 }
01754
01755
01756
01757 const std::string& Hosts::Host_t::Secure_t::GetAuthorization() const
01758 {
01759 return _attribute_authorization;
01760 }
01761
01762
01763 void Hosts::Host_t::Secure_t::SetAuthorization(const std::string& authorization)
01764 {
01765 _attribute_authorization = authorization;
01766 _attribute_authorization_is_set = true;
01767 }
01768
01769
01770
01771 Hosts::DefaultHost_t::DefaultHost_t()
01772 : _attribute_redirect(false)
01773 , _attribute_test1("Anders")
01774 , _attribute_test2(12345)
01775 , _attribute_test3(1)
01776 , _attribute_redirect_is_set(false)
01777 , _attribute_test1_is_set(true)
01778 , _attribute_test2_is_set(true)
01779 , _attribute_test3_is_set(true)
01780 {
01781 }
01782
01783
01784
01785 Hosts::DefaultHost_t::DefaultHost_t(const Xml::XmlNode& it)
01786 : _attribute_redirect(false)
01787 , _attribute_test1("Anders")
01788 , _attribute_test2(12345)
01789 , _attribute_test3(1)
01790 , _attribute_redirect_is_set(false)
01791 , _attribute_test1_is_set(true)
01792 , _attribute_test2_is_set(true)
01793 , _attribute_test3_is_set(true)
01794 {
01795 FromXml(it);
01796 }
01797
01798
01799
01800 void Hosts::DefaultHost_t::FromXml(const Xml::XmlNode& it)
01801 {
01802 if (it.PropertyExists("redirect"))
01803 SetRedirect( atoi(it.GetProperty("redirect").c_str()) );
01804 if (it.PropertyExists("test1"))
01805 SetTest1(it.GetProperty("test1"));
01806 if (it.PropertyExists("test2"))
01807 SetTest2( atoi(it.GetProperty("test2").c_str()) );
01808 if (it.PropertyExists("test3"))
01809 SetTest3( atoi(it.GetProperty("test3").c_str()) );
01810 m_mixed_content = it.GetContent();
01811 }
01812
01813
01814
01815 const std::string Hosts::DefaultHost_t::ToString(const std::string& name) const
01816 {
01817 std::string r;
01818 if (!name.empty())
01819 r += "<" + name;
01820 if (RedirectIsSet())
01821 {
01822 r = r + " redirect='" + Utility::l2string(GetRedirect()) + "'";
01823 }
01824 if (Test1IsSet())
01825 r += " test1='" + GetTest1() + "'";
01826 if (Test2IsSet())
01827 {
01828 r = r + " test2='" + Utility::l2string(GetTest2()) + "'";
01829 }
01830 if (Test3IsSet())
01831 {
01832 r = r + " test3='" + Utility::l2string(GetTest3()) + "'";
01833 }
01834 r += ">";
01835 r += m_mixed_content;
01836 if (!name.empty())
01837 r += "</" + name + ">";
01838 return r;
01839 }
01840
01841
01842
01843 bool Hosts::DefaultHost_t::IsSet() const
01844 {
01845 return RedirectIsSet() || Test1IsSet() || Test2IsSet() || Test3IsSet() || !m_mixed_content.empty();
01846 }
01847
01848
01849
01850 bool Hosts::DefaultHost_t::GetRedirect() const
01851 {
01852 return _attribute_redirect;
01853 }
01854
01855
01856 void Hosts::DefaultHost_t::SetRedirect(bool redirect)
01857 {
01858 _attribute_redirect = redirect;
01859 _attribute_redirect_is_set = true;
01860 }
01861
01862
01863
01864 const std::string& Hosts::DefaultHost_t::GetTest1() const
01865 {
01866 return _attribute_test1;
01867 }
01868
01869
01870 void Hosts::DefaultHost_t::SetTest1(const std::string& test1)
01871 {
01872 _attribute_test1 = test1;
01873 _attribute_test1_is_set = true;
01874 }
01875
01876
01877
01878 int Hosts::DefaultHost_t::GetTest2() const
01879 {
01880 return _attribute_test2;
01881 }
01882
01883
01884 void Hosts::DefaultHost_t::SetTest2(int test2)
01885 {
01886 _attribute_test2 = test2;
01887 _attribute_test2_is_set = true;
01888 }
01889
01890
01891
01892 int Hosts::DefaultHost_t::GetTest3() const
01893 {
01894 return _attribute_test3;
01895 }
01896
01897
01898 void Hosts::DefaultHost_t::SetTest3(int test3)
01899 {
01900 _attribute_test3 = test3;
01901 _attribute_test3_is_set = true;
01902 }
01903
01904
01905
01906 const std::string& Hosts::DefaultHost_t::Get() const
01907 {
01908 return m_mixed_content;
01909 }
01910
01911
01912
01913 void Hosts::DefaultHost_t::Set(const std::string& x)
01914 {
01915 m_mixed_content = x;
01916 }
01917
01918
01919
01920 Hosts::ExtendLog_t::ExtendLog_t()
01921 : Log()
01922 , _element_address_is_set(false)
01923 , _element_city_is_set(false)
01924 , _element_country_is_set(false)
01925 {
01926 }
01927
01928
01929
01930 Hosts::ExtendLog_t::ExtendLog_t(const Xml::XmlNode& it)
01931 : Log()
01932 , _element_address_is_set(false)
01933 , _element_city_is_set(false)
01934 , _element_country_is_set(false)
01935 {
01936 FromXml(it);
01937 }
01938
01939
01940
01941 void Hosts::ExtendLog_t::FromXml(const Xml::XmlNode& it)
01942 {
01943 Log::FromXml(it);
01944 if (!it.Exists("address"))
01945 throw Xml::XmlException("missing required node in element 'extendLog_t': address");
01946 SetAddress( it["address"] );
01947 if (!it.Exists("city"))
01948 throw Xml::XmlException("missing required node in element 'extendLog_t': city");
01949 SetCity( it["city"] );
01950 if (!it.Exists("country"))
01951 throw Xml::XmlException("missing required node in element 'extendLog_t': country");
01952 SetCountry( it["country"] );
01953 }
01954
01955
01956
01957 const std::string Hosts::ExtendLog_t::ToString(const std::string& name) const
01958 {
01959 std::string r;
01960 if (!name.empty())
01961 r += "<" + name + ">";
01962 r += Log::ToString();
01963 r += "<address>" + _element_address + "</address>";
01964 r += "<city>" + _element_city + "</city>";
01965 r += "<country>" + _element_country + "</country>";
01966 if (!name.empty())
01967 r += "</" + name + ">";
01968 return r;
01969 }
01970
01971
01972
01973 bool Hosts::ExtendLog_t::IsSet() const
01974 {
01975 return AddressIsSet() || CityIsSet() || CountryIsSet();
01976 }
01977
01978
01979
01980 const std::string& Hosts::ExtendLog_t::GetAddress() const
01981 {
01982 return _element_address;
01983 }
01984
01985
01986 void Hosts::ExtendLog_t::SetAddress(const std::string& address)
01987 {
01988 _element_address = address;
01989 _element_address_is_set = true;
01990 }
01991
01992
01993
01994 const std::string& Hosts::ExtendLog_t::GetCity() const
01995 {
01996 return _element_city;
01997 }
01998
01999
02000 void Hosts::ExtendLog_t::SetCity(const std::string& city)
02001 {
02002 _element_city = city;
02003 _element_city_is_set = true;
02004 }
02005
02006
02007
02008 const std::string& Hosts::ExtendLog_t::GetCountry() const
02009 {
02010 return _element_country;
02011 }
02012
02013
02014 void Hosts::ExtendLog_t::SetCountry(const std::string& country)
02015 {
02016 _element_country = country;
02017 _element_country_is_set = true;
02018 }
02019
02020
02021
02022 Network::Network()
02023 {
02024 }
02025
02026
02027
02028 Network::Network(const Xml::XmlNode& it)
02029 {
02030 FromXml(it);
02031 }
02032
02033
02034
02035 void Network::FromXml(const Xml::XmlNode& it)
02036 {
02037 if (!it.Exists("bind"))
02038 throw Xml::XmlException("missing required node in element 'network': bind");
02039 {
02040 Xml::XmlNode n(it, "bind");
02041 while (n)
02042 {
02043 net_alhem_1_0_server::Network::Bind_t tmp(n);
02044 _element_bind.push_back( tmp );
02045 ++n;
02046 }
02047 }
02048 }
02049
02050
02051
02052 const std::string Network::ToString(const std::string& name) const
02053 {
02054 std::string r;
02055 if (!name.empty())
02056 r += "<" + name + ">";
02057 for (std::list<net_alhem_1_0_server::Network::Bind_t>::const_iterator it = _element_bind.begin(); it != _element_bind.end(); it++)
02058 {
02059 const net_alhem_1_0_server::Network::Bind_t& ref = *it;
02060 r += ref.ToString("bind");
02061 }
02062 if (!name.empty())
02063 r += "</" + name + ">";
02064 return r;
02065 }
02066
02067
02068
02069 bool Network::IsSet() const
02070 {
02071 return BindIsSet();
02072 }
02073
02074
02075
02076 const std::list<net_alhem_1_0_server::Network::Bind_t>& Network::GetBind() const
02077 {
02078 return _element_bind;
02079 }
02080
02081
02082 std::list<net_alhem_1_0_server::Network::Bind_t>& Network::GetBind()
02083 {
02084 return _element_bind;
02085 }
02086
02087
02088 void Network::SetBind(const std::list<net_alhem_1_0_server::Network::Bind_t>& bind)
02089 {
02090 _element_bind = bind;
02091 }
02092
02093
02094
02095 bool Network::BindIsSet() const
02096 {
02097 return !_element_bind.empty();
02098 }
02099
02100
02101
02102 Network::Bind_t::Bind_t()
02103 : _attribute_port(0)
02104 , _attribute_interface_is_set(false)
02105 , _attribute_port_is_set(false)
02106 , _attribute_protocol_is_set(false)
02107 , _attribute_host_is_set(false)
02108 {
02109 }
02110
02111
02112
02113 Network::Bind_t::Bind_t(const Xml::XmlNode& it)
02114 : _attribute_port(0)
02115 , _attribute_interface_is_set(false)
02116 , _attribute_port_is_set(false)
02117 , _attribute_protocol_is_set(false)
02118 , _attribute_host_is_set(false)
02119 {
02120 FromXml(it);
02121 }
02122
02123
02124
02125 void Network::Bind_t::FromXml(const Xml::XmlNode& it)
02126 {
02127 SetInterface(it.GetProperty("interface"));
02128 SetPort( atoi(it.GetProperty("port").c_str()) );
02129 SetProtocol(it.GetProperty("protocol"));
02130 if (it.PropertyExists("host"))
02131 SetHost(it.GetProperty("host"));
02132 }
02133
02134
02135
02136 const std::string Network::Bind_t::ToString(const std::string& name) const
02137 {
02138 std::string r;
02139 if (!name.empty())
02140 r += "<" + name;
02141 r += " interface='" + GetInterface() + "'";
02142 {
02143 r = r + " port='" + Utility::l2string(GetPort()) + "'";
02144 }
02145 r += " protocol='" + GetProtocol() + "'";
02146 if (HostIsSet())
02147 r += " host='" + GetHost() + "'";
02148 r += ">";
02149 if (!name.empty())
02150 r += "</" + name + ">";
02151 return r;
02152 }
02153
02154
02155
02156 bool Network::Bind_t::IsSet() const
02157 {
02158 return InterfaceIsSet() || PortIsSet() || ProtocolIsSet() || HostIsSet();
02159 }
02160
02161
02162
02163 const std::string& Network::Bind_t::GetInterface() const
02164 {
02165 return _attribute_interface;
02166 }
02167
02168
02169 void Network::Bind_t::SetInterface(const std::string& interface)
02170 {
02171 _attribute_interface = interface;
02172 _attribute_interface_is_set = true;
02173 }
02174
02175
02176
02177 int Network::Bind_t::GetPort() const
02178 {
02179 return _attribute_port;
02180 }
02181
02182
02183 void Network::Bind_t::SetPort(int port)
02184 {
02185 _attribute_port = port;
02186 _attribute_port_is_set = true;
02187 }
02188
02189
02190
02191 const std::string& Network::Bind_t::GetProtocol() const
02192 {
02193 return _attribute_protocol;
02194 }
02195
02196
02197 void Network::Bind_t::SetProtocol(const std::string& protocol)
02198 {
02199 _attribute_protocol = protocol;
02200 _attribute_protocol_is_set = true;
02201 }
02202
02203
02204
02205 const std::string& Network::Bind_t::GetHost() const
02206 {
02207 return _attribute_host;
02208 }
02209
02210
02211 void Network::Bind_t::SetHost(const std::string& host)
02212 {
02213 _attribute_host = host;
02214 _attribute_host_is_set = true;
02215 }
02216
02217
02218
02219 Configuration_t::Configuration_t()
02220 : _element_rootDir_is_set(false)
02221 {
02222 }
02223
02224
02225
02226 Configuration_t::Configuration_t(const Xml::XmlNode& it)
02227 : _element_rootDir_is_set(false)
02228 {
02229 FromXml(it);
02230 }
02231
02232
02233
02234 void Configuration_t::FromXml(const Xml::XmlNode& it)
02235 {
02236 if (!it.Exists("rootDir"))
02237 throw Xml::XmlException("missing required node in element 'configuration_t': rootDir");
02238 SetRootDir( it["rootDir"] );
02239 if (!it.Exists("security"))
02240 throw Xml::XmlException("missing required node in element 'configuration_t': security");
02241 {
02242 Xml::XmlNode n(it, "security");
02243 if (n)
02244 _element_security.FromXml( n );
02245 }
02246 if (!it.Exists("hosts"))
02247 throw Xml::XmlException("missing required node in element 'configuration_t': hosts");
02248 {
02249 Xml::XmlNode n(it, "hosts");
02250 if (n)
02251 _element_hosts.FromXml( n );
02252 }
02253 if (!it.Exists("network"))
02254 throw Xml::XmlException("missing required node in element 'configuration_t': network");
02255 {
02256 Xml::XmlNode n(it, "network");
02257 if (n)
02258 _element_network.FromXml( n );
02259 }
02260 if (!it.Exists("network_typ"))
02261 throw Xml::XmlException("missing required node in element 'configuration_t': network_typ");
02262 {
02263 Xml::XmlNode n(it, "network_typ");
02264 if (n)
02265 _element_network_typ.FromXml( n );
02266 }
02267 }
02268
02269
02270
02271 const std::string Configuration_t::ToString(const std::string& name) const
02272 {
02273 std::string r;
02274 if (!name.empty())
02275 r += "<" + name + ">";
02276 r += "<rootDir>" + _element_rootDir + "</rootDir>";
02277 r += _element_security.ToString("security");
02278 r += _element_hosts.ToString("hosts");
02279 r += _element_network.ToString("network");
02280 r += _element_network_typ.ToString("network_typ");
02281 if (!name.empty())
02282 r += "</" + name + ">";
02283 return r;
02284 }
02285
02286
02287
02288 bool Configuration_t::IsSet() const
02289 {
02290 return RootDirIsSet() || SecurityIsSet() || HostsIsSet() || NetworkIsSet() || Network_typIsSet();
02291 }
02292
02293
02294
02295 const std::string& Configuration_t::GetRootDir() const
02296 {
02297 return _element_rootDir;
02298 }
02299
02300
02301 void Configuration_t::SetRootDir(const std::string& rootDir)
02302 {
02303 _element_rootDir = rootDir;
02304 _element_rootDir_is_set = true;
02305 }
02306
02307
02308
02309 const net_alhem_1_0_server::Security& Configuration_t::GetSecurity() const
02310 {
02311 return _element_security;
02312 }
02313
02314
02315 net_alhem_1_0_server::Security& Configuration_t::GetSecurity()
02316 {
02317 return _element_security;
02318 }
02319
02320
02321 void Configuration_t::SetSecurity(const net_alhem_1_0_server::Security& security)
02322 {
02323 _element_security = security;
02324 }
02325
02326
02327
02328 const net_alhem_1_0_server::Hosts& Configuration_t::GetHosts() const
02329 {
02330 return _element_hosts;
02331 }
02332
02333
02334 net_alhem_1_0_server::Hosts& Configuration_t::GetHosts()
02335 {
02336 return _element_hosts;
02337 }
02338
02339
02340 void Configuration_t::SetHosts(const net_alhem_1_0_server::Hosts& hosts)
02341 {
02342 _element_hosts = hosts;
02343 }
02344
02345
02346
02347 const net_alhem_1_0_server::Network& Configuration_t::GetNetwork() const
02348 {
02349 return _element_network;
02350 }
02351
02352
02353 net_alhem_1_0_server::Network& Configuration_t::GetNetwork()
02354 {
02355 return _element_network;
02356 }
02357
02358
02359 void Configuration_t::SetNetwork(const net_alhem_1_0_server::Network& network)
02360 {
02361 _element_network = network;
02362 }
02363
02364
02365
02366 const net_alhem_1_0_server_typ::NetworkTyp& Configuration_t::GetNetwork_typ() const
02367 {
02368 return _element_network_typ;
02369 }
02370
02371
02372 net_alhem_1_0_server_typ::NetworkTyp& Configuration_t::GetNetwork_typ()
02373 {
02374 return _element_network_typ;
02375 }
02376
02377
02378 void Configuration_t::SetNetwork_typ(const net_alhem_1_0_server_typ::NetworkTyp& network_typ)
02379 {
02380 _element_network_typ = network_typ;
02381 }
02382
02383
02384
02385 bool Configuration_t::SecurityIsSet() const
02386 {
02387 return _element_security.IsSet();
02388 }
02389
02390
02391
02392 bool Configuration_t::HostsIsSet() const
02393 {
02394 return _element_hosts.IsSet();
02395 }
02396
02397
02398
02399 bool Configuration_t::NetworkIsSet() const
02400 {
02401 return _element_network.IsSet();
02402 }
02403
02404
02405
02406 bool Configuration_t::Network_typIsSet() const
02407 {
02408 return _element_network_typ.IsSet();
02409 }
02410
02411
02412 }
02413
02415 namespace net_alhem_1_0_server_typ {
02416
02417
02418 LogTyp::LogTyp()
02419 : _attribute_filename_is_set(false)
02420 , _attribute_type_is_set(false)
02421 , _attribute_format_is_set(false)
02422 {
02423 }
02424
02425
02426
02427 LogTyp::LogTyp(const Xml::XmlNode& it)
02428 : _attribute_filename_is_set(false)
02429 , _attribute_type_is_set(false)
02430 , _attribute_format_is_set(false)
02431 {
02432 FromXml(it);
02433 }
02434
02435
02436
02437 void LogTyp::FromXml(const Xml::XmlNode& it)
02438 {
02439 SetFilename(it.GetProperty("filename"));
02440 SetType(it.GetProperty("type"));
02441 if (it.PropertyExists("format"))
02442 SetFormat(it.GetProperty("format"));
02443 }
02444
02445
02446
02447 const std::string LogTyp::ToString(const std::string& name) const
02448 {
02449 std::string r;
02450 if (!name.empty())
02451 r += "<" + name;
02452 r += " filename='" + GetFilename() + "'";
02453 r += " type='" + GetType() + "'";
02454 if (FormatIsSet())
02455 r += " format='" + GetFormat() + "'";
02456 r += ">";
02457 if (!name.empty())
02458 r += "</" + name + ">";
02459 return r;
02460 }
02461
02462
02463
02464 bool LogTyp::IsSet() const
02465 {
02466 return FilenameIsSet() || TypeIsSet() || FormatIsSet();
02467 }
02468
02469
02470
02471 const std::string& LogTyp::GetFilename() const
02472 {
02473 return _attribute_filename;
02474 }
02475
02476
02477 void LogTyp::SetFilename(const std::string& filename)
02478 {
02479 _attribute_filename = filename;
02480 _attribute_filename_is_set = true;
02481 }
02482
02483
02484
02485 const std::string& LogTyp::GetType() const
02486 {
02487 return _attribute_type;
02488 }
02489
02490
02491 void LogTyp::SetType(const std::string& type)
02492 {
02493 _attribute_type = type;
02494 _attribute_type_is_set = true;
02495 }
02496
02497
02498
02499 const std::string& LogTyp::GetFormat() const
02500 {
02501 return _attribute_format;
02502 }
02503
02504
02505 void LogTyp::SetFormat(const std::string& format)
02506 {
02507 _attribute_format = format;
02508 _attribute_format_is_set = true;
02509 }
02510
02511
02512
02513 NetworkTyp::NetworkTyp()
02514 {
02515 }
02516
02517
02518
02519 NetworkTyp::NetworkTyp(const Xml::XmlNode& it)
02520 {
02521 FromXml(it);
02522 }
02523
02524
02525
02526 void NetworkTyp::FromXml(const Xml::XmlNode& it)
02527 {
02528 if (!it.Exists("bind"))
02529 throw Xml::XmlException("missing required node in element 'networkTyp': bind");
02530 {
02531 Xml::XmlNode n(it, "bind");
02532 while (n)
02533 {
02534 net_alhem_1_0_server_typ::NetworkTyp::Bind_t tmp(n);
02535 _element_bind.push_back( tmp );
02536 ++n;
02537 }
02538 }
02539 }
02540
02541
02542
02543 const std::string NetworkTyp::ToString(const std::string& name) const
02544 {
02545 std::string r;
02546 if (!name.empty())
02547 r += "<" + name + ">";
02548 for (std::list<net_alhem_1_0_server_typ::NetworkTyp::Bind_t>::const_iterator it = _element_bind.begin(); it != _element_bind.end(); it++)
02549 {
02550 const net_alhem_1_0_server_typ::NetworkTyp::Bind_t& ref = *it;
02551 r += ref.ToString("bind");
02552 }
02553 if (!name.empty())
02554 r += "</" + name + ">";
02555 return r;
02556 }
02557
02558
02559
02560 bool NetworkTyp::IsSet() const
02561 {
02562 return BindIsSet();
02563 }
02564
02565
02566
02567 const std::list<net_alhem_1_0_server_typ::NetworkTyp::Bind_t>& NetworkTyp::GetBind() const
02568 {
02569 return _element_bind;
02570 }
02571
02572
02573 std::list<net_alhem_1_0_server_typ::NetworkTyp::Bind_t>& NetworkTyp::GetBind()
02574 {
02575 return _element_bind;
02576 }
02577
02578
02579 void NetworkTyp::SetBind(const std::list<net_alhem_1_0_server_typ::NetworkTyp::Bind_t>& bind)
02580 {
02581 _element_bind = bind;
02582 }
02583
02584
02585
02586 bool NetworkTyp::BindIsSet() const
02587 {
02588 return !_element_bind.empty();
02589 }
02590
02591
02592
02593 NetworkTyp::Bind_t::Bind_t()
02594 : _attribute_port(0)
02595 , _attribute_interface_is_set(false)
02596 , _attribute_port_is_set(false)
02597 , _attribute_protocol_is_set(false)
02598 , _attribute_host_is_set(false)
02599 {
02600 }
02601
02602
02603
02604 NetworkTyp::Bind_t::Bind_t(const Xml::XmlNode& it)
02605 : _attribute_port(0)
02606 , _attribute_interface_is_set(false)
02607 , _attribute_port_is_set(false)
02608 , _attribute_protocol_is_set(false)
02609 , _attribute_host_is_set(false)
02610 {
02611 FromXml(it);
02612 }
02613
02614
02615
02616 void NetworkTyp::Bind_t::FromXml(const Xml::XmlNode& it)
02617 {
02618 SetInterface(it.GetProperty("interface"));
02619 SetPort( atoi(it.GetProperty("port").c_str()) );
02620 SetProtocol(it.GetProperty("protocol"));
02621 if (it.PropertyExists("host"))
02622 SetHost(it.GetProperty("host"));
02623 }
02624
02625
02626
02627 const std::string NetworkTyp::Bind_t::ToString(const std::string& name) const
02628 {
02629 std::string r;
02630 if (!name.empty())
02631 r += "<" + name;
02632 r += " interface='" + GetInterface() + "'";
02633 {
02634 r = r + " port='" + Utility::l2string(GetPort()) + "'";
02635 }
02636 r += " protocol='" + GetProtocol() + "'";
02637 if (HostIsSet())
02638 r += " host='" + GetHost() + "'";
02639 r += ">";
02640 if (!name.empty())
02641 r += "</" + name + ">";
02642 return r;
02643 }
02644
02645
02646
02647 bool NetworkTyp::Bind_t::IsSet() const
02648 {
02649 return InterfaceIsSet() || PortIsSet() || ProtocolIsSet() || HostIsSet();
02650 }
02651
02652
02653
02654 const std::string& NetworkTyp::Bind_t::GetInterface() const
02655 {
02656 return _attribute_interface;
02657 }
02658
02659
02660 void NetworkTyp::Bind_t::SetInterface(const std::string& interface)
02661 {
02662 _attribute_interface = interface;
02663 _attribute_interface_is_set = true;
02664 }
02665
02666
02667
02668 int NetworkTyp::Bind_t::GetPort() const
02669 {
02670 return _attribute_port;
02671 }
02672
02673
02674 void NetworkTyp::Bind_t::SetPort(int port)
02675 {
02676 _attribute_port = port;
02677 _attribute_port_is_set = true;
02678 }
02679
02680
02681
02682 const std::string& NetworkTyp::Bind_t::GetProtocol() const
02683 {
02684 return _attribute_protocol;
02685 }
02686
02687
02688 void NetworkTyp::Bind_t::SetProtocol(const std::string& protocol)
02689 {
02690 _attribute_protocol = protocol;
02691 _attribute_protocol_is_set = true;
02692 }
02693
02694
02695
02696 const std::string& NetworkTyp::Bind_t::GetHost() const
02697 {
02698 return _attribute_host;
02699 }
02700
02701
02702 void NetworkTyp::Bind_t::SetHost(const std::string& host)
02703 {
02704 _attribute_host = host;
02705 _attribute_host_is_set = true;
02706 }
02707
02708
02709 }
02710
02712 namespace net_alhem_1_0_typ0 {
02713
02714
02715 Log2::Log2()
02716 : _attribute_filename_is_set(false)
02717 , _attribute_type_is_set(false)
02718 , _attribute_format_is_set(false)
02719 {
02720 }
02721
02722
02723
02724 Log2::Log2(const Xml::XmlNode& it)
02725 : _attribute_filename_is_set(false)
02726 , _attribute_type_is_set(false)
02727 , _attribute_format_is_set(false)
02728 {
02729 FromXml(it);
02730 }
02731
02732
02733
02734 void Log2::FromXml(const Xml::XmlNode& it)
02735 {
02736 SetFilename(it.GetProperty("filename"));
02737 SetType(it.GetProperty("type"));
02738 if (it.PropertyExists("format"))
02739 SetFormat(it.GetProperty("format"));
02740 }
02741
02742
02743
02744 const std::string Log2::ToString(const std::string& name) const
02745 {
02746 std::string r;
02747 if (!name.empty())
02748 r += "<" + name;
02749 r += " filename='" + GetFilename() + "'";
02750 r += " type='" + GetType() + "'";
02751 if (FormatIsSet())
02752 r += " format='" + GetFormat() + "'";
02753 r += ">";
02754 if (!name.empty())
02755 r += "</" + name + ">";
02756 return r;
02757 }
02758
02759
02760
02761 bool Log2::IsSet() const
02762 {
02763 return FilenameIsSet() || TypeIsSet() || FormatIsSet();
02764 }
02765
02766
02767
02768 const std::string& Log2::GetFilename() const
02769 {
02770 return _attribute_filename;
02771 }
02772
02773
02774 void Log2::SetFilename(const std::string& filename)
02775 {
02776 _attribute_filename = filename;
02777 _attribute_filename_is_set = true;
02778 }
02779
02780
02781
02782 const std::string& Log2::GetType() const
02783 {
02784 return _attribute_type;
02785 }
02786
02787
02788 void Log2::SetType(const std::string& type)
02789 {
02790 _attribute_type = type;
02791 _attribute_type_is_set = true;
02792 }
02793
02794
02795
02796 const std::string& Log2::GetFormat() const
02797 {
02798 return _attribute_format;
02799 }
02800
02801
02802 void Log2::SetFormat(const std::string& format)
02803 {
02804 _attribute_format = format;
02805 _attribute_format_is_set = true;
02806 }
02807
02808
02809
02810 Network2::Network2()
02811 {
02812 }
02813
02814
02815
02816 Network2::Network2(const Xml::XmlNode& it)
02817 {
02818 FromXml(it);
02819 }
02820
02821
02822
02823 void Network2::FromXml(const Xml::XmlNode& it)
02824 {
02825 if (!it.Exists("bind"))
02826 throw Xml::XmlException("missing required node in element 'network2': bind");
02827 {
02828 Xml::XmlNode n(it, "bind");
02829 while (n)
02830 {
02831 net_alhem_1_0_typ0::Network2::Bind_t tmp(n);
02832 _element_bind.push_back( tmp );
02833 ++n;
02834 }
02835 }
02836 }
02837
02838
02839
02840 const std::string Network2::ToString(const std::string& name) const
02841 {
02842 std::string r;
02843 if (!name.empty())
02844 r += "<" + name + ">";
02845 for (std::list<net_alhem_1_0_typ0::Network2::Bind_t>::const_iterator it = _element_bind.begin(); it != _element_bind.end(); it++)
02846 {
02847 const net_alhem_1_0_typ0::Network2::Bind_t& ref = *it;
02848 r += ref.ToString("bind");
02849 }
02850 if (!name.empty())
02851 r += "</" + name + ">";
02852 return r;
02853 }
02854
02855
02856
02857 bool Network2::IsSet() const
02858 {
02859 return BindIsSet();
02860 }
02861
02862
02863
02864 const std::list<net_alhem_1_0_typ0::Network2::Bind_t>& Network2::GetBind() const
02865 {
02866 return _element_bind;
02867 }
02868
02869
02870 std::list<net_alhem_1_0_typ0::Network2::Bind_t>& Network2::GetBind()
02871 {
02872 return _element_bind;
02873 }
02874
02875
02876 void Network2::SetBind(const std::list<net_alhem_1_0_typ0::Network2::Bind_t>& bind)
02877 {
02878 _element_bind = bind;
02879 }
02880
02881
02882
02883 bool Network2::BindIsSet() const
02884 {
02885 return !_element_bind.empty();
02886 }
02887
02888
02889
02890 Network2::Bind_t::Bind_t()
02891 : _attribute_port(0)
02892 , _attribute_interface_is_set(false)
02893 , _attribute_port_is_set(false)
02894 , _attribute_protocol_is_set(false)
02895 , _attribute_host_is_set(false)
02896 {
02897 }
02898
02899
02900
02901 Network2::Bind_t::Bind_t(const Xml::XmlNode& it)
02902 : _attribute_port(0)
02903 , _attribute_interface_is_set(false)
02904 , _attribute_port_is_set(false)
02905 , _attribute_protocol_is_set(false)
02906 , _attribute_host_is_set(false)
02907 {
02908 FromXml(it);
02909 }
02910
02911
02912
02913 void Network2::Bind_t::FromXml(const Xml::XmlNode& it)
02914 {
02915 SetInterface(it.GetProperty("interface"));
02916 SetPort( atoi(it.GetProperty("port").c_str()) );
02917 SetProtocol(it.GetProperty("protocol"));
02918 if (it.PropertyExists("host"))
02919 SetHost(it.GetProperty("host"));
02920 }
02921
02922
02923
02924 const std::string Network2::Bind_t::ToString(const std::string& name) const
02925 {
02926 std::string r;
02927 if (!name.empty())
02928 r += "<" + name;
02929 r += " interface='" + GetInterface() + "'";
02930 {
02931 r = r + " port='" + Utility::l2string(GetPort()) + "'";
02932 }
02933 r += " protocol='" + GetProtocol() + "'";
02934 if (HostIsSet())
02935 r += " host='" + GetHost() + "'";
02936 r += ">";
02937 if (!name.empty())
02938 r += "</" + name + ">";
02939 return r;
02940 }
02941
02942
02943
02944 bool Network2::Bind_t::IsSet() const
02945 {
02946 return InterfaceIsSet() || PortIsSet() || ProtocolIsSet() || HostIsSet();
02947 }
02948
02949
02950
02951 const std::string& Network2::Bind_t::GetInterface() const
02952 {
02953 return _attribute_interface;
02954 }
02955
02956
02957 void Network2::Bind_t::SetInterface(const std::string& interface)
02958 {
02959 _attribute_interface = interface;
02960 _attribute_interface_is_set = true;
02961 }
02962
02963
02964
02965 int Network2::Bind_t::GetPort() const
02966 {
02967 return _attribute_port;
02968 }
02969
02970
02971 void Network2::Bind_t::SetPort(int port)
02972 {
02973 _attribute_port = port;
02974 _attribute_port_is_set = true;
02975 }
02976
02977
02978
02979 const std::string& Network2::Bind_t::GetProtocol() const
02980 {
02981 return _attribute_protocol;
02982 }
02983
02984
02985 void Network2::Bind_t::SetProtocol(const std::string& protocol)
02986 {
02987 _attribute_protocol = protocol;
02988 _attribute_protocol_is_set = true;
02989 }
02990
02991
02992
02993 const std::string& Network2::Bind_t::GetHost() const
02994 {
02995 return _attribute_host;
02996 }
02997
02998
02999 void Network2::Bind_t::SetHost(const std::string& host)
03000 {
03001 _attribute_host = host;
03002 _attribute_host_is_set = true;
03003 }
03004
03005
03006 }
03007
03008 }
03009