Completed
Push — master ( 26a868...229b78 )
by Ramin
02:08
created

OrtcConfig::getPreMessageString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ninjacto\OrtcPhp\Configs;
4
5
class OrtcConfig
6
{
7
    /**
8
     * Realtime.co india cluster url.
9
     *
10
     * @var string
11
     */
12
    protected $indiaClusterUrl = 'https://ortc-india.realtime.co/server/2.1';
13
14
    /**
15
     * Realtime.co default url.
16
     *
17
     * @var string
18
     */
19
    protected $clusterUrl = 'https://ortc-developers.realtime.co/server/2.1';
20
21
    /**
22
     * Realtime.co cluster server.
23
     *
24
     * @var string
25
     */
26
    protected $cluster = 'india';
27
28
    /**
29
     * Realtime.co balancer url.
30
     *
31
     * @var string
32
     */
33
    protected $balancerUrl = '?appkey={APP_KEY}';
34
35
    /**
36
     * Your realtime.co application key.
37
     *
38
     * @var string
39
     */
40
    protected $applicationKey;
41
42
    /**
43
     * Your realtime.co private key.
44
     *
45
     * @var string
46
     */
47
    protected $privateKey;
48
49
    /**
50
     * authentication path.
51
     *
52
     * @var string
53
     */
54
    protected $authenticationPath = '/authenticate';
55
56
    /**
57
     * send push message to channel(s) path.
58
     *
59
     * @var string
60
     */
61
    protected $sendPath = '/send';
62
63
    /**
64
     * maximum size of message chunk in bytes.
65
     *
66
     * @var int
67
     */
68
    protected $maxChunkSize = 700;
69
70
    /**
71
     * maximum size of message chunk in bytes.
72
     *
73
     * @var int
74
     */
75
    protected $batchPoolSize = 5;
76
77
    /**
78
     * pre concatenating string for every message chunks.
79
     *
80
     * @var string
81
     */
82
    protected $preMessageString = '{RANDOM}_{PART}-{TOTAL_PARTS}_';
83
84
    /**
85
     * verify ssl/tls certificate.
86
     *
87
     * @var bool
88
     */
89
    protected $verifySsl = true;
90
91
    /**
92
     * @return string
93
     */
94
    public function getApplicationKey()
95
    {
96
        return $this->applicationKey;
97
    }
98
99
    /**
100
     * @param string $applicationKey
101
     * @return $this
102
     */
103
    public function setApplicationKey($applicationKey)
104
    {
105
        $this->applicationKey = $applicationKey;
106
        return $this;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function getBalancedUrl()
113
    {
114
        return $this->clusterUrl . $this->balancerUrl;
115
    }
116
117
    /**
118
     * @param string $balancedUrl
119
     * @return $this
120
     */
121
    public function setBalancedUrl($balancedUrl)
122
    {
123
        $this->balancerUrl = $balancedUrl;
124
        return $this;
125
    }
126
127
    /**
128
     * @return string
129
     */
130
    public function getClusterUrl()
131
    {
132
        return ($this->cluster == 'india') ? $this->indiaClusterUrl : $this->clusterUrl;
133
    }
134
135
    /**
136
     * @param string $clusterUrl
137
     * @return $this
138
     */
139
    public function setClusterUrl($clusterUrl)
140
    {
141
        $this->clusterUrl = $clusterUrl;
142
        return $this;
143
    }
144
145
    /**
146
     * @return string
147
     */
148
    public function getCluster()
149
    {
150
        return $this->cluster;
151
    }
152
153
    /**
154
     * @param string $cluster
155
     * @return $this
156
     */
157
    public function setCluster($cluster)
158
    {
159
        $this->cluster = $cluster;
160
        return $this;
161
    }
162
163
    /**
164
     * @return string
165
     */
166
    public function getPrivateKey()
167
    {
168
        return $this->privateKey;
169
    }
170
171
    /**
172
     * @param string $privateKey
173
     * @return $this
174
     */
175
    public function setPrivateKey($privateKey)
176
    {
177
        $this->privateKey = $privateKey;
178
        return $this;
179
    }
180
181
    /**
182
     * @return string
183
     */
184
    public function getAuthenticationPath()
185
    {
186
        return $this->authenticationPath;
187
    }
188
189
    /**
190
     * @param string $authenticationPath
191
     * @return $this
192
     */
193
    public function setAuthenticationPath($authenticationPath)
194
    {
195
        $this->authenticationPath = $authenticationPath;
196
        return $this;
197
    }
198
199
    /**
200
     * @return string
201
     */
202
    public function getSendPath()
203
    {
204
        return $this->sendPath;
205
    }
206
207
    /**
208
     * @param string $sendPath
209
     * @return $this
210
     */
211
    public function setSendPath($sendPath)
212
    {
213
        $this->sendPath = $sendPath;
214
        return $this;
215
    }
216
217
    /**
218
     * @return int
219
     */
220
    public function getMaxChunkSize()
221
    {
222
        return $this->maxChunkSize;
223
    }
224
225
    /**
226
     * @param int $maxChunkSize
227
     * @return $this
228
     */
229
    public function setMaxChunkSize($maxChunkSize)
230
    {
231
        $this->maxChunkSize = $maxChunkSize;
232
        return $this;
233
    }
234
235
    /**
236
     * @return string
237
     */
238
    public function getPreMessageString()
239
    {
240
        return $this->preMessageString;
241
    }
242
243
    /**
244
     * @param string $preMessageString
245
     * @return $this
246
     */
247
    public function setPreMessageString($preMessageString)
248
    {
249
        $this->preMessageString = $preMessageString;
250
        return $this;
251
    }
252
253
    /**
254
     * @return bool
255
     */
256
    public function isVerifySsl()
257
    {
258
        return $this->verifySsl;
259
    }
260
261
    /**
262
     * @param bool $verifySsl
263
     * @return $this
264
     */
265
    public function setVerifySsl($verifySsl)
266
    {
267
        $this->verifySsl = (bool)$verifySsl;
268
        return $this;
269
    }
270
271
    /**
272
     * @return int
273
     */
274
    public function getBatchPoolSize()
275
    {
276
        return $this->batchPoolSize;
277
    }
278
279
    /**
280
     * @param int $batchPoolSize
281
     * @return $this
282
     */
283
    public function setBatchPoolSize($batchPoolSize)
284
    {
285
        $this->batchPoolSize = $batchPoolSize;
286
287
        return $this;
288
    }
289
}
290