1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: src/proto/grpc/testing/control.proto
4
5namespace Grpc\Testing;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\RepeatedField;
9use Google\Protobuf\Internal\GPBUtil;
10
11/**
12 * Generated from protobuf message <code>grpc.testing.ServerConfig</code>
13 */
14class ServerConfig extends \Google\Protobuf\Internal\Message
15{
16    /**
17     * Generated from protobuf field <code>.grpc.testing.ServerType server_type = 1;</code>
18     */
19    private $server_type = 0;
20    /**
21     * Generated from protobuf field <code>.grpc.testing.SecurityParams security_params = 2;</code>
22     */
23    private $security_params = null;
24    /**
25     * Port on which to listen. Zero means pick unused port.
26     *
27     * Generated from protobuf field <code>int32 port = 4;</code>
28     */
29    private $port = 0;
30    /**
31     * Only for async server. Number of threads used to serve the requests.
32     *
33     * Generated from protobuf field <code>int32 async_server_threads = 7;</code>
34     */
35    private $async_server_threads = 0;
36    /**
37     * Specify the number of cores to limit server to, if desired
38     *
39     * Generated from protobuf field <code>int32 core_limit = 8;</code>
40     */
41    private $core_limit = 0;
42    /**
43     * payload config, used in generic server.
44     * Note this must NOT be used in proto (non-generic) servers. For proto servers,
45     * 'response sizes' must be configured from the 'response_size' field of the
46     * 'SimpleRequest' objects in RPC requests.
47     *
48     * Generated from protobuf field <code>.grpc.testing.PayloadConfig payload_config = 9;</code>
49     */
50    private $payload_config = null;
51    /**
52     * Specify the cores we should run the server on, if desired
53     *
54     * Generated from protobuf field <code>repeated int32 core_list = 10;</code>
55     */
56    private $core_list;
57    /**
58     * If we use an OTHER_SERVER client_type, this string gives more detail
59     *
60     * Generated from protobuf field <code>string other_server_api = 11;</code>
61     */
62    private $other_server_api = '';
63    /**
64     * Number of threads that share each completion queue
65     *
66     * Generated from protobuf field <code>int32 threads_per_cq = 12;</code>
67     */
68    private $threads_per_cq = 0;
69    /**
70     * Buffer pool size (no buffer pool specified if unset)
71     *
72     * Generated from protobuf field <code>int32 resource_quota_size = 1001;</code>
73     */
74    private $resource_quota_size = 0;
75    /**
76     * Generated from protobuf field <code>repeated .grpc.testing.ChannelArg channel_args = 1002;</code>
77     */
78    private $channel_args;
79
80    public function __construct() {
81        \GPBMetadata\Src\Proto\Grpc\Testing\Control::initOnce();
82        parent::__construct();
83    }
84
85    /**
86     * Generated from protobuf field <code>.grpc.testing.ServerType server_type = 1;</code>
87     * @return int
88     */
89    public function getServerType()
90    {
91        return $this->server_type;
92    }
93
94    /**
95     * Generated from protobuf field <code>.grpc.testing.ServerType server_type = 1;</code>
96     * @param int $var
97     * @return $this
98     */
99    public function setServerType($var)
100    {
101        GPBUtil::checkEnum($var, \Grpc\Testing\ServerType::class);
102        $this->server_type = $var;
103
104        return $this;
105    }
106
107    /**
108     * Generated from protobuf field <code>.grpc.testing.SecurityParams security_params = 2;</code>
109     * @return \Grpc\Testing\SecurityParams
110     */
111    public function getSecurityParams()
112    {
113        return $this->security_params;
114    }
115
116    /**
117     * Generated from protobuf field <code>.grpc.testing.SecurityParams security_params = 2;</code>
118     * @param \Grpc\Testing\SecurityParams $var
119     * @return $this
120     */
121    public function setSecurityParams($var)
122    {
123        GPBUtil::checkMessage($var, \Grpc\Testing\SecurityParams::class);
124        $this->security_params = $var;
125
126        return $this;
127    }
128
129    /**
130     * Port on which to listen. Zero means pick unused port.
131     *
132     * Generated from protobuf field <code>int32 port = 4;</code>
133     * @return int
134     */
135    public function getPort()
136    {
137        return $this->port;
138    }
139
140    /**
141     * Port on which to listen. Zero means pick unused port.
142     *
143     * Generated from protobuf field <code>int32 port = 4;</code>
144     * @param int $var
145     * @return $this
146     */
147    public function setPort($var)
148    {
149        GPBUtil::checkInt32($var);
150        $this->port = $var;
151
152        return $this;
153    }
154
155    /**
156     * Only for async server. Number of threads used to serve the requests.
157     *
158     * Generated from protobuf field <code>int32 async_server_threads = 7;</code>
159     * @return int
160     */
161    public function getAsyncServerThreads()
162    {
163        return $this->async_server_threads;
164    }
165
166    /**
167     * Only for async server. Number of threads used to serve the requests.
168     *
169     * Generated from protobuf field <code>int32 async_server_threads = 7;</code>
170     * @param int $var
171     * @return $this
172     */
173    public function setAsyncServerThreads($var)
174    {
175        GPBUtil::checkInt32($var);
176        $this->async_server_threads = $var;
177
178        return $this;
179    }
180
181    /**
182     * Specify the number of cores to limit server to, if desired
183     *
184     * Generated from protobuf field <code>int32 core_limit = 8;</code>
185     * @return int
186     */
187    public function getCoreLimit()
188    {
189        return $this->core_limit;
190    }
191
192    /**
193     * Specify the number of cores to limit server to, if desired
194     *
195     * Generated from protobuf field <code>int32 core_limit = 8;</code>
196     * @param int $var
197     * @return $this
198     */
199    public function setCoreLimit($var)
200    {
201        GPBUtil::checkInt32($var);
202        $this->core_limit = $var;
203
204        return $this;
205    }
206
207    /**
208     * payload config, used in generic server.
209     * Note this must NOT be used in proto (non-generic) servers. For proto servers,
210     * 'response sizes' must be configured from the 'response_size' field of the
211     * 'SimpleRequest' objects in RPC requests.
212     *
213     * Generated from protobuf field <code>.grpc.testing.PayloadConfig payload_config = 9;</code>
214     * @return \Grpc\Testing\PayloadConfig
215     */
216    public function getPayloadConfig()
217    {
218        return $this->payload_config;
219    }
220
221    /**
222     * payload config, used in generic server.
223     * Note this must NOT be used in proto (non-generic) servers. For proto servers,
224     * 'response sizes' must be configured from the 'response_size' field of the
225     * 'SimpleRequest' objects in RPC requests.
226     *
227     * Generated from protobuf field <code>.grpc.testing.PayloadConfig payload_config = 9;</code>
228     * @param \Grpc\Testing\PayloadConfig $var
229     * @return $this
230     */
231    public function setPayloadConfig($var)
232    {
233        GPBUtil::checkMessage($var, \Grpc\Testing\PayloadConfig::class);
234        $this->payload_config = $var;
235
236        return $this;
237    }
238
239    /**
240     * Specify the cores we should run the server on, if desired
241     *
242     * Generated from protobuf field <code>repeated int32 core_list = 10;</code>
243     * @return \Google\Protobuf\Internal\RepeatedField
244     */
245    public function getCoreList()
246    {
247        return $this->core_list;
248    }
249
250    /**
251     * Specify the cores we should run the server on, if desired
252     *
253     * Generated from protobuf field <code>repeated int32 core_list = 10;</code>
254     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
255     * @return $this
256     */
257    public function setCoreList($var)
258    {
259        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
260        $this->core_list = $arr;
261
262        return $this;
263    }
264
265    /**
266     * If we use an OTHER_SERVER client_type, this string gives more detail
267     *
268     * Generated from protobuf field <code>string other_server_api = 11;</code>
269     * @return string
270     */
271    public function getOtherServerApi()
272    {
273        return $this->other_server_api;
274    }
275
276    /**
277     * If we use an OTHER_SERVER client_type, this string gives more detail
278     *
279     * Generated from protobuf field <code>string other_server_api = 11;</code>
280     * @param string $var
281     * @return $this
282     */
283    public function setOtherServerApi($var)
284    {
285        GPBUtil::checkString($var, True);
286        $this->other_server_api = $var;
287
288        return $this;
289    }
290
291    /**
292     * Number of threads that share each completion queue
293     *
294     * Generated from protobuf field <code>int32 threads_per_cq = 12;</code>
295     * @return int
296     */
297    public function getThreadsPerCq()
298    {
299        return $this->threads_per_cq;
300    }
301
302    /**
303     * Number of threads that share each completion queue
304     *
305     * Generated from protobuf field <code>int32 threads_per_cq = 12;</code>
306     * @param int $var
307     * @return $this
308     */
309    public function setThreadsPerCq($var)
310    {
311        GPBUtil::checkInt32($var);
312        $this->threads_per_cq = $var;
313
314        return $this;
315    }
316
317    /**
318     * Buffer pool size (no buffer pool specified if unset)
319     *
320     * Generated from protobuf field <code>int32 resource_quota_size = 1001;</code>
321     * @return int
322     */
323    public function getResourceQuotaSize()
324    {
325        return $this->resource_quota_size;
326    }
327
328    /**
329     * Buffer pool size (no buffer pool specified if unset)
330     *
331     * Generated from protobuf field <code>int32 resource_quota_size = 1001;</code>
332     * @param int $var
333     * @return $this
334     */
335    public function setResourceQuotaSize($var)
336    {
337        GPBUtil::checkInt32($var);
338        $this->resource_quota_size = $var;
339
340        return $this;
341    }
342
343    /**
344     * Generated from protobuf field <code>repeated .grpc.testing.ChannelArg channel_args = 1002;</code>
345     * @return \Google\Protobuf\Internal\RepeatedField
346     */
347    public function getChannelArgs()
348    {
349        return $this->channel_args;
350    }
351
352    /**
353     * Generated from protobuf field <code>repeated .grpc.testing.ChannelArg channel_args = 1002;</code>
354     * @param \Grpc\Testing\ChannelArg[]|\Google\Protobuf\Internal\RepeatedField $var
355     * @return $this
356     */
357    public function setChannelArgs($var)
358    {
359        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\ChannelArg::class);
360        $this->channel_args = $arr;
361
362        return $this;
363    }
364
365}
366
367