How to use the node-opcua-address-space.removeElement function in node-opcua-address-space

To help you get started, we’ve selected a few node-opcua-address-space examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server / src / server_engine.js View on Github external
ServerEngine.prototype._unexposeSubscriptionDiagnostics = function (subscription) {

    const engine = this;
    const subscriptionDiagnosticsArray = engine._getServerSubscriptionDiagnosticsArray();
    const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
    assert(subscriptionDiagnostics instanceof SubscriptionDiagnostics);
    if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {

        const node = subscriptionDiagnosticsArray[subscription.id];
        /// console.log("GGGGGGGGGGGGGGGG ServerEngine => **Unexposing** subscription diagnostics =>",subscription.id);
        eoan.removeElement(subscriptionDiagnosticsArray, subscriptionDiagnostics);
        assert(!subscriptionDiagnosticsArray[subscription.id]," subscription node must have been removed from subscriptionDiagnosticsArray");
    }
    debugLog("ServerEngine#_unexposeSubscriptionDiagnostics");
};
/**
github node-opcua / node-opcua / packages / node-opcua-server / source / server_session.ts View on Github external
public _unexposeSubscriptionDiagnostics(subscription: Subscription) {

        const subscriptionDiagnosticsArray = this._getSubscriptionDiagnosticsArray();
        const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
        assert(subscriptionDiagnostics instanceof SubscriptionDiagnosticsDataType);
        if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {
            // console.log("GG => ServerSession **Unexposing** subscription diagnostics =>",
            // subscription.id,"on session", session.nodeId.toString());
            removeElement(subscriptionDiagnosticsArray, subscriptionDiagnostics);
        }
        debugLog("ServerSession#_unexposeSubscriptionDiagnostics");
    }
    /**
github node-opcua / node-opcua / packages / node-opcua-server / src / server_session.js View on Github external
ServerSession.prototype._removeSessionObjectFromAddressSpace = function () {

    const session = this;

    // todo : dump session statistics in a file or somewhere for deeper diagnostic analysis on closed session

    if (!session.addressSpace) {
        return;
    }
    if (session.sessionDiagnostics) {

        const sessionDiagnosticsArray = session.getSessionDiagnosticsArray();
        eoan.removeElement(sessionDiagnosticsArray, session.sessionDiagnostics.$extensionObject);

        session.addressSpace.deleteNode(session.sessionDiagnostics);

        assert(session._sessionDiagnostics.session === session);
        session._sessionDiagnostics.session = null;

        session._sessionDiagnostics = null;
        session.sessionDiagnostics = null;

    }
    if (session.sessionObject) {
        session.addressSpace.deleteNode(session.sessionObject);
        session.sessionObject = null;
    }
};
github node-opcua / node-opcua / packages / node-opcua-server / source / server_session.ts View on Github external
private _removeSessionObjectFromAddressSpace() {

        // todo : dump session statistics in a file or somewhere for deeper diagnostic analysis on closed session

        if (!this.addressSpace) {
            return;
        }
        if (this.sessionDiagnostics) {

            const sessionDiagnosticsArray = this.getSessionDiagnosticsArray()!;
            removeElement(sessionDiagnosticsArray, this.sessionDiagnostics.$extensionObject);

            this.addressSpace.deleteNode(this.sessionDiagnostics);

            assert(this._sessionDiagnostics!.$session === this);
            this._sessionDiagnostics!.$session = null;

            this._sessionDiagnostics = undefined;
            this.sessionDiagnostics = undefined;
        }

        if (this.sessionSecurityDiagnostics) {
            const sessionSecurityDiagnosticsArray = this.getSessionSecurityDiagnosticsArray()!;
            removeElement(sessionSecurityDiagnosticsArray, this.sessionSecurityDiagnostics.$extensionObject);
            
            this.addressSpace.deleteNode(this.sessionSecurityDiagnostics);
github node-opcua / node-opcua / packages / node-opcua-server / src / server_session.js View on Github external
ServerSession.prototype._unexposeSubscriptionDiagnostics = function (subscription) {

    const session = this;
    const subscriptionDiagnosticsArray = session._getSubscriptionDiagnosticsArray();
    const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
    assert(subscriptionDiagnostics instanceof SubscriptionDiagnosticsDataType);
    if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {
        //xx console.log("GGGGGGGGGGGGGGGG => ServerSession **Unexposing** subscription diagnostics =>",subscription.id,"on session", session.nodeId.toString());
        eoan.removeElement(subscriptionDiagnosticsArray, subscriptionDiagnostics);
    }
    debugLog("ServerSession#_unexposeSubscriptionDiagnostics");
};
github node-opcua / node-opcua / packages / node-opcua-server / source / server_session.ts View on Github external
const sessionDiagnosticsArray = this.getSessionDiagnosticsArray()!;
            removeElement(sessionDiagnosticsArray, this.sessionDiagnostics.$extensionObject);

            this.addressSpace.deleteNode(this.sessionDiagnostics);

            assert(this._sessionDiagnostics!.$session === this);
            this._sessionDiagnostics!.$session = null;

            this._sessionDiagnostics = undefined;
            this.sessionDiagnostics = undefined;
        }

        if (this.sessionSecurityDiagnostics) {
            const sessionSecurityDiagnosticsArray = this.getSessionSecurityDiagnosticsArray()!;
            removeElement(sessionSecurityDiagnosticsArray, this.sessionSecurityDiagnostics.$extensionObject);
            
            this.addressSpace.deleteNode(this.sessionSecurityDiagnostics);
            
            assert(this._sessionSecurityDiagnostics!.$session === this);
            this._sessionSecurityDiagnostics!.$session = null;

            this._sessionSecurityDiagnostics = undefined;
            this.sessionSecurityDiagnostics = undefined;
        }
        
        if (this.sessionObject) {
            this.addressSpace.deleteNode(this.sessionObject);
            this.sessionObject = null;
        }
    }
github node-opcua / node-opcua / packages / node-opcua-server / source / server_engine.ts View on Github external
private _unexposeSubscriptionDiagnostics(subscription: Subscription) {

    const subscriptionDiagnosticsArray = this._getServerSubscriptionDiagnosticsArray();
    const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
    assert(subscriptionDiagnostics instanceof SubscriptionDiagnosticsDataType);
    if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {

      const node = (subscriptionDiagnosticsArray as any)[subscription.id];
      removeElement(subscriptionDiagnosticsArray, subscriptionDiagnostics);
      assert(!(subscriptionDiagnosticsArray as any)[subscription.id],
        " subscription node must have been removed from subscriptionDiagnosticsArray");
    }
    debugLog("ServerEngine#_unexposeSubscriptionDiagnostics");
  }