Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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");
};
/**
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");
}
/**
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;
}
};
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);
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");
};
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;
}
}
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");
}