20 #include "mongo/client/export_macros.h"
21 #include "mongo/logger/log_domain.h"
22 #include "mongo/logger/message_log_domain.h"
23 #include "mongo/stdx/functional.h"
38 static const unsigned int kDefaultAutoShutdownGracePeriodMillis = 0;
39 static const int kDefaultDefaultLocalThresholdMillis = 15;
42 typedef std::auto_ptr<logger::MessageLogDomain::EventAppender> LogAppenderPtr;
43 typedef stdx::function<LogAppenderPtr()> LogAppenderFactory;
48 static const Options& current();
94 Options& setCallShutdownAtExit(
bool value =
true);
95 bool callShutdownAtExit()
const;
102 Options& setAutoShutdownGracePeriodMillis(
unsigned int millis);
103 unsigned int autoShutdownGracePeriodMillis()
const;
114 Options& setDefaultLocalThresholdMillis(
int millis);
115 int defaultLocalThresholdMillis()
const;
135 Options& setSSLMode(SSLModes sslMode = kSSLRequired);
136 SSLModes SSLMode()
const;
140 return SSLMode() != kSSLDisabled;
147 Options& setFIPSMode(
bool value =
true);
148 const bool FIPSMode()
const;
154 Options& setSSLCAFile(
const std::string& fileName);
155 const std::string& SSLCAFile()
const;
161 Options& setSSLPEMKeyFile(
const std::string& fileName);
162 const std::string& SSLPEMKeyFile()
const;
168 Options& setSSLPEMKeyPassword(
const std::string& password);
169 const std::string& SSLPEMKeyPassword()
const;
175 Options& setSSLCRLFile(
const std::string& fileName);
176 const std::string& SSLCRLFile()
const;
182 Options& setSSLAllowInvalidCertificates(
bool value =
true);
183 const bool SSLAllowInvalidCertificates()
const;
189 Options& setSSLAllowInvalidHostnames(
bool value =
true);
190 const bool SSLAllowInvalidHostnames()
const;
200 Options& setLogAppenderFactory(
const LogAppenderFactory& factory);
201 const LogAppenderFactory& logAppenderFactory()
const;
208 Options& setMinLoggedSeverity(logger::LogSeverity level);
209 logger::LogSeverity minLoggedSeverity()
const;
219 Options& setValidateObjects(
bool value =
true);
220 bool validateObjects()
const;
223 bool _callShutdownAtExit;
224 unsigned int _autoShutdownGracePeriodMillis;
227 std::string _sslCAFile;
228 std::string _sslPEMKeyFile;
229 std::string _sslPEMKeyPassword;
230 std::string _sslCRLFile;
231 bool _sslAllowInvalidCertificates;
232 bool _sslAllowInvalidHostnames;
233 int _defaultLocalThresholdMillis;
234 LogAppenderFactory _appenderFactory;
235 logger::LogSeverity _minLoggedSeverity;
236 bool _validateObjects;
the main MongoDB namespace
Definition: bulk_operation_builder.h:24
DefaultPorts
The default ports where different mongodb servers tend to run.
Definition: options.h:56
SSLModes
The possible modes for SSL support in an SSL enabled build of the driver.
Definition: options.h:63
The Options structure is passed to mongo::client::initialize to configure various properties and conf...
Definition: options.h:32
bool SSLEnabled() const
A convenience: returns true if SSL is not disabled (preferred or required).
Definition: options.h:139
Don't attempt to make SSL connections, or require SSL support of the server.
Definition: options.h:66