Red Hat Data Grid HotRod C++ Client  7.2.0
ServerConfigurationBuilder.h
Go to the documentation of this file.
1 /*
2  * ServerConfigurationBuilder.h
3  *
4  * Created on: Jul 18, 2013
5  * Author: samuele
6  */
7 
8 #ifndef SERVERCONFIGURATIONBUILDER_H_
9 #define SERVERCONFIGURATIONBUILDER_H_
10 
11 #include <string>
13 #include "ServerConfiguration.h"
15 
16 namespace infinispan {
17 namespace hotrod {
27 {
28  public:
30  ConfigurationChildBuilder(builder_), m_host("localhost"), m_port(11222) {}
31 
32  virtual void validate() {};
33 
39  ServerConfigurationBuilder& host(const std::string &host_)
40  {
41  m_host = host_;
42  return *this;
43  }
44 
51  {
52  m_port = port_;
53  return *this;
54  }
55 
63  {
64  return ServerConfiguration(m_host, m_port);
65  }
66 
74  {
75  m_host = configuration.getHostCString();
76  m_port = configuration.getPort();
77  return *this;
78  }
79 
80  private:
81  std::string m_host;
82  int m_port;
83 };
84 
85 
86 }} //namespace
87 
88 
89 #endif /* SERVERCONFIGURATIONBUILDER_H_ */
ServerConfigurationBuilder(ConfigurationBuilder &builder_)
Definition: ServerConfigurationBuilder.h:29
virtual void validate()
Definition: ServerConfigurationBuilder.h:32
Definition: AuthenticationConfiguration.h:10
Definition: ServerConfigurationBuilder.h:25
ServerConfigurationBuilder & port(int port_)
Definition: ServerConfigurationBuilder.h:50
virtual ServerConfiguration create()
Definition: ServerConfigurationBuilder.h:62
const int & getPort() const
Definition: ServerConfiguration.h:48
const char * getHostCString() const
Definition: ServerConfiguration.h:38
ServerConfigurationBuilder & host(const std::string &host_)
Definition: ServerConfigurationBuilder.h:39
Definition: ConfigurationBuilder.h:111
Definition: ConfigurationChildBuilder.h:18
Definition: ServerConfiguration.h:23
virtual ServerConfigurationBuilder & read(ServerConfiguration &configuration)
Definition: ServerConfigurationBuilder.h:73