17 BackendSelector::BackendSelector()
23 : backend_type_(backend_type),
30 host_(host), port_(port) {
37 if (access_map->getType() != Element::map) {
43 if (t->getType() != Element::string) {
51 if (h->getType() != Element::string) {
54 host_ = h->stringValue();
59 if ((p->getType() != Element::integer) ||
60 (p->intValue() < 0) ||
61 (p->intValue() > std::numeric_limits<uint16_t>::max())) {
63 "to " << std::numeric_limits<uint16_t>::max());
65 port_ =
static_cast<uint16_t
>(p->intValue());
96 s <<
"host=" << host_ <<
",";
99 s <<
"port=" << port_ <<
",";
104 std::string text = s.str();
105 if ((!text.empty() && (text.back() ==
','))) {
114 if (type ==
"mysql") {
117 }
else if (type ==
"pgsql") {
120 }
else if (type ==
"cql") {
141 return (std::string());
145 BackendSelector::validate()
const {
146 if ((port_ != 0) && (host_.empty())) {