-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIConfiguration.php
217 lines (185 loc) · 6.04 KB
/
IConfiguration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
declare(strict_types=1);
namespace phpsap\interfaces\Config;
use phpsap\interfaces\exceptions\IIncompleteConfigException;
use phpsap\interfaces\exceptions\IInvalidArgumentException;
use phpsap\interfaces\Util\IJsonSerializable;
/**
* Interface IConfiguration
*
* Parent class to all configuration types (A and B).
* Configure connection parameters for SAP remote function calls, that are
* common to both connection types (A, and B).
*
* @package phpsap\interfaces\Config
* @author Gregor J.
* @license MIT
*/
interface IConfiguration extends IJsonSerializable
{
/**
* Disable tracing.
*/
public const TRACE_OFF = 0;
/**
* Brief trace level.
*/
public const TRACE_BRIEF = 1;
/**
* Verbose trace level.
*/
public const TRACE_VERBOSE = 2;
/**
* Full trace level.
*/
public const TRACE_FULL = 3;
/**
* The username to use for authentication.
*/
public const JSON_USER = 'user';
/**
* The password to use for authentication.
*/
public const JSON_PASSWD = 'passwd';
/**
* The destination in RfcOpen.
*/
public const JSON_CLIENT = 'client';
/**
* If the connection needs to be made through a firewall using a SAPRouter,
* specify the SAPRouter parameters in the following format:
* /H/hostname/S/portnumber/H/
*/
public const JSON_SAPROUTER = 'saprouter';
/**
* The trace level (0-3). See constants TRACE_*.
*/
public const JSON_TRACE = 'trace';
/**
* Only needed it if you want to connect to a non-Unicode backend using a
* non-ISO-Latin-1 username or password. The RFC library will then use that
* codepage for the initial handshake, thus preserving the characters in
* username/password.
*/
public const JSON_CODEPAGE = 'codepage';
/**
* The logon language.
*/
public const JSON_LANG = 'lang';
/**
* The destination in RfcOpenConnection.
*/
public const JSON_DEST = 'dest';
/**
* Construct a type A or B configuration from an associative array.
* @param array<string, string> $array
*/
public function __construct(array $array);
/**
* Get the username to use for authentication.
* @return string The username.
* @throws IIncompleteConfigException
*/
public function getUser(): string;
/**
* Set the username to use for authentication.
* @param string $user The username.
* @return $this
* @throws IInvalidArgumentException
*/
public function setUser(string $user): IConfiguration;
/**
* Get the password to use for authentication.
* @return string The password.
* @throws IIncompleteConfigException
*/
public function getPasswd(): string;
/**
* Set the password to use for authentication.
* @param string $passwd The password.
* @return $this
* @throws IInvalidArgumentException
*/
public function setPasswd(string $passwd): IConfiguration;
/**
* Get the client.
* @return string The client
* @throws IIncompleteConfigException
*/
public function getClient(): string;
/**
* Set the client.
* @param string $client The client.
* @return $this
* @throws IInvalidArgumentException
*/
public function setClient(string $client): IConfiguration;
/**
* Get the SAPRouter in case the connection needs to be made through a firewall.
* @return string|null The saprouter or NULL in case the saprouter hasn't been set.
*/
public function getSaprouter(): ?string;
/**
* In case the connection needs to be made through a firewall using a SAPRouter,
* specify the SAPRouter parameters in the following format:
* /H/hostname/S/portnumber/H/
* @param string $saprouter The saprouter.
* @return $this
* @throws IInvalidArgumentException
*/
public function setSaprouter(string $saprouter): IConfiguration;
/**
* Get the trace level. See constants TRACE_*.
* @return int|null The trace level or NULL in case the trace level hasn't been set.
*/
public function getTrace(): ?int;
/**
* Set the trace level. See constants TRACE_*.
* @param int $trace The trace level.
* @return $this
* @throws IInvalidArgumentException
*/
public function setTrace(int $trace): IConfiguration;
/**
* Only needed it if you want to connect to a non-Unicode backend using a
* non-ISO-Latin-1 username or password. The RFC library will then use that
* codepage for the initial handshake, thus preserving the characters in
* username/password.
* @return int|null The codepage or NULL in case the codepage hasn't been set.
*/
public function getCodepage(): ?int;
/**
* Only needed it if you want to connect to a non-Unicode backend using a
* non-ISO-Latin-1 username or password. The RFC library will then use that
* codepage for the initial handshake, thus preserving the characters in
* username/password.
* @param int $codepage The codepage.
* @return $this
* @throws IInvalidArgumentException
*/
public function setCodepage(int $codepage): IConfiguration;
/**
* Get the logon Language.
* @return string|null The logon language or NULL in case the logon language hasn't been set.
*/
public function getLang(): ?string;
/**
* Set the logon language.
* @param string $lang The logon language.
* @return $this
* @throws IInvalidArgumentException
*/
public function setLang(string $lang): IConfiguration;
/**
* Get the destination in RfcOpenConnection.
* @return string|null The destination or NULL in case the destination hasn't been set.
*/
public function getDest(): ?string;
/**
* Set the destination in RfcOpenConnection.
* @param string $dest The destination in RfcOpenConnection.
* @return $this
* @throws IInvalidArgumentException
*/
public function setDest(string $dest): IConfiguration;
}