node-opcua-server 2.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/.mocharc.yml +10 -0
  2. package/LICENSE +20 -0
  3. package/dist/base_server.d.ts +110 -0
  4. package/dist/base_server.js +476 -0
  5. package/dist/base_server.js.map +1 -0
  6. package/dist/factory.d.ts +10 -0
  7. package/dist/factory.js +24 -0
  8. package/dist/factory.js.map +1 -0
  9. package/dist/history_server_capabilities.d.ts +35 -0
  10. package/dist/history_server_capabilities.js +44 -0
  11. package/dist/history_server_capabilities.js.map +1 -0
  12. package/dist/i_channel_data.d.ts +13 -0
  13. package/dist/i_channel_data.js +3 -0
  14. package/dist/i_channel_data.js.map +1 -0
  15. package/dist/i_register_server_manager.d.ts +16 -0
  16. package/dist/i_register_server_manager.js +3 -0
  17. package/dist/i_register_server_manager.js.map +1 -0
  18. package/dist/i_server_side_publish_engine.d.ts +36 -0
  19. package/dist/i_server_side_publish_engine.js +50 -0
  20. package/dist/i_server_side_publish_engine.js.map +1 -0
  21. package/dist/i_socket_data.d.ts +11 -0
  22. package/dist/i_socket_data.js +3 -0
  23. package/dist/i_socket_data.js.map +1 -0
  24. package/dist/index.d.ts +14 -0
  25. package/dist/index.js +27 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/monitored_item.d.ts +173 -0
  28. package/dist/monitored_item.js +1006 -0
  29. package/dist/monitored_item.js.map +1 -0
  30. package/dist/node_sampler.d.ts +3 -0
  31. package/dist/node_sampler.js +76 -0
  32. package/dist/node_sampler.js.map +1 -0
  33. package/dist/opcua_server.d.ts +668 -0
  34. package/dist/opcua_server.js +2407 -0
  35. package/dist/opcua_server.js.map +1 -0
  36. package/dist/queue.d.ts +11 -0
  37. package/dist/queue.js +71 -0
  38. package/dist/queue.js.map +1 -0
  39. package/dist/register_server_manager.d.ts +92 -0
  40. package/dist/register_server_manager.js +574 -0
  41. package/dist/register_server_manager.js.map +1 -0
  42. package/dist/register_server_manager_hidden.d.ts +17 -0
  43. package/dist/register_server_manager_hidden.js +28 -0
  44. package/dist/register_server_manager_hidden.js.map +1 -0
  45. package/dist/register_server_manager_mdns_only.d.ts +19 -0
  46. package/dist/register_server_manager_mdns_only.js +58 -0
  47. package/dist/register_server_manager_mdns_only.js.map +1 -0
  48. package/dist/server_capabilities.d.ts +61 -0
  49. package/dist/server_capabilities.js +109 -0
  50. package/dist/server_capabilities.js.map +1 -0
  51. package/dist/server_end_point.d.ts +180 -0
  52. package/dist/server_end_point.js +825 -0
  53. package/dist/server_end_point.js.map +1 -0
  54. package/dist/server_engine.d.ts +311 -0
  55. package/dist/server_engine.js +1659 -0
  56. package/dist/server_engine.js.map +1 -0
  57. package/dist/server_publish_engine.d.ts +109 -0
  58. package/dist/server_publish_engine.js +531 -0
  59. package/dist/server_publish_engine.js.map +1 -0
  60. package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +16 -0
  61. package/dist/server_publish_engine_for_orphan_subscriptions.js +50 -0
  62. package/dist/server_publish_engine_for_orphan_subscriptions.js.map +1 -0
  63. package/dist/server_session.d.ts +176 -0
  64. package/dist/server_session.js +734 -0
  65. package/dist/server_session.js.map +1 -0
  66. package/dist/server_subscription.d.ts +393 -0
  67. package/dist/server_subscription.js +1313 -0
  68. package/dist/server_subscription.js.map +1 -0
  69. package/dist/sessions_compatible_for_transfer.d.ts +2 -0
  70. package/dist/sessions_compatible_for_transfer.js +36 -0
  71. package/dist/sessions_compatible_for_transfer.js.map +1 -0
  72. package/dist/validate_filter.d.ts +5 -0
  73. package/dist/validate_filter.js +64 -0
  74. package/dist/validate_filter.js.map +1 -0
  75. package/package.json +88 -0
  76. package/source/base_server.ts +617 -0
  77. package/source/factory.ts +25 -0
  78. package/source/history_server_capabilities.ts +75 -0
  79. package/source/i_channel_data.ts +17 -0
  80. package/source/i_register_server_manager.ts +24 -0
  81. package/source/i_server_side_publish_engine.ts +77 -0
  82. package/source/i_socket_data.ts +11 -0
  83. package/source/index.ts +14 -0
  84. package/source/monitored_item.ts +1303 -0
  85. package/source/node_sampler.ts +82 -0
  86. package/source/opcua_server.ts +3742 -0
  87. package/source/queue.ts +73 -0
  88. package/source/register_server_manager.ts +744 -0
  89. package/source/register_server_manager_hidden.ts +33 -0
  90. package/source/register_server_manager_mdns_only.ts +69 -0
  91. package/source/server_capabilities.ts +177 -0
  92. package/source/server_end_point.ts +1182 -0
  93. package/source/server_engine.ts +2167 -0
  94. package/source/server_publish_engine.ts +657 -0
  95. package/source/server_publish_engine_for_orphan_subscriptions.ts +52 -0
  96. package/source/server_session.ts +931 -0
  97. package/source/server_subscription.ts +1792 -0
  98. package/source/sessions_compatible_for_transfer.ts +33 -0
  99. package/source/validate_filter.ts +86 -0
  100. package/test_helpers/create_certificates.js +1 -0
