Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public _exposeSubscriptionDiagnostics(subscription: Subscription) {
debugLog("ServerSession#_exposeSubscriptionDiagnostics");
assert(subscription.$session === this);
const subscriptionDiagnosticsArray = this._getSubscriptionDiagnosticsArray();
const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
assert(subscriptionDiagnostics.$subscription === subscription);
if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {
// xx console.log("GG => ServerSession Exposing subscription diagnostics =>",
// subscription.id,"on session", session.nodeId.toString());
addElement(subscriptionDiagnostics, subscriptionDiagnosticsArray);
}
}
this.sessionSecurityDiagnostics = sessionSecurityDiagnosticsType.instantiate({
browseName: new QualifiedName({ name: "SessionSecurityDiagnostics", namespaceIndex: 0 }),
componentOf: this.sessionObject,
extensionObject: this._sessionSecurityDiagnostics,
minimumSamplingInterval: 2000 // 2 seconds
}) as UASessionSecurityDiagnostics;
ensureObjectIsSecure(this.sessionSecurityDiagnostics);
this._sessionSecurityDiagnostics = this.sessionSecurityDiagnostics.$extensionObject as SessionSecurityDiagnosticsDataTypeEx;
assert(this._sessionSecurityDiagnostics.$session === this);
const sessionSecurityDiagnosticsArray = this.getSessionSecurityDiagnosticsArray();
// add sessionDiagnostics into sessionDiagnosticsArray
const node = addElement(this._sessionSecurityDiagnostics, sessionSecurityDiagnosticsArray);
ensureObjectIsSecure(node);
}
}
});
this.sessionDiagnostics = sessionDiagnosticsVariableType.instantiate({
browseName: new QualifiedName({ name: "SessionDiagnostics", namespaceIndex: 0 }),
componentOf: this.sessionObject,
extensionObject: this._sessionDiagnostics,
minimumSamplingInterval: 2000 // 2 seconds
}) as UASessionDiagnostics;
this._sessionDiagnostics = this.sessionDiagnostics.$extensionObject as SessionDiagnosticsDataTypeEx;
assert(this._sessionDiagnostics.$session === this);
const sessionDiagnosticsArray = this.getSessionDiagnosticsArray();
// add sessionDiagnostics into sessionDiagnosticsArray
addElement(this._sessionDiagnostics, sessionDiagnosticsArray);
}
}
function createSessionSecurityDiagnosticsStuff(this: ServerSession) {
ServerSession.prototype._exposeSubscriptionDiagnostics = function (subscription) {
const session = this;
debugLog("ServerSession#_exposeSubscriptionDiagnostics");
assert(subscription.$session === session);
const subscriptionDiagnosticsArray = session._getSubscriptionDiagnosticsArray();
const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
assert(subscriptionDiagnostics.$subscription == subscription);
if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {
//xx console.log("GGGGGGGGGGGGGGGG => ServerSession Exposing subscription diagnostics =>",subscription.id,"on session", session.nodeId.toString());
eoan.addElement(subscriptionDiagnostics, subscriptionDiagnosticsArray);
}
};
ServerEngine.prototype._exposeSubscriptionDiagnostics = function (subscription) {
debugLog("ServerEngine#_exposeSubscriptionDiagnostics");
const engine = this;
const subscriptionDiagnosticsArray = engine._getServerSubscriptionDiagnosticsArray();
const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
assert(subscriptionDiagnostics.$subscription == subscription);
if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {
//xx console.log("GGGGGGGGGGGGGGGG ServerEngine => Exposing subscription diagnostics =>",subscription.id);
eoan.addElement(subscriptionDiagnostics, subscriptionDiagnosticsArray);
}
};
ServerEngine.prototype._unexposeSubscriptionDiagnostics = function (subscription) {
private _exposeSubscriptionDiagnostics(subscription: Subscription): void {
debugLog("ServerEngine#_exposeSubscriptionDiagnostics");
const subscriptionDiagnosticsArray = this._getServerSubscriptionDiagnosticsArray();
const subscriptionDiagnostics = subscription.subscriptionDiagnostics;
assert((subscriptionDiagnostics as any).$subscription === subscription);
assert(subscriptionDiagnostics instanceof SubscriptionDiagnosticsDataType);
if (subscriptionDiagnostics && subscriptionDiagnosticsArray) {
addElement(subscriptionDiagnostics, subscriptionDiagnosticsArray);
}
}