Red Hat Data Grid HotRod C++ Client  7.2.0
SslConfigurationBuilder.h
Go to the documentation of this file.
1 #ifndef SSLCONFIGURATIONBUILDER_H_
2 #define SSLCONFIGURATIONBUILDER_H_
3 
6 
7 
8 namespace infinispan {
9 namespace hotrod {
10 
11 
14 {
15  public:
17  m_enabled(false), m_serverCAPath(), m_serverCAFile(), m_clientCertificateFile(), m_sniHostName() {}
19  return SslConfiguration(m_enabled, m_serverCAPath, m_serverCAFile, m_clientCertificateFile, m_sniHostName);
20  }
21  virtual SslConfigurationBuilder& read(SslConfiguration& configuration) {
22  m_enabled = configuration.enabled();
23  m_serverCAPath = configuration.serverCAPath();
24  m_serverCAFile = configuration.serverCAFile();
25  m_clientCertificateFile = configuration.clientCertificateFile();
26  m_sniHostName = configuration.sniHostName();
27  return *this;
28  }
29  virtual void validate() {};
30 
37  {
38  m_enabled = true;
39  return *this;
40  }
41 
48  {
49  m_enabled = false;
50  return *this;
51  }
52 
59  {
60  m_enabled = enabled;
61  return *this;
62  }
63 
69  SslConfigurationBuilder& serverCAPath(const std::string& _CAPath)
70  {
71  m_serverCAPath = _CAPath;
72  return *this;
73  }
74 
80  SslConfigurationBuilder& serverCAFile(const std::string& _CAFile)
81  {
82  m_serverCAFile = _CAFile;
83  return *this;
84  }
85 
91  SslConfigurationBuilder& clientCertificateFile(const std::string& _clientCertificateFile)
92  {
93  m_clientCertificateFile = _clientCertificateFile;
94  return *this;
95  }
96 
103  SslConfigurationBuilder& sniHostName(const std::string& _sniHostName)
104  {
105  m_sniHostName = _sniHostName;
106  return *this;
107  }
108 
114  const std::string& getSniHostName() const
115  {
116  return m_sniHostName;
117  }
118 
119 
120 private:
121  bool m_enabled;
122  std::string m_serverCAPath;
123  std::string m_serverCAFile;
124  std::string m_clientCertificateFile;
125  std::string m_sniHostName;
126 };
127 
128 }}
129 
130 #endif /* SSLCONFIGURATIONBUILDER_H_ */
SslConfigurationBuilder & enabled(bool enabled)
Definition: SslConfigurationBuilder.h:58
const bool & enabled() const
Definition: SslConfiguration.h:28
virtual void validate()
Definition: SslConfigurationBuilder.h:29
const std::string & sniHostName() const
Definition: SslConfiguration.h:68
SslConfigurationBuilder & serverCAFile(const std::string &_CAFile)
Definition: SslConfigurationBuilder.h:80
SslConfigurationBuilder & enable()
Definition: SslConfigurationBuilder.h:36
Definition: SslConfigurationBuilder.h:12
const std::string & getSniHostName() const
Definition: SslConfigurationBuilder.h:114
Definition: AuthenticationConfiguration.h:10
const std::string & serverCAPath() const
Definition: SslConfiguration.h:38
SslConfigurationBuilder & disable()
Definition: SslConfigurationBuilder.h:47
Definition: SslConfiguration.h:10
const std::string & serverCAFile() const
Definition: SslConfiguration.h:48
const std::string & clientCertificateFile() const
Definition: SslConfiguration.h:58
SslConfigurationBuilder & clientCertificateFile(const std::string &_clientCertificateFile)
Definition: SslConfigurationBuilder.h:91
Definition: ConfigurationBuilder.h:111
virtual SslConfigurationBuilder & read(SslConfiguration &configuration)
Definition: SslConfigurationBuilder.h:21
Definition: ConfigurationChildBuilder.h:18
SslConfigurationBuilder(ConfigurationBuilder &parent)
Definition: SslConfigurationBuilder.h:16
SslConfigurationBuilder & sniHostName(const std::string &_sniHostName)
Definition: SslConfigurationBuilder.h:103
SslConfigurationBuilder & serverCAPath(const std::string &_CAPath)
Definition: SslConfigurationBuilder.h:69
SslConfiguration create()
Definition: SslConfigurationBuilder.h:18