Skip to main content

What the status and the result contain

The two outputs​

  1. Result: msg.payload holds action and ok: true.
    • For Connect, Disconnect and Reset: endpoint, securityMode, securityPolicy, userIdentityType, userName or userCertificateThumbprint, sessionId, since, revision, warnings (when there are some) and note (for example when Disconnect found the endpoint already disconnected).
    • For Get the settings, Check and Get the status: the fields below.
    • The node removes msg.config from the message.
  2. Error: msg.payload holds action, ok: false and findings. findings is the list of error messages: { field, message }, one for each wrong field. The node also writes the error in the Node-RED log and in the debug sidebar. See Errors.

An error never stops the flow.

Connect​

  1. The node checks the values first. If they are not valid, or if the server does not answer, the running session stays.
  2. The node asks the server for its endpoint list, as Check does. If the server accepts the TCP connection but does not answer this request, Connect continues. It warns (a warning of the node, and warnings in the result). The opening of the session then decides.
  3. The node closes the old session and opens the new one.
  4. If the new session does not open, the node uses the previous settings and the previous revision again. It reports the failure.

The switch has a time limit: it ends within 20 s, whatever the server does.

  • A host that accepts the TCP connection and never answers cannot block the endpoint.
  • A client node can wait for such a host. After 3 s, the endpoint stops this wait.
  • When the time runs out, the node uses the previous settings again. It reports an error message on connection: "the switch did not end within 20 s. The previous settings are in use again."
  • Reset has the same time limit. A message cannot change it.
  • A client node can get one error from the abandoned attempt before it connects again.

Disconnect​

Closes the session. Client nodes report an error until the next Connect or Reset. On an endpoint that is already disconnected, Disconnect succeeds, and the result holds a note that tells it. A msg.config that is not empty gets an error message.

Reset​

Removes all the settings of the messages, a held password included. Then the node connects with the settings of the endpoint.

  • It runs the same checks and the same restore of the previous settings as Connect.
  • It takes no value from the message. A msg.config that is not empty, and a msg.mode, get an error message. msg.ifRevision is used.
  • The values of the dialog do not apply to it. Allowed servers does not apply either: the server of the endpoint is always allowed.

Check (validate)​

A test of Connect. The node makes the same checks and changes nothing. No session opens or closes.

  • The node also asks the server for its endpoint list (GetEndpoints, 5 s limit). It checks that the server offers the security mode, the security policy and the login type. Connect runs the same checks before it switches.
  • The result goes to output 1 with valid (true or false) and findings, the list of error messages, one for each wrong field.
  • effective shows the settings that Connect would use, without secrets, in the shape of msg.config: userIdentityType, userName, maxRetry, initialDelay, maxDelay, namespaceAliases, and subscriptions as [ { id, parameters } ]. A dashboard can send it back as msg.config. It holds no secret, so the login still needs the password.
  • serverEndpoints lists what the server offers.
  • A server that does not answer GetEndpoints gives an error message on endpoint.
  • One Check runs at a time for each endpoint. While one runs, another gets an error message on validate and starts no request to the server.

Get the settings (get)​

Sends the settings that the endpoint uses. It changes nothing.

  • revision: the number of the settings. It changes with each switch.
  • connection: link (active, switching or disconnected) and session (connected, reconnecting or not connected), with sessionId when connected.
  • settings: endpoint, securityMode, securityPolicy and userIdentityType. Each has its value and its origin: deployed, or overlay when a message set it.
  • identityInfo: the login in use, with its origin.
    • It holds userIdentityType, userName, hasPassword, hasUserCertificate, hasPrivateKey, and the public facts of a user certificate (subject, thumbprint, validFrom, validTo).
    • It never holds a password, a passphrase or a key.
    • After a restart, hasPassword: false or hasPrivateKey: false tells the dashboard to ask for the secret again.
  • settings.maxRetry, settings.initialDelay and settings.maxDelay: each with its value, its origin, its min and max, and applied.
  • deployed: the settings of the endpoint node, to compare: endpoint, securityMode, securityPolicy, userIdentityType, identityInfo, maxRetry, initialDelay and maxDelay.
  • subscriptions: each profile of the endpoint as it is now: id, name and all the parameters.
    • It does not have the shape of msg.config. validate.effective.subscriptions has it.
    • readOnly names the fields that no message sets: requestedPublishingInterval, requestedMaxKeepAliveCount and requestedLifetimeCount.
    • settable holds maxNotificationsPerPublish and priority (each with value, origin, min and max), and publishingEnabled (value, origin).
  • allowlist: { active }, true when Allowed servers limits the servers. The rules are not shown.
  • namespaceAliases: the table in use as entries (alias, namespaceUri), with its origin. deployed.namespaceAliases is the table of the endpoint node.

Get the status (status)​

Sends the facts of the live session. It changes nothing. Get the settings gives the settings. Get the status gives what the session uses now.

  • state: connected, reconnecting or not connected. link: active, switching or disconnected.
  • endpoint (without a user name and a password) and revision.
  • With a session: the securityMode and the securityPolicy in use, userIdentityType, userName (for a user name login) or userCertificateThumbprint (for a certificate login), sessionId, and since (when the session opened).

The values come from the open session, not from the settings that were asked for. The node never sends the authentication token of the session, a password or a key. The result of Connect and Reset holds the same facts.

The status of the node​

The status under the node shows the state of the connection, as the status of the events node does:

  • connected · mode/policy · login type, for example connected · SignAndEncrypt/Basic256Sha256 · UserName
  • connecting (or disconnecting)
  • reconnecting · attempt 3, next in 4 s
  • failed
  • disconnected

When the licence refuses an action, the status names the licence.

Client nodes during a switch​

  • The node can close the old session, or use the previous settings again. While it does, each message to a Read, Write, Call or other client node gets a node error. The error says: "the connection is changing to new settings. Try again in a moment." The message is attached, for a Catch node. The node does not keep the message, and it does not answer later.
  • While the new session opens, a client node waits for it and then uses it.
  • After a Disconnect, the error says that an endpoint control node closed the connection. A Connect or Reset to that node opens it again.

Monitor and MonitorEvent nodes during a switch​

They hold a subscription on the session, and they follow the switch with no action from you.

  • While the session changes, they drop their subscription and show switching, or disconnected after a Disconnect.
  • When the new session is open, they subscribe again with the same settings as before. A MonitorEvent node uses the last settings of each node id. They find the node ids with the alias table that is now in use. No new message is necessary.
  • If a Connect fails and the previous settings come back, they subscribe again on those.
  • A Monitor that was stopped with action: "stop" stays stopped.