1 | <?php |
||
12 | class PlatformConfig extends AbstractConfig |
||
13 | { |
||
14 | const DEFAULT_RESPONSE_TIMEOUT = 20; |
||
15 | const PLATFORM_NAME = 'Webservices'; |
||
16 | const RETRY_MINUTES = 60; |
||
17 | |||
18 | /** |
||
19 | * Connection timeout in seconds. |
||
20 | * |
||
21 | * @var int |
||
22 | */ |
||
23 | private $connectionTimeout = 5; |
||
24 | |||
25 | /** |
||
26 | * Webservices provided password (mandatory). |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $password; |
||
31 | |||
32 | /** |
||
33 | * Response timeout in seconds. (Webservices specific). |
||
34 | * |
||
35 | * @var int |
||
36 | */ |
||
37 | private $responseTimeout = self::DEFAULT_RESPONSE_TIMEOUT; |
||
38 | |||
39 | /** |
||
40 | * Threshold when to try server again after failure (in minutes). |
||
41 | * |
||
42 | * @var int |
||
43 | */ |
||
44 | private $retryMinutes = self::RETRY_MINUTES; |
||
45 | |||
46 | /** |
||
47 | * Webservices provided username (mandatory). |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $userName; |
||
52 | |||
53 | /** |
||
54 | * WebservicesConfig constructor. |
||
55 | * |
||
56 | * @param array $settings |
||
57 | * |
||
58 | * @return PlatformConfig |
||
59 | * @throws InputException |
||
60 | */ |
||
61 | public function loadFromArray(array $settings = []) |
||
72 | |||
73 | |||
74 | /** |
||
75 | * Get the connection timeout. |
||
76 | * |
||
77 | * @return int |
||
78 | */ |
||
79 | public function getConnectionTimeout() |
||
83 | |||
84 | /** |
||
85 | * Set connection timeout. |
||
86 | * |
||
87 | * @param int $connectionTimeout |
||
88 | */ |
||
89 | public function setConnectionTimeout($connectionTimeout) |
||
93 | |||
94 | /** |
||
95 | * Get the password. |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public function getPassword() |
||
103 | |||
104 | /** |
||
105 | * Set the password. |
||
106 | * |
||
107 | * @param string $password |
||
108 | */ |
||
109 | public function setPassword($password) |
||
113 | |||
114 | /** |
||
115 | * Return the timeout. |
||
116 | * |
||
117 | * @return int |
||
118 | */ |
||
119 | public function getResponseTimeout() |
||
123 | |||
124 | /** |
||
125 | * Set response timeout. |
||
126 | * |
||
127 | * @param int $responseTimeout |
||
128 | */ |
||
129 | public function setResponseTimeout($responseTimeout) |
||
133 | |||
134 | /** |
||
135 | * Return the retry minutes |
||
136 | * |
||
137 | * @return int |
||
138 | */ |
||
139 | public function getRetryMinutes() |
||
143 | |||
144 | /** |
||
145 | * set retryMinutes. |
||
146 | * |
||
147 | * @param int $retryMinutes |
||
148 | */ |
||
149 | public function setRetryMinutes($retryMinutes) |
||
153 | |||
154 | /** |
||
155 | * Return the username. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | public function getUserName() |
||
163 | |||
164 | /** |
||
165 | * Set username. |
||
166 | * |
||
167 | * @param string $userName |
||
168 | */ |
||
169 | public function setUserName($userName) |
||
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | * @return array |
||
177 | */ |
||
178 | public function toArray() |
||
190 | |||
191 | /** |
||
192 | * {@inheritdoc} |
||
193 | * @return string |
||
194 | */ |
||
195 | public function getConnectorName() |
||
199 | } |
||
200 |