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"
37 static const unsigned int kDefaultAutoShutdownGracePeriodMillis = 0;
38 static const int kDefaultDefaultLocalThresholdMillis = 15;
41 typedef std::auto_ptr<logger::MessageLogDomain::EventAppender> LogAppenderPtr;
42 typedef stdx::function<LogAppenderPtr()> LogAppenderFactory;
47 static const Options& current();
55 enum DefaultPorts { kDbServer = 27017, kShardServer = 27018, kConfigServer = 27019 };
91 Options& setCallShutdownAtExit(
bool value =
true);
92 bool callShutdownAtExit()
const;
99 Options& setAutoShutdownGracePeriodMillis(
unsigned int millis);
100 unsigned int autoShutdownGracePeriodMillis()
const;
111 Options& setDefaultLocalThresholdMillis(
int millis);
112 int defaultLocalThresholdMillis()
const;
132 Options& setSSLMode(SSLModes sslMode = kSSLRequired);
133 SSLModes SSLMode()
const;
137 return SSLMode() != kSSLDisabled;
144 Options& setFIPSMode(
bool value =
true);
145 const bool FIPSMode()
const;
152 Options& setSSLDisabledTLSProtocols(
const std::vector<TLSProtocol>& protocols);
153 const std::vector<TLSProtocol>& SSLDisabledTLSProtocols()
const;
159 Options& setSSLCAFile(
const std::string& fileName);
160 const std::string& SSLCAFile()
const;
166 Options& setSSLPEMKeyFile(
const std::string& fileName);
167 const std::string& SSLPEMKeyFile()
const;
173 Options& setSSLPEMKeyPassword(
const std::string& password);
174 const std::string& SSLPEMKeyPassword()
const;
180 Options& setSSLCRLFile(
const std::string& fileName);
181 const std::string& SSLCRLFile()
const;
187 Options& setSSLAllowInvalidCertificates(
bool value =
true);
188 const bool SSLAllowInvalidCertificates()
const;
194 Options& setSSLAllowInvalidHostnames(
bool value =
true);
195 const bool SSLAllowInvalidHostnames()
const;
201 Options& setSSLCipherConfig(
const std::string& config);
202 const std::string& SSLCipherConfig()
const;
212 Options& setLogAppenderFactory(
const LogAppenderFactory& factory);
213 const LogAppenderFactory& logAppenderFactory()
const;
231 Options& setIPv6Enabled(
bool state);
232 bool IPv6Enabled()
const;
242 Options& setValidateObjects(
bool value =
true);
243 bool validateObjects()
const;
246 bool _callShutdownAtExit;
247 unsigned int _autoShutdownGracePeriodMillis;
250 std::vector<TLSProtocol> _sslDisabledTLSProtocols;
251 std::string _sslCAFile;
252 std::string _sslPEMKeyFile;
253 std::string _sslPEMKeyPassword;
254 std::string _sslCRLFile;
255 bool _sslAllowInvalidCertificates;
256 bool _sslAllowInvalidHostnames;
257 std::string _sslCipherConfig;
258 int _defaultLocalThresholdMillis;
259 LogAppenderFactory _appenderFactory;
262 bool _validateObjects;
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
DefaultPorts
The default ports where different mongodb servers tend to run.
Definition: options.h:55
SSLModes
The possible modes for SSL support in an SSL enabled build of the driver.
Definition: options.h:58
The Options structure is passed to mongo::client::initialize to configure various properties and conf...
Definition: options.h:32
TLSProtocol
The TLS protocols.
Definition: options.h:75
bool SSLEnabled() const
A convenience: returns true if SSL is not disabled (preferred or required).
Definition: options.h:136
Don't attempt to make SSL connections, or require SSL support of the server.
Definition: options.h:61
Representation of the severity / priority of a log message.
Definition: log_severity.h:33