<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/v2/session.proto

namespace Google\Cloud\Bigtable\V2\SessionClientConfiguration;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Configuration for the channel pool.
 *
 * Generated from protobuf message <code>google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration</code>
 */
class ChannelPoolConfiguration extends \Google\Protobuf\Internal\Message
{
    /**
     * The minimum number of distcint servers to connect to in the channel pool.
     * The client will ensure that the channel pool will have at least this many
     * distinct servers, but may have multiple channels connected to the same
     * server (e.g. the client may have M channels on N machines, where M > N).
     *
     * Generated from protobuf field <code>int32 min_server_count = 1;</code>
     */
    protected $min_server_count = 0;
    /**
     * The maximum number of distinct servers to connect to in the channel pool.
     * The client will ensure that the channel pool will have at most this many
     * distinct servers.
     *
     * Generated from protobuf field <code>int32 max_server_count = 2;</code>
     */
    protected $max_server_count = 0;
    /**
     * Soft maximum for how many sessions are allowed per server. Normally, the
     * client will ensure that it does not host more than this count of sessions
     * per server, unless there are other limits encountered (e.g. the connected
     * servers is already at max_servers).
     *
     * Generated from protobuf field <code>int32 per_server_session_count = 3;</code>
     */
    protected $per_server_session_count = 0;
    protected $mode;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $min_server_count
     *           The minimum number of distcint servers to connect to in the channel pool.
     *           The client will ensure that the channel pool will have at least this many
     *           distinct servers, but may have multiple channels connected to the same
     *           server (e.g. the client may have M channels on N machines, where M > N).
     *     @type int $max_server_count
     *           The maximum number of distinct servers to connect to in the channel pool.
     *           The client will ensure that the channel pool will have at most this many
     *           distinct servers.
     *     @type int $per_server_session_count
     *           Soft maximum for how many sessions are allowed per server. Normally, the
     *           client will ensure that it does not host more than this count of sessions
     *           per server, unless there are other limits encountered (e.g. the connected
     *           servers is already at max_servers).
     *     @type \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessWithFallback $direct_access_with_fallback
     *           DirectAccess with a fallback to CloudPath.
     *     @type \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessOnly $direct_access_only
     *           DirectAccess only.
     *     @type \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\CloudPathOnly $cloud_path_only
     *           CloudPath only.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Session::initOnce();
        parent::__construct($data);
    }

    /**
     * The minimum number of distcint servers to connect to in the channel pool.
     * The client will ensure that the channel pool will have at least this many
     * distinct servers, but may have multiple channels connected to the same
     * server (e.g. the client may have M channels on N machines, where M > N).
     *
     * Generated from protobuf field <code>int32 min_server_count = 1;</code>
     * @return int
     */
    public function getMinServerCount()
    {
        return $this->min_server_count;
    }

    /**
     * The minimum number of distcint servers to connect to in the channel pool.
     * The client will ensure that the channel pool will have at least this many
     * distinct servers, but may have multiple channels connected to the same
     * server (e.g. the client may have M channels on N machines, where M > N).
     *
     * Generated from protobuf field <code>int32 min_server_count = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setMinServerCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->min_server_count = $var;

        return $this;
    }

    /**
     * The maximum number of distinct servers to connect to in the channel pool.
     * The client will ensure that the channel pool will have at most this many
     * distinct servers.
     *
     * Generated from protobuf field <code>int32 max_server_count = 2;</code>
     * @return int
     */
    public function getMaxServerCount()
    {
        return $this->max_server_count;
    }

    /**
     * The maximum number of distinct servers to connect to in the channel pool.
     * The client will ensure that the channel pool will have at most this many
     * distinct servers.
     *
     * Generated from protobuf field <code>int32 max_server_count = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxServerCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_server_count = $var;

        return $this;
    }

    /**
     * Soft maximum for how many sessions are allowed per server. Normally, the
     * client will ensure that it does not host more than this count of sessions
     * per server, unless there are other limits encountered (e.g. the connected
     * servers is already at max_servers).
     *
     * Generated from protobuf field <code>int32 per_server_session_count = 3;</code>
     * @return int
     */
    public function getPerServerSessionCount()
    {
        return $this->per_server_session_count;
    }

    /**
     * Soft maximum for how many sessions are allowed per server. Normally, the
     * client will ensure that it does not host more than this count of sessions
     * per server, unless there are other limits encountered (e.g. the connected
     * servers is already at max_servers).
     *
     * Generated from protobuf field <code>int32 per_server_session_count = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setPerServerSessionCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->per_server_session_count = $var;

        return $this;
    }

    /**
     * DirectAccess with a fallback to CloudPath.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4;</code>
     * @return \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessWithFallback|null
     */
    public function getDirectAccessWithFallback()
    {
        return $this->readOneof(4);
    }

    public function hasDirectAccessWithFallback()
    {
        return $this->hasOneof(4);
    }

    /**
     * DirectAccess with a fallback to CloudPath.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessWithFallback direct_access_with_fallback = 4;</code>
     * @param \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessWithFallback $var
     * @return $this
     */
    public function setDirectAccessWithFallback($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessWithFallback::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * DirectAccess only.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5;</code>
     * @return \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessOnly|null
     */
    public function getDirectAccessOnly()
    {
        return $this->readOneof(5);
    }

    public function hasDirectAccessOnly()
    {
        return $this->hasOneof(5);
    }

    /**
     * DirectAccess only.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.DirectAccessOnly direct_access_only = 5;</code>
     * @param \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessOnly $var
     * @return $this
     */
    public function setDirectAccessOnly($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\DirectAccessOnly::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * CloudPath only.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6;</code>
     * @return \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\CloudPathOnly|null
     */
    public function getCloudPathOnly()
    {
        return $this->readOneof(6);
    }

    public function hasCloudPathOnly()
    {
        return $this->hasOneof(6);
    }

    /**
     * CloudPath only.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.SessionClientConfiguration.ChannelPoolConfiguration.CloudPathOnly cloud_path_only = 6;</code>
     * @param \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\CloudPathOnly $var
     * @return $this
     */
    public function setCloudPathOnly($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\SessionClientConfiguration\ChannelPoolConfiguration\CloudPathOnly::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getMode()
    {
        return $this->whichOneof("mode");
    }

}