@@ -0,0 +1,574 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterServerManager = exports.RegisterServerManagerStatus = void 0;
4
+ /**
5
+ * @module node-opcua-server
6
+ */
7
+ // tslint:disable:no-console
8
+ const async = require("async");
9
+ const chalk = require("chalk");
10
+ const events_1 = require("events");
11
+ const node_opcua_assert_1 = require("node-opcua-assert");
12
+ const node_opcua_client_1 = require("node-opcua-client");
13
+ const node_opcua_debug_1 = require("node-opcua-debug");
14
+ const node_opcua_hostname_1 = require("node-opcua-hostname");
15
+ const node_opcua_secure_channel_1 = require("node-opcua-secure-channel");
16
+ const node_opcua_service_discovery_1 = require("node-opcua-service-discovery");
17
+ const node_opcua_types_1 = require("node-opcua-types");
18
+ const node_opcua_crypto_1 = require("node-opcua-crypto");
19
+ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
20
+ const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
21
+ const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
22
+ var RegisterServerManagerStatus;
23
+ (function (RegisterServerManagerStatus) {
24
+ RegisterServerManagerStatus[RegisterServerManagerStatus["INACTIVE"] = 1] = "INACTIVE";
25
+ RegisterServerManagerStatus[RegisterServerManagerStatus["INITIALIZING"] = 2] = "INITIALIZING";
26
+ RegisterServerManagerStatus[RegisterServerManagerStatus["REGISTERING"] = 3] = "REGISTERING";
27
+ RegisterServerManagerStatus[RegisterServerManagerStatus["WAITING"] = 4] = "WAITING";
28
+ RegisterServerManagerStatus[RegisterServerManagerStatus["UNREGISTERING"] = 5] = "UNREGISTERING";
29
+ })(RegisterServerManagerStatus = exports.RegisterServerManagerStatus || (exports.RegisterServerManagerStatus = {}));
30
+ const g_DefaultRegistrationServerTimeout = 8 * 60 * 1000; // 8 minutes
31
+ function securityPolicyLevel(securityPolicy) {
32
+ switch (securityPolicy) {
33
+ case node_opcua_secure_channel_1.SecurityPolicy.None:
34
+ return 0;
35
+ case node_opcua_secure_channel_1.SecurityPolicy.Basic128:
36
+ return 1;
37
+ case node_opcua_secure_channel_1.SecurityPolicy.Basic128Rsa15:
38
+ return 2;
39
+ case node_opcua_secure_channel_1.SecurityPolicy.Basic192:
40
+ return 3;
41
+ case node_opcua_secure_channel_1.SecurityPolicy.Basic192Rsa15:
42
+ return 4;
43
+ case node_opcua_secure_channel_1.SecurityPolicy.Basic256:
44
+ return 5;
45
+ case node_opcua_secure_channel_1.SecurityPolicy.Basic256Rsa15:
46
+ return 6;
47
+ case node_opcua_secure_channel_1.SecurityPolicy.Basic256Sha256:
48
+ return 7;
49
+ case node_opcua_secure_channel_1.SecurityPolicy.Aes128_Sha256_RsaOaep:
50
+ default:
51
+ return 0;
52
+ }
53
+ }
54
+ function sortEndpointBySecurityLevel(endpoints) {
55
+ endpoints.sort((a, b) => {
56
+ if (a.securityMode === b.securityMode) {
57
+ if (a.securityPolicyUri === b.securityPolicyUri) {
58
+ const sa = a.securityLevel;
59
+ const sb = b.securityLevel;
60
+ return sa < sb ? 1 : sa > sb ? -1 : 0;
61
+ }
62
+ else {
63
+ const sa = securityPolicyLevel(a.securityPolicyUri);
64
+ const sb = securityPolicyLevel(b.securityPolicyUri);
65
+ return sa < sb ? 1 : sa > sb ? -1 : 0;
66
+ }
67
+ }
68
+ else {
69
+ return a.securityMode < b.securityMode ? 1 : 0;
70
+ }
71
+ });
72
+ return endpoints;
73
+ }
74
+ function findSecureEndpoint(endpoints) {
75
+ // we only care about binary tcp transport endpoint
76
+ endpoints = endpoints.filter((e) => {
77
+ return e.transportProfileUri === "http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary";
78
+ });
79
+ endpoints = endpoints.filter((e) => {
80
+ return e.securityMode === node_opcua_secure_channel_1.MessageSecurityMode.SignAndEncrypt;
81
+ });
82
+ if (endpoints.length === 0) {
83
+ endpoints = endpoints.filter((e) => {
84
+ return e.securityMode === node_opcua_secure_channel_1.MessageSecurityMode.Sign;
85
+ });
86
+ }
87
+ if (endpoints.length === 0) {
88
+ endpoints = endpoints.filter((e) => {
89
+ return e.securityMode === node_opcua_secure_channel_1.MessageSecurityMode.None;
90
+ });
91
+ }
92
+ endpoints = sortEndpointBySecurityLevel(endpoints);
93
+ return endpoints[0];
94
+ }
95
+ function constructRegisteredServer(server, isOnline) {
96
+ var _a, _b, _c;
97
+ const discoveryUrls = server.getDiscoveryUrls();
98
+ (0, node_opcua_assert_1.assert)(!isOnline || discoveryUrls.length >= 1, "expecting some discoveryUrls if we go online ....");
99
+ const info = (0, node_opcua_crypto_1.exploreCertificate)(server.getCertificate());
100
+ const commonName = info.tbsCertificate.subject.commonName;
101
+ const serverUri = (_a = info.tbsCertificate.extensions) === null || _a === void 0 ? void 0 : _a.subjectAltName.uniformResourceIdentifier[0];
102
+ // istanbul ignore next
103
+ if (serverUri !== server.serverInfo.applicationUri) {
104
+ warningLog(chalk.yellow("Warning certificate uniformResourceIdentifier doesn't match serverInfo.applicationUri"), "\n subjectKeyIdentifier : ", (_b = info.tbsCertificate.extensions) === null || _b === void 0 ? void 0 : _b.subjectKeyIdentifier, "\n subjectAltName : ", (_c = info.tbsCertificate.extensions) === null || _c === void 0 ? void 0 : _c.subjectAltName, "\n commonName : ", info.tbsCertificate.subject.commonName, "\n serverInfo.applicationUri : ", server.serverInfo.applicationUri);
105
+ }
106
+ // istanbul ignore next
107
+ if (!server.serverInfo.applicationName.text) {
108
+ debugLog("warning: application name is missing");
109
+ }
110
+ // The globally unique identifier for the Server instance. The serverUri matches
111
+ // the applicationUri from the ApplicationDescription defined in 7.1.
112
+ const s = {
113
+ serverUri: server.serverInfo.applicationUri,
114
+ // The globally unique identifier for the Server product.
115
+ productUri: server.serverInfo.productUri,
116
+ serverNames: [
117
+ {
118
+ locale: "en-US",
119
+ text: server.serverInfo.applicationName.text
120
+ }
121
+ ],
122
+ serverType: server.serverType,
123
+ discoveryUrls,
124
+ gatewayServerUri: null,
125
+ isOnline,
126
+ semaphoreFilePath: null
127
+ };
128
+ return s;
129
+ }
130
+ function constructRegisterServerRequest(serverB, isOnline) {
131
+ const server = constructRegisteredServer(serverB, isOnline);
132
+ return new node_opcua_service_discovery_1.RegisterServerRequest({
133
+ server
134
+ });
135
+ }
136
+ function constructRegisterServer2Request(serverB, isOnline) {
137
+ const server = constructRegisteredServer(serverB, isOnline);
138
+ return new node_opcua_service_discovery_1.RegisterServer2Request({
139
+ discoveryConfiguration: [
140
+ new node_opcua_types_1.MdnsDiscoveryConfiguration({
141
+ mdnsServerName: serverB.serverInfo.applicationUri,
142
+ serverCapabilities: serverB.capabilitiesForMDNS
143
+ })
144
+ ],
145
+ server
146
+ });
147
+ }
148
+ const no_reconnect_connectivity_strategy = {
149
+ initialDelay: 2000,
150
+ maxDelay: 50000,
151
+ maxRetry: 1,
152
+ randomisationFactor: 0
153
+ };
154
+ const infinite_connectivity_strategy = {
155
+ initialDelay: 2000,
156
+ maxDelay: 50000,
157
+ maxRetry: 10000000,
158
+ randomisationFactor: 0
159
+ };
160
+ function sendRegisterServerRequest(server, client, isOnline, callback) {
161
+ // try to send a RegisterServer2Request
162
+ const request = constructRegisterServer2Request(server, isOnline);
163
+ client.performMessageTransaction(request, (err, response) => {
164
+ if (!err) {
165
+ // RegisterServerResponse
166
+ debugLog("RegisterServerManager#_registerServer sendRegisterServer2Request has succeeded (isOnline", isOnline, ")");
167
+ (0, node_opcua_assert_1.assert)(response instanceof node_opcua_service_discovery_1.RegisterServer2Response);
168
+ callback(err);
169
+ }
170
+ else {
171
+ debugLog("RegisterServerManager#_registerServer sendRegisterServer2Request has failed " + "(isOnline", isOnline, ")");
172
+ debugLog("RegisterServerManager#_registerServer" + " falling back to using sendRegisterServerRequest instead");
173
+ // fall back to
174
+ const request1 = constructRegisterServerRequest(server, isOnline);
175
+ client.performMessageTransaction(request1, (err1, response1) => {
176
+ if (!err1) {
177
+ debugLog("RegisterServerManager#_registerServer sendRegisterServerRequest " + "has succeeded (isOnline", isOnline, ")");
178
+ (0, node_opcua_assert_1.assert)(response1 instanceof node_opcua_service_discovery_1.RegisterServerResponse);
179
+ }
180
+ else {
181
+ debugLog("RegisterServerManager#_registerServer sendRegisterServerRequest " + "has failed (isOnline", isOnline, ")");
182
+ }
183
+ callback(err1);
184
+ });
185
+ }
186
+ });
187
+ }
188
+ /**
189
+ * RegisterServerManager is responsible to Register an opcua server on a LDS or LDS-ME server
190
+ * This class takes in charge :
191
+ * - the initial registration of a server
192
+ * - the regular registration renewal (every 8 minutes or so ...)
193
+ * - dealing with cases where LDS is not up and running when server starts.
194
+ * ( in this case the connection will be continuously attempted using the infinite
195
+ * back-off strategy
196
+ * - the un-registration of the server ( during shutdown for instance)
197
+ *
198
+ * Events:
199
+ *
200
+ * Emitted when the server is trying to registered the LDS
201
+ * but when the connection to the lds has failed
202
+ * serverRegistrationPending is sent when the backoff signal of the
203
+ * connection process is rained
204
+ * @event serverRegistrationPending
205
+ *
206
+ * emitted when the server is successfully registered to the LDS
207
+ * @event serverRegistered
208
+ *
209
+ * emitted when the server has successfully renewed its registration to the LDS
210
+ * @event serverRegistrationRenewed
211
+ *
212
+ * emitted when the server is successfully unregistered to the LDS
213
+ * ( for instance during shutdown)
214
+ * @event serverUnregistered
215
+ *
216
+ *
217
+ * (LDS => Local Discovery Server)
218
+ * @param options
219
+ * @param options.server {OPCUAServer}
220
+ * @param options.discoveryServerEndpointUrl {String}
221
+ * @constructor
222
+ */
223
+ class RegisterServerManager extends events_1.EventEmitter {
224
+ constructor(options) {
225
+ super();
226
+ this.state = RegisterServerManagerStatus.INACTIVE;
227
+ this._registration_client = null;
228
+ this._serverEndpoints = [];
229
+ this.server = options.server;
230
+ this._setState(RegisterServerManagerStatus.INACTIVE);
231
+ this.timeout = g_DefaultRegistrationServerTimeout;
232
+ this.discoveryServerEndpointUrl = options.discoveryServerEndpointUrl || "opc.tcp://localhost:4840";
233
+ (0, node_opcua_assert_1.assert)(typeof this.discoveryServerEndpointUrl === "string");
234
+ this._registrationTimerId = null;
235
+ }
236
+ dispose() {
237
+ this.server = null;
238
+ debugLog("RegisterServerManager#dispose", this.state.toString());
239
+ (0, node_opcua_assert_1.assert)(this.state === RegisterServerManagerStatus.INACTIVE);
240
+ (0, node_opcua_assert_1.assert)(this._registrationTimerId === null, "stop has not been called");
241
+ this.removeAllListeners();
242
+ }
243
+ _emitEvent(eventName) {
244
+ setImmediate(() => {
245
+ this.emit(eventName);
246
+ });
247
+ }
248
+ _setState(status) {
249
+ const previousState = this.state || RegisterServerManagerStatus.INACTIVE;
250
+ debugLog("RegisterServerManager#setState : ", RegisterServerManagerStatus[previousState], " => ", RegisterServerManagerStatus[status]);
251
+ this.state = status;
252
+ }
253
+ start(callback) {
254
+ debugLog("RegisterServerManager#start");
255
+ if (this.state !== RegisterServerManagerStatus.INACTIVE) {
256
+ return callback(new Error("RegisterServer process already started")); // already started
257
+ }
258
+ this.discoveryServerEndpointUrl = (0, node_opcua_hostname_1.resolveFullyQualifiedDomainName)(this.discoveryServerEndpointUrl);
259
+ // perform initial registration + automatic renewal
260
+ this._establish_initial_connection((err) => {
261
+ if (err) {
262
+ debugLog("RegisterServerManager#start => _establish_initial_connection has failed");
263
+ return callback(err);
264
+ }
265
+ if (this.state !== RegisterServerManagerStatus.INITIALIZING) {
266
+ debugLog("RegisterServerManager#start => _establish_initial_connection has failed");
267
+ return callback();
268
+ }
269
+ this._registerServer(true, (err1) => {
270
+ if (this.state !== RegisterServerManagerStatus.REGISTERING) {
271
+ debugLog("RegisterServerManager#start )=> Registration has been cancelled");
272
+ return callback(new Error("Registration has been cancelled"));
273
+ }
274
+ if (err1) {
275
+ warningLog("RegisterServerManager#start - registering server has failed ! \n" +
276
+ "please check that your server certificate is accepted by the LDS");
277
+ this._setState(RegisterServerManagerStatus.INACTIVE);
278
+ this._emitEvent("serverRegistrationFailure");
279
+ }
280
+ else {
281
+ this._emitEvent("serverRegistered");
282
+ this._setState(RegisterServerManagerStatus.WAITING);
283
+ this._trigger_next();
284
+ }
285
+ callback();
286
+ });
287
+ });
288
+ }
289
+ _establish_initial_connection(outer_callback) {
290
+ var _a;
291
+ /* istanbul ignore next */
292
+ if (!this.server) {
293
+ throw new Error("Internal Error");
294
+ }
295
+ debugLog("RegisterServerManager#_establish_initial_connection");
296
+ (0, node_opcua_assert_1.assert)(!this._registration_client);
297
+ (0, node_opcua_assert_1.assert)(typeof this.discoveryServerEndpointUrl === "string");
298
+ (0, node_opcua_assert_1.assert)(this.state === RegisterServerManagerStatus.INACTIVE);
299
+ this._setState(RegisterServerManagerStatus.INITIALIZING);
300
+ this.selectedEndpoint = undefined;
301
+ const applicationName = ((_a = (0, node_opcua_client_1.coerceLocalizedText)(this.server.serverInfo.applicationName)) === null || _a === void 0 ? void 0 : _a.text) || undefined;
302
+ // Retry Strategy must be set
303
+ this.server.serverCertificateManager.referenceCounter++;
304
+ const registrationClient = node_opcua_client_1.OPCUAClientBase.create({
305
+ clientName: this.server.serverInfo.applicationUri,
306
+ applicationName,
307
+ applicationUri: this.server.serverInfo.applicationUri,
308
+ connectionStrategy: infinite_connectivity_strategy,
309
+ clientCertificateManager: this.server.serverCertificateManager,
310
+ certificateFile: this.server.certificateFile,
311
+ privateKeyFile: this.server.privateKeyFile
312
+ });
313
+ this._registration_client = registrationClient;
314
+ registrationClient.on("backoff", (nbRetry, delay) => {
315
+ debugLog("RegisterServerManager - received backoff");
316
+ warningLog(chalk.bgWhite.cyan("contacting discovery server backoff "), this.discoveryServerEndpointUrl, " attempt #", nbRetry, " retrying in ", delay / 1000.0, " seconds");
317
+ this._emitEvent("serverRegistrationPending");
318
+ });
319
+ async.series([
320
+ // do_initial_connection_with_discovery_server
321
+ (callback) => {
322
+ registrationClient.connect(this.discoveryServerEndpointUrl, (err) => {
323
+ if (err) {
324
+ debugLog("RegisterServerManager#_establish_initial_connection " + ": initial connection to server has failed");
325
+ // xx debugLog(err);
326
+ }
327
+ return callback(err);
328
+ });
329
+ },
330
+ // getEndpoints_on_discovery_server
331
+ (callback) => {
332
+ registrationClient.getEndpoints((err, endpoints) => {
333
+ if (!err) {
334
+ const endpoint = findSecureEndpoint(endpoints);
335
+ if (!endpoint) {
336
+ throw new Error("Cannot find Secure endpoint");
337
+ }
338
+ if (endpoint.serverCertificate) {
339
+ (0, node_opcua_assert_1.assert)(endpoint.serverCertificate);
340
+ this.selectedEndpoint = endpoint;
341
+ }
342
+ else {
343
+ this.selectedEndpoint = undefined;
344
+ }
345
+ }
346
+ else {
347
+ debugLog("RegisterServerManager#_establish_initial_connection " + ": getEndpointsRequest has failed");
348
+ debugLog(err);
349
+ }
350
+ callback(err);
351
+ });
352
+ },
353
+ // function closing_discovery_server_connection
354
+ (callback) => {
355
+ this._serverEndpoints = registrationClient._serverEndpoints;
356
+ registrationClient.disconnect((err) => {
357
+ this._registration_client = null;
358
+ callback(err);
359
+ });
360
+ },
361
+ // function wait_a_little_bit
362
+ (callback) => {
363
+ setTimeout(callback, 100);
364
+ }
365
+ ], (err) => {
366
+ debugLog("-------------------------------", !!err);
367
+ if (this.state !== RegisterServerManagerStatus.INITIALIZING) {
368
+ debugLog("RegisterServerManager#_establish_initial_connection has been interrupted ", RegisterServerManagerStatus[this.state]);
369
+ this._setState(RegisterServerManagerStatus.INACTIVE);
370
+ if (this._registration_client) {
371
+ this._registration_client.disconnect((err2) => {
372
+ this._registration_client = null;
373
+ outer_callback(new Error("Initialization has been canceled"));
374
+ });
375
+ }
376
+ else {
377
+ outer_callback(new Error("Initialization has been canceled"));
378
+ }
379
+ return;
380
+ }
381
+ if (err) {
382
+ this._setState(RegisterServerManagerStatus.INACTIVE);
383
+ if (this._registration_client) {
384
+ this._registration_client.disconnect((err1) => {
385
+ this._registration_client = null;
386
+ debugLog("#######", !!err1);
387
+ outer_callback(err);
388
+ });
389
+ return;
390
+ }
391
+ }
392
+ outer_callback();
393
+ });
394
+ }
395
+ _trigger_next() {
396
+ (0, node_opcua_assert_1.assert)(!this._registrationTimerId);
397
+ (0, node_opcua_assert_1.assert)(this.state === RegisterServerManagerStatus.WAITING);
398
+ // from spec 1.04 part 4:
399
+ // The registration process is designed to be platform independent, robust and able to minimize
400
+ // problems created by configuration errors. For that reason, Servers shall register themselves more
401
+ // than once.
402
+ // Under normal conditions, manually launched Servers shall periodically register with the Discovery
403
+ // Server as long as they are able to receive connections from Clients. If a Server goes offline then it
404
+ // shall register itself once more and indicate that it is going offline. The registration frequency
405
+ // should be configurable; however, the maximum is 10 minutes. If an error occurs during registration
406
+ // (e.g. the Discovery Server is not running) then the Server shall periodically re-attempt registration.
407
+ // The frequency of these attempts should start at 1 second but gradually increase until the
408
+ // registration frequency is the same as what it would be if no errors occurred. The recommended
409
+ // approach would be to double the period of each attempt until reaching the maximum.
410
+ // When an automatically launched Server (or its install program) registers with the Discovery Server
411
+ // it shall provide a path to a semaphore file which the Discovery Server can use to determine if the
412
+ // Server has been uninstalled from the machine. The Discovery Server shall have read access to
413
+ // the file system that contains the file
414
+ // install a registration
415
+ debugLog("RegisterServerManager#_trigger_next " + ": installing timeout to perform registerServer renewal (timeout =", this.timeout, ")");
416
+ this._registrationTimerId = setTimeout(() => {
417
+ if (!this._registrationTimerId) {
418
+ debugLog("RegisterServerManager => cancelling re registration");
419
+ return;
420
+ }
421
+ this._registrationTimerId = null;
422
+ debugLog("RegisterServerManager#_trigger_next : renewing RegisterServer");
423
+ this._registerServer(true, (err) => {
424
+ if (this.state !== RegisterServerManagerStatus.INACTIVE &&
425
+ this.state !== RegisterServerManagerStatus.UNREGISTERING) {
426
+ debugLog("RegisterServerManager#_trigger_next : renewed !", err);
427
+ this._setState(RegisterServerManagerStatus.WAITING);
428
+ this._emitEvent("serverRegistrationRenewed");
429
+ this._trigger_next();
430
+ }
431
+ });
432
+ }, this.timeout);
433
+ }
434
+ stop(callback) {
435
+ debugLog("RegisterServerManager#stop");
436
+ if (this._registrationTimerId) {
437
+ debugLog("RegisterServerManager#stop :clearing timeout");
438
+ clearTimeout(this._registrationTimerId);
439
+ this._registrationTimerId = null;
440
+ }
441
+ this._cancel_pending_client_if_any(() => {
442
+ debugLog("RegisterServerManager#stop _cancel_pending_client_if_any done ", this.state);
443
+ if (!this.selectedEndpoint || this.state === RegisterServerManagerStatus.INACTIVE) {
444
+ this.state = RegisterServerManagerStatus.INACTIVE;
445
+ (0, node_opcua_assert_1.assert)(this._registrationTimerId === null);
446
+ return callback();
447
+ }
448
+ this._registerServer(false, () => {
449
+ this._setState(RegisterServerManagerStatus.INACTIVE);
450
+ this._emitEvent("serverUnregistered");
451
+ callback();
452
+ });
453
+ });
454
+ }
455
+ /**
456
+ * @param isOnline
457
+ * @param outer_callback
458
+ * @private
459
+ */
460
+ _registerServer(isOnline, outer_callback) {
461
+ var _a, _b;
462
+ (0, node_opcua_assert_1.assert)(typeof outer_callback === "function");
463
+ debugLog("RegisterServerManager#_registerServer isOnline:", isOnline, "selectedEndpoint: ", (_a = this.selectedEndpoint) === null || _a === void 0 ? void 0 : _a.endpointUrl);
464
+ (0, node_opcua_assert_1.assert)(this.selectedEndpoint, "must have a selected endpoint => please call _establish_initial_connection");
465
+ (0, node_opcua_assert_1.assert)(this.server.serverType !== undefined, " must have a valid server Type");
466
+ // construct connection
467
+ const server = this.server;
468
+ const selectedEndpoint = this.selectedEndpoint;
469
+ if (!selectedEndpoint) {
470
+ warningLog("Warning : cannot register server - no endpoint available");
471
+ return outer_callback(new Error("Cannot registerServer"));
472
+ }
473
+ server.serverCertificateManager.referenceCounter++;
474
+ const applicationName = ((_b = (0, node_opcua_client_1.coerceLocalizedText)(server.serverInfo.applicationName)) === null || _b === void 0 ? void 0 : _b.text) || undefined;
475
+ const theStatus = isOnline ? RegisterServerManagerStatus.REGISTERING : RegisterServerManagerStatus.UNREGISTERING;
476
+ if (theStatus === this.state) {
477
+ warningLog(`Warning the server is already in the ${RegisterServerManagerStatus[theStatus]} state`);
478
+ return outer_callback();
479
+ }
480
+ (0, node_opcua_assert_1.assert)(this.state === RegisterServerManagerStatus.INITIALIZING || this.state === RegisterServerManagerStatus.WAITING);
481
+ this._setState(theStatus);
482
+ if (this._registration_client) {
483
+ warningLog(`Warning there is already a registering/unregistering task taking place: ${RegisterServerManagerStatus[this.state]} state`);
484
+ }
485
+ const options = {
486
+ securityMode: selectedEndpoint.securityMode,
487
+ securityPolicy: (0, node_opcua_secure_channel_1.coerceSecurityPolicy)(selectedEndpoint.securityPolicyUri),
488
+ serverCertificate: selectedEndpoint.serverCertificate,
489
+ clientCertificateManager: server.serverCertificateManager,
490
+ certificateFile: server.certificateFile,
491
+ privateKeyFile: server.privateKeyFile,
492
+ // xx clientName: server.serverInfo.applicationUri!,
493
+ applicationName,
494
+ applicationUri: server.serverInfo.applicationUri,
495
+ connectionStrategy: no_reconnect_connectivity_strategy,
496
+ clientName: "server client to LDS " + RegisterServerManagerStatus[theStatus],
497
+ };
498
+ const client = node_opcua_client_1.OPCUAClientBase.create(options);
499
+ const tmp = this._serverEndpoints;
500
+ client._serverEndpoints = tmp;
501
+ this._registration_client = client;
502
+ debugLog(" lds endpoint uri : ", selectedEndpoint.endpointUrl);
503
+ debugLog(" securityMode : ", node_opcua_secure_channel_1.MessageSecurityMode[selectedEndpoint.securityMode]);
504
+ debugLog(" securityPolicy : ", selectedEndpoint.securityPolicyUri);
505
+ async.series([
506
+ // establish_connection_with_lds
507
+ (callback) => {
508
+ client.connect(selectedEndpoint === null || selectedEndpoint === void 0 ? void 0 : selectedEndpoint.endpointUrl, (err) => {
509
+ debugLog("establish_connection_with_lds => err = ", err);
510
+ if (err) {
511
+ debugLog("RegisterServerManager#_registerServer connection to client has failed");
512
+ debugLog("RegisterServerManager#_registerServer " +
513
+ "=> please check that you server certificate is trusted by the LDS");
514
+ warningLog("RegisterServer to the LDS has failed during secure connection " +
515
+ "=> please check that you server certificate is trusted by the LDS.", "\nerr: " + err.message, "\nLDS endpoint :", selectedEndpoint === null || selectedEndpoint === void 0 ? void 0 : selectedEndpoint.endpointUrl, "\nsecurity mode :", node_opcua_secure_channel_1.MessageSecurityMode[selectedEndpoint.securityMode], "\nsecurity policy :", (0, node_opcua_secure_channel_1.coerceSecurityPolicy)(selectedEndpoint.securityPolicyUri));
516
+ // xx debugLog(options);
517
+ client.disconnect(() => {
518
+ this._registration_client = null;
519
+ debugLog("RegisterServerManager#_registerServer client disconnected");
520
+ callback( /* intentionally no error propagation*/);
521
+ });
522
+ }
523
+ else {
524
+ callback();
525
+ }
526
+ });
527
+ },
528
+ (callback) => {
529
+ if (!this._registration_client) {
530
+ callback();
531
+ return;
532
+ }
533
+ sendRegisterServerRequest(this.server, client, isOnline, (err) => {
534
+ callback( /* intentionally no error propagation*/);
535
+ });
536
+ },
537
+ // close_connection_with_lds
538
+ (callback) => {
539
+ if (!this._registration_client) {
540
+ callback();
541
+ return;
542
+ }
543
+ client.disconnect(callback);
544
+ }
545
+ ], (err) => {
546
+ if (!this._registration_client) {
547
+ debugLog("RegisterServerManager#_registerServer end (isOnline", isOnline, ") has been interrupted");
548
+ outer_callback();
549
+ return;
550
+ }
551
+ this._registration_client.disconnect(() => {
552
+ debugLog("RegisterServerManager#_registerServer end (isOnline", isOnline, ")");
553
+ this._registration_client = null;
554
+ outer_callback(err);
555
+ });
556
+ });
557
+ }
558
+ _cancel_pending_client_if_any(callback) {
559
+ debugLog("RegisterServerManager#_cancel_pending_client_if_any");
560
+ if (this._registration_client) {
561
+ debugLog("RegisterServerManager#_cancel_pending_client_if_any " + "=> wee need to disconnect _registration_client");
562
+ this._registration_client.disconnect(() => {
563
+ this._registration_client = null;
564
+ this._cancel_pending_client_if_any(callback);
565
+ });
566
+ }
567
+ else {
568
+ debugLog("RegisterServerManager#_cancel_pending_client_if_any : done");
569
+ callback();
570
+ }
571
+ }
572
+ }
573
+ exports.RegisterServerManager = RegisterServerManager;
574
+ //# sourceMappingURL=register_server_manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register_server_manager.js","sourceRoot":"","sources":["../source/register_server_manager.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,4BAA4B;AAC5B,+BAA+B;AAC/B,+BAA+B;AAC/B,mCAAsC;AAEtC,yDAA2C;AAE3C,yDAO2B;AAC3B,uDAAkF;AAClF,6DAAsE;AACtE,yEAAsG;AACtG,+EAKsC;AACtC,uDAA6H;AAE7H,yDAAuD;AAGvD,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,UAAU,CAAC,CAAC;AAE/C,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACnC,qFAAY,CAAA;IACZ,6FAAgB,CAAA;IAChB,2FAAe,CAAA;IACf,mFAAW,CAAA;IACX,+FAAiB,CAAA;AACrB,CAAC,EANW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAMtC;AAED,MAAM,kCAAkC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAEtE,SAAS,mBAAmB,CAAC,cAAwB;IACjD,QAAQ,cAAc,EAAE;QACpB,KAAK,0CAAc,CAAC,IAAI;YACpB,OAAO,CAAC,CAAC;QACb,KAAK,0CAAc,CAAC,QAAQ;Y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AC,CAAC;gBACpG,cAAc,EAAE,CAAC;gBACjB,OAAO;aACV;YACD,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,EAAE;gBACtC,QAAQ,CAAC,qDAAqD,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;gBAC/E,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;gBACjC,cAAc,CAAC,GAAI,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QAEP,CAAC,CACJ,CAAC;IACN,CAAC;IAEO,6BAA6B,CAAC,QAAoB;QACtD,QAAQ,CAAC,qDAAqD,CAAC,CAAC;QAEhE,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC3B,QAAQ,CAAC,sDAAsD,GAAG,iDAAiD,CAAC,CAAC;YAErH,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,EAAE;gBACtC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;gBACjC,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;SACN;aAAM;YACH,QAAQ,CAAC,4DAA4D,CAAC,CAAC;YACvE,QAAQ,EAAE,CAAC;SACd;IACL,CAAC;CACJ;AAlcD,sDAkcC"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * @module node-opcua-server
4
+ */
5
+ import { EventEmitter } from "events";
6
+ import { IRegisterServerManager } from "./i_register_server_manager";
7
+ /**
8
+ * a IRegisterServerManager that hides the server from any local discover server
9
+ *
10
+ */
11
+ export declare class RegisterServerManagerHidden extends EventEmitter implements IRegisterServerManager {
12
+ discoveryServerEndpointUrl: string;
13
+ constructor(options?: any);
14
+ stop(callback: () => void): void;
15
+ start(callback: () => void): void;
16
+ dispose(): void;
17
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterServerManagerHidden = void 0;
4
+ /**
5
+ * @module node-opcua-server
6
+ */
7
+ const events_1 = require("events");
8
+ /**
9
+ * a IRegisterServerManager that hides the server from any local discover server
10
+ *
11
+ */
12
+ class RegisterServerManagerHidden extends events_1.EventEmitter {
13
+ constructor(options) {
14
+ super();
15
+ this.discoveryServerEndpointUrl = "";
16
+ }
17
+ stop(callback) {
18
+ setImmediate(callback);
19
+ }
20
+ start(callback) {
21
+ setImmediate(callback);
22
+ }
23
+ dispose() {
24
+ //
25
+ }
26
+ }
27
+ exports.RegisterServerManagerHidden = RegisterServerManagerHidden;
28
+ //# sourceMappingURL=register_server_manager_hidden.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register_server_manager_hidden.js","sourceRoot":"","sources":["../source/register_server_manager_hidden.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mCAAsC;AAGtC;;;GAGG;AACH,MAAa,2BACX,SAAQ,qBAAY;IAKlB,YAAY,OAAa;QACrB,KAAK,EAAE,CAAC;QAHL,+BAA0B,GAAW,EAAE,CAAC;IAI/C,CAAC;IAEM,IAAI,CAAC,QAAoB;QAC5B,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,QAAoB;QAC7B,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAEM,OAAO;QACV,EAAE;IACN,CAAC;CAEJ;AAtBD,kEAsBC"}