void CacheXmlParser::startPool()

in cppcache/src/CacheXmlParser.cpp [610:751]


void CacheXmlParser::startPool(const xercesc::Attributes &attrs) {
  using apache::geode::client::equal_ignore_case;
  using apache::geode::internal::chrono::duration::from_string;

  auto factory =
      std::make_shared<PoolFactory>(cache_->getPoolManager().createFactory());

  auto poolName = getRequiredAttribute(attrs, NAME);

  auto poolxml = std::make_shared<PoolXmlCreation>(poolName, factory);

  auto freeConnectionTimeout =
      getOptionalAttribute(attrs, FREE_CONNECTION_TIMEOUT);
  if (!freeConnectionTimeout.empty()) {
    factory->setFreeConnectionTimeout(
        from_string<std::chrono::milliseconds>(freeConnectionTimeout));
  }

  auto multiUserSecureMode = getOptionalAttribute(attrs, MULTIUSER_SECURE_MODE);
  if (!multiUserSecureMode.empty()) {
    if (equal_ignore_case(multiUserSecureMode, "true")) {
      factory->setMultiuserAuthentication(true);
    } else {
      factory->setMultiuserAuthentication(false);
    }
  }

  auto idleTimeout = getOptionalAttribute(attrs, IDLE_TIMEOUT);
  if (!idleTimeout.empty()) {
    factory->setIdleTimeout(
        from_string<std::chrono::milliseconds>(idleTimeout));
  }

  auto loadConditioningInterval =
      getOptionalAttribute(attrs, LOAD_CONDITIONING_INTERVAL);
  if (!loadConditioningInterval.empty()) {
    factory->setLoadConditioningInterval(
        from_string<std::chrono::milliseconds>(loadConditioningInterval));
  }

  auto maxConnections = getOptionalAttribute(attrs, MAX_CONNECTIONS);
  if (!maxConnections.empty()) {
    factory->setMaxConnections(atoi(maxConnections.c_str()));
  }

  auto minConnections = getOptionalAttribute(attrs, MIN_CONNECTIONS);
  if (!minConnections.empty()) {
    factory->setMinConnections(atoi(minConnections.c_str()));
  }

  auto pingInterval = getOptionalAttribute(attrs, PING_INTERVAL);
  if (!pingInterval.empty()) {
    factory->setPingInterval(
        from_string<std::chrono::milliseconds>(std::string(pingInterval)));
  }

  auto updateLocatorListInterval =
      getOptionalAttribute(attrs, UPDATE_LOCATOR_LIST_INTERVAL);
  if (!updateLocatorListInterval.empty()) {
    factory->setUpdateLocatorListInterval(
        from_string<std::chrono::milliseconds>(updateLocatorListInterval));
  }

  auto readTimeout = getOptionalAttribute(attrs, READ_TIMEOUT);
  if (!readTimeout.empty()) {
    factory->setReadTimeout(
        from_string<std::chrono::milliseconds>(std::string(readTimeout)));
  }

  auto retryAttempts = getOptionalAttribute(attrs, RETRY_ATTEMPTS);
  if (!retryAttempts.empty()) {
    factory->setRetryAttempts(atoi(retryAttempts.c_str()));
  }

  auto serverGroup = getOptionalAttribute(attrs, SERVER_GROUP);
  if (!serverGroup.empty()) {
    factory->setServerGroup(serverGroup);
  }

  auto socketBufferSize = getOptionalAttribute(attrs, SOCKET_BUFFER_SIZE);
  if (!socketBufferSize.empty()) {
    factory->setSocketBufferSize(atoi(socketBufferSize.c_str()));
  }

  auto statisticInterval = getOptionalAttribute(attrs, STATISTIC_INTERVAL);
  if (!statisticInterval.empty()) {
    factory->setStatisticInterval(
        from_string<std::chrono::milliseconds>(statisticInterval));
  }

  auto subscriptionAckInterval =
      getOptionalAttribute(attrs, SUBSCRIPTION_ACK_INTERVAL);
  if (!subscriptionAckInterval.empty()) {
    factory->setSubscriptionAckInterval(
        from_string<std::chrono::milliseconds>(subscriptionAckInterval));
  }

  auto subscriptionEnabled = getOptionalAttribute(attrs, SUBSCRIPTION_ENABLED);
  if (!subscriptionEnabled.empty()) {
    if (equal_ignore_case(subscriptionEnabled, "true")) {
      factory->setSubscriptionEnabled(true);
    } else {
      factory->setSubscriptionEnabled(false);
    }
  }

  auto subscriptionMessageTrackingTimeout =
      getOptionalAttribute(attrs, SUBSCRIPTION_MTT);
  if (!subscriptionMessageTrackingTimeout.empty()) {
    factory->setSubscriptionMessageTrackingTimeout(
        from_string<std::chrono::milliseconds>(
            subscriptionMessageTrackingTimeout));
  }

  auto subscriptionRedundancy =
      getOptionalAttribute(attrs, SUBSCRIPTION_REDUNDANCY);
  if (!subscriptionRedundancy.empty()) {
    factory->setSubscriptionRedundancy(atoi(subscriptionRedundancy.c_str()));
  }

  auto threadLocalConnections =
      getOptionalAttribute(attrs, THREAD_LOCAL_CONNECTIONS);
  if (!threadLocalConnections.empty()) {
    if (equal_ignore_case(threadLocalConnections, "true")) {
      factory->setThreadLocalConnections(true);
    } else {
      factory->setThreadLocalConnections(false);
    }
  }

  auto prSingleHopEnabled = getOptionalAttribute(attrs, PR_SINGLE_HOP_ENABLED);
  if (!prSingleHopEnabled.empty()) {
    if (equal_ignore_case(prSingleHopEnabled, "true")) {
      factory->setPRSingleHopEnabled(true);
    } else {
      factory->setPRSingleHopEnabled(false);
    }
  }

  _stack.push(poolxml);
  _stack.push(factory);
}