comparison OrthancFramework/Sources/WebServiceParameters.cpp @ 4300:b30a8de92ad9

abi continued
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 05 Nov 2020 19:33:18 +0100
parents 2bc49197f806
children d9473bd5ed43
comparison
equal deleted inserted replaced
4299:3f85db78c441 4300:b30a8de92ad9
66 pkcs11Enabled_(false) 66 pkcs11Enabled_(false)
67 { 67 {
68 SetUrl("http://127.0.0.1:8042/"); 68 SetUrl("http://127.0.0.1:8042/");
69 } 69 }
70 70
71 WebServiceParameters::WebServiceParameters(const Json::Value &serialized)
72 {
73 Unserialize(serialized);
74 }
75
76 const std::string &WebServiceParameters::GetUrl() const
77 {
78 return url_;
79 }
80
71 81
72 void WebServiceParameters::ClearClientCertificate() 82 void WebServiceParameters::ClearClientCertificate()
73 { 83 {
74 certificateFile_.clear(); 84 certificateFile_.clear();
75 certificateKeyFile_.clear(); 85 certificateKeyFile_.clear();
126 username_ = username; 136 username_ = username;
127 password_ = password; 137 password_ = password;
128 } 138 }
129 } 139 }
130 140
141 const std::string &WebServiceParameters::GetUsername() const
142 {
143 return username_;
144 }
145
146 const std::string &WebServiceParameters::GetPassword() const
147 {
148 return password_;
149 }
150
131 151
132 void WebServiceParameters::SetClientCertificate(const std::string& certificateFile, 152 void WebServiceParameters::SetClientCertificate(const std::string& certificateFile,
133 const std::string& certificateKeyFile, 153 const std::string& certificateKeyFile,
134 const std::string& certificateKeyPassword) 154 const std::string& certificateKeyPassword)
135 { 155 {
144 } 164 }
145 165
146 certificateFile_ = certificateFile; 166 certificateFile_ = certificateFile;
147 certificateKeyFile_ = certificateKeyFile; 167 certificateKeyFile_ = certificateKeyFile;
148 certificateKeyPassword_ = certificateKeyPassword; 168 certificateKeyPassword_ = certificateKeyPassword;
169 }
170
171 const std::string &WebServiceParameters::GetCertificateFile() const
172 {
173 return certificateFile_;
174 }
175
176 const std::string &WebServiceParameters::GetCertificateKeyFile() const
177 {
178 return certificateKeyFile_;
179 }
180
181 const std::string &WebServiceParameters::GetCertificateKeyPassword() const
182 {
183 return certificateKeyPassword_;
184 }
185
186 void WebServiceParameters::SetPkcs11Enabled(bool enabled)
187 {
188 pkcs11Enabled_ = enabled;
189 }
190
191 bool WebServiceParameters::IsPkcs11Enabled() const
192 {
193 return pkcs11Enabled_;
194 }
195
196 void WebServiceParameters::AddHttpHeader(const std::string &key, const std::string &value)
197 {
198 headers_[key] = value;
199 }
200
201 void WebServiceParameters::ClearHttpHeaders()
202 {
203 headers_.clear();
204 }
205
206 const WebServiceParameters::Dictionary &WebServiceParameters::GetHttpHeaders() const
207 {
208 return headers_;
149 } 209 }
150 210
151 211
152 void WebServiceParameters::FromSimpleFormat(const Json::Value& peer) 212 void WebServiceParameters::FromSimpleFormat(const Json::Value& peer)
153 { 213 {
379 { 439 {
380 userProperties_[key] = value; 440 userProperties_[key] = value;
381 } 441 }
382 } 442 }
383 443
444 void WebServiceParameters::ClearUserProperties()
445 {
446 userProperties_.clear();
447 }
448
449 const WebServiceParameters::Dictionary &WebServiceParameters::GetUserProperties() const
450 {
451 return userProperties_;
452 }
453
384 454
385 void WebServiceParameters::ListUserProperties(std::set<std::string>& target) const 455 void WebServiceParameters::ListUserProperties(std::set<std::string>& target) const
386 { 456 {
387 target.clear(); 457 target.clear();
388 458