APIs

Show:
// --------- This code has been automatically generated !!! 2018-09-03T20:28:07.569Z
"use strict";
/**
 * @module opcua.address_space.types
 */
const assert = require("node-opcua-assert").assert;
const util = require("util");
const _  = require("underscore");
const makeNodeId = require("node-opcua-nodeid").makeNodeId;
const schema_helpers =  require("node-opcua-factory/src/factories_schema_helpers");
const extract_all_fields                       = schema_helpers.extract_all_fields;
const resolve_schema_field_types               = schema_helpers.resolve_schema_field_types;
const initialize_field                         = schema_helpers.initialize_field;
const initialize_field_array                   = schema_helpers.initialize_field_array;
const check_options_correctness_against_schema = schema_helpers.check_options_correctness_against_schema;
const _defaultTypeMap = require("node-opcua-factory/src/factories_builtin_types")._defaultTypeMap;
const ec = require("node-opcua-basic-types");
const encodeArray = ec.encodeArray;
const decodeArray = ec.decodeArray;
const makeExpandedNodeId = require("node-opcua-nodeid/src/expanded_nodeid").makeExpandedNodeId;
const generate_new_id = require("node-opcua-factory").generate_new_id;
const _enumerations = require("node-opcua-factory/src/factories_enumerations")._private._enumerations;
const schema = require("../schemas/SessionDiagnostics_schema").SessionDiagnostics_Schema;
const getFactory = require("node-opcua-factory/src/factories_factories").getFactory;
const ApplicationDescription = getFactory("ApplicationDescription");
const ServiceCounter = require("./_auto_generated_ServiceCounter").ServiceCounter;
const BaseUAObject = require("node-opcua-factory/src/factories_baseobject").BaseUAObject;

/**
 * 
 * @class SessionDiagnostics
 * @constructor
 * @extends BaseUAObject
 * @param  options {Object}
 */
function SessionDiagnostics(options)
{
    options = options || {};
    /* istanbul ignore next */
    if (schema_helpers.doDebug) { check_options_correctness_against_schema(this,schema,options); }
    const self = this;
    assert(this instanceof BaseUAObject); //  ' keyword "new" is required for constructor call')
    resolve_schema_field_types(schema);

    BaseUAObject.call(this,options);
    if (options === null) { 
        BaseUAObject.call(this,options);
        self.clientDescription =  null; /* new ApplicationDescription(null); */
        self.totalRequestCount =  null; /* new ServiceCounter(null); */
        self.readCount =  null; /* new ServiceCounter(null); */
        self.historyReadCount =  null; /* new ServiceCounter(null); */
        self.writeCount =  null; /* new ServiceCounter(null); */
        self.historyUpdateCount =  null; /* new ServiceCounter(null); */
        self.callCount =  null; /* new ServiceCounter(null); */
        self.createMonitoredItemsCount =  null; /* new ServiceCounter(null); */
        self.modifyMonitoredItemsCount =  null; /* new ServiceCounter(null); */
        self.setMonitoringModeCount =  null; /* new ServiceCounter(null); */
        self.setTriggeringCount =  null; /* new ServiceCounter(null); */
        self.deleteMonitoredItemsCount =  null; /* new ServiceCounter(null); */
        self.createSubscriptionCount =  null; /* new ServiceCounter(null); */
        self.modifySubscriptionCount =  null; /* new ServiceCounter(null); */
        self.setPublishingModeCount =  null; /* new ServiceCounter(null); */
        self.publishCount =  null; /* new ServiceCounter(null); */
        self.republishCount =  null; /* new ServiceCounter(null); */
        self.transferSubscriptionsCount =  null; /* new ServiceCounter(null); */
        self.deleteSubscriptionsCount =  null; /* new ServiceCounter(null); */
        self.addNodesCount =  null; /* new ServiceCounter(null); */
        self.addReferencesCount =  null; /* new ServiceCounter(null); */
        self.deleteNodesCount =  null; /* new ServiceCounter(null); */
        self.deleteReferencesCount =  null; /* new ServiceCounter(null); */
        self.browseCount =  null; /* new ServiceCounter(null); */
        self.browseNextCount =  null; /* new ServiceCounter(null); */
        self.translateBrowsePathsToNodeIdsCount =  null; /* new ServiceCounter(null); */
        self.queryFirstCount =  null; /* new ServiceCounter(null); */
        self.queryNextCount =  null; /* new ServiceCounter(null); */
        self.registerNodesCount =  null; /* new ServiceCounter(null); */
        self.unregisterNodesCount =  null; /* new ServiceCounter(null); */
        return ;
    }

    /**
      * 
      * @property sessionId
      * @type {NodeId}
      */
    self.sessionId = initialize_field(schema.fields[0], options.sessionId);

    /**
      * 
      * @property sessionName
      * @type {String}
      */
    self.sessionName = initialize_field(schema.fields[1], options.sessionName);

    /**
      * 
      * @property clientDescription
      * @type {ApplicationDescription}
      */
    self.clientDescription =  new ApplicationDescription( options.clientDescription);

    /**
      * 
      * @property serverUri
      * @type {String}
      */
    self.serverUri = initialize_field(schema.fields[3], options.serverUri);

    /**
      * 
      * @property endpointUrl
      * @type {String}
      */
    self.endpointUrl = initialize_field(schema.fields[4], options.endpointUrl);

    /**
      * 
      * @property localeIds
      * @type {LocaleId}
      */
    self.localeIds = initialize_field(schema.fields[5], options.localeIds);

    /**
      * 
      * @property actualSessionTimeout
      * @type {Duration}
      */
    self.actualSessionTimeout = initialize_field(schema.fields[6], options.actualSessionTimeout);

    /**
      * 
      * @property maxResponseMessageSize
      * @type {UInt32}
      */
    self.maxResponseMessageSize = initialize_field(schema.fields[7], options.maxResponseMessageSize);

    /**
      * 
      * @property clientConnectionTime
      * @type {UtcTime}
      */
    self.clientConnectionTime = initialize_field(schema.fields[8], options.clientConnectionTime);

    /**
      * 
      * @property clientLastContactTime
      * @type {UtcTime}
      */
    self.clientLastContactTime = initialize_field(schema.fields[9], options.clientLastContactTime);

    /**
      * 
      * @property currentSubscriptionsCount
      * @type {UInt32}
      */
    self.currentSubscriptionsCount = initialize_field(schema.fields[10], options.currentSubscriptionsCount);

    /**
      * 
      * @property currentMonitoredItemsCount
      * @type {UInt32}
      */
    self.currentMonitoredItemsCount = initialize_field(schema.fields[11], options.currentMonitoredItemsCount);

    /**
      * 
      * @property currentPublishRequestsInQueue
      * @type {UInt32}
      */
    self.currentPublishRequestsInQueue = initialize_field(schema.fields[12], options.currentPublishRequestsInQueue);

    /**
      * 
      * @property totalRequestCount
      * @type {ServiceCounter}
      */
    self.totalRequestCount =  new ServiceCounter( options.totalRequestCount);

    /**
      * 
      * @property unauthorizedRequestCount
      * @type {UInt32}
      */
    self.unauthorizedRequestCount = initialize_field(schema.fields[14], options.unauthorizedRequestCount);

    /**
      * 
      * @property readCount
      * @type {ServiceCounter}
      */
    self.readCount =  new ServiceCounter( options.readCount);

    /**
      * 
      * @property historyReadCount
      * @type {ServiceCounter}
      */
    self.historyReadCount =  new ServiceCounter( options.historyReadCount);

    /**
      * 
      * @property writeCount
      * @type {ServiceCounter}
      */
    self.writeCount =  new ServiceCounter( options.writeCount);

    /**
      * 
      * @property historyUpdateCount
      * @type {ServiceCounter}
      */
    self.historyUpdateCount =  new ServiceCounter( options.historyUpdateCount);

    /**
      * 
      * @property callCount
      * @type {ServiceCounter}
      */
    self.callCount =  new ServiceCounter( options.callCount);

    /**
      * 
      * @property createMonitoredItemsCount
      * @type {ServiceCounter}
      */
    self.createMonitoredItemsCount =  new ServiceCounter( options.createMonitoredItemsCount);

    /**
      * 
      * @property modifyMonitoredItemsCount
      * @type {ServiceCounter}
      */
    self.modifyMonitoredItemsCount =  new ServiceCounter( options.modifyMonitoredItemsCount);

    /**
      * 
      * @property setMonitoringModeCount
      * @type {ServiceCounter}
      */
    self.setMonitoringModeCount =  new ServiceCounter( options.setMonitoringModeCount);

    /**
      * 
      * @property setTriggeringCount
      * @type {ServiceCounter}
      */
    self.setTriggeringCount =  new ServiceCounter( options.setTriggeringCount);

    /**
      * 
      * @property deleteMonitoredItemsCount
      * @type {ServiceCounter}
      */
    self.deleteMonitoredItemsCount =  new ServiceCounter( options.deleteMonitoredItemsCount);

    /**
      * 
      * @property createSubscriptionCount
      * @type {ServiceCounter}
      */
    self.createSubscriptionCount =  new ServiceCounter( options.createSubscriptionCount);

    /**
      * 
      * @property modifySubscriptionCount
      * @type {ServiceCounter}
      */
    self.modifySubscriptionCount =  new ServiceCounter( options.modifySubscriptionCount);

    /**
      * 
      * @property setPublishingModeCount
      * @type {ServiceCounter}
      */
    self.setPublishingModeCount =  new ServiceCounter( options.setPublishingModeCount);

    /**
      * 
      * @property publishCount
      * @type {ServiceCounter}
      */
    self.publishCount =  new ServiceCounter( options.publishCount);

    /**
      * 
      * @property republishCount
      * @type {ServiceCounter}
      */
    self.republishCount =  new ServiceCounter( options.republishCount);

    /**
      * 
      * @property transferSubscriptionsCount
      * @type {ServiceCounter}
      */
    self.transferSubscriptionsCount =  new ServiceCounter( options.transferSubscriptionsCount);

    /**
      * 
      * @property deleteSubscriptionsCount
      * @type {ServiceCounter}
      */
    self.deleteSubscriptionsCount =  new ServiceCounter( options.deleteSubscriptionsCount);

    /**
      * 
      * @property addNodesCount
      * @type {ServiceCounter}
      */
    self.addNodesCount =  new ServiceCounter( options.addNodesCount);

    /**
      * 
      * @property addReferencesCount
      * @type {ServiceCounter}
      */
    self.addReferencesCount =  new ServiceCounter( options.addReferencesCount);

    /**
      * 
      * @property deleteNodesCount
      * @type {ServiceCounter}
      */
    self.deleteNodesCount =  new ServiceCounter( options.deleteNodesCount);

    /**
      * 
      * @property deleteReferencesCount
      * @type {ServiceCounter}
      */
    self.deleteReferencesCount =  new ServiceCounter( options.deleteReferencesCount);

    /**
      * 
      * @property browseCount
      * @type {ServiceCounter}
      */
    self.browseCount =  new ServiceCounter( options.browseCount);

    /**
      * 
      * @property browseNextCount
      * @type {ServiceCounter}
      */
    self.browseNextCount =  new ServiceCounter( options.browseNextCount);

    /**
      * 
      * @property translateBrowsePathsToNodeIdsCount
      * @type {ServiceCounter}
      */
    self.translateBrowsePathsToNodeIdsCount =  new ServiceCounter( options.translateBrowsePathsToNodeIdsCount);

    /**
      * 
      * @property queryFirstCount
      * @type {ServiceCounter}
      */
    self.queryFirstCount =  new ServiceCounter( options.queryFirstCount);

    /**
      * 
      * @property queryNextCount
      * @type {ServiceCounter}
      */
    self.queryNextCount =  new ServiceCounter( options.queryNextCount);

    /**
      * 
      * @property registerNodesCount
      * @type {ServiceCounter}
      */
    self.registerNodesCount =  new ServiceCounter( options.registerNodesCount);

    /**
      * 
      * @property unregisterNodesCount
      * @type {ServiceCounter}
      */
    self.unregisterNodesCount =  new ServiceCounter( options.unregisterNodesCount);

   // Object.preventExtensions(self);
}
util.inherits(SessionDiagnostics,BaseUAObject);
SessionDiagnostics.prototype.encodingDefaultBinary = makeExpandedNodeId(867,0);
SessionDiagnostics.prototype._schema = schema;

const encode_NodeId = _defaultTypeMap.NodeId.encode;
const decode_NodeId = _defaultTypeMap.NodeId.decode;
const encode_String = _defaultTypeMap.String.encode;
const decode_String = _defaultTypeMap.String.decode;
const encode_LocaleId = _defaultTypeMap.LocaleId.encode;
const decode_LocaleId = _defaultTypeMap.LocaleId.decode;
const encode_Duration = _defaultTypeMap.Duration.encode;
const decode_Duration = _defaultTypeMap.Duration.decode;
const encode_UInt32 = _defaultTypeMap.UInt32.encode;
const decode_UInt32 = _defaultTypeMap.UInt32.decode;
const encode_UtcTime = _defaultTypeMap.UtcTime.encode;
const decode_UtcTime = _defaultTypeMap.UtcTime.decode;
/**
 * encode the object into a binary stream
 * @method encode
 *
 * @param stream {BinaryStream} 
 */
SessionDiagnostics.prototype.encode = function(stream,options) {
    // call base class implementation first
    BaseUAObject.prototype.encode.call(this,stream,options);
    encode_NodeId(this.sessionId,stream);
    encode_String(this.sessionName,stream);
   this.clientDescription.encode(stream,options);
    encode_String(this.serverUri,stream);
    encode_String(this.endpointUrl,stream);
    encode_LocaleId(this.localeIds,stream);
    encode_Duration(this.actualSessionTimeout,stream);
    encode_UInt32(this.maxResponseMessageSize,stream);
    encode_UtcTime(this.clientConnectionTime,stream);
    encode_UtcTime(this.clientLastContactTime,stream);
    encode_UInt32(this.currentSubscriptionsCount,stream);
    encode_UInt32(this.currentMonitoredItemsCount,stream);
    encode_UInt32(this.currentPublishRequestsInQueue,stream);
   this.totalRequestCount.encode(stream,options);
    encode_UInt32(this.unauthorizedRequestCount,stream);
   this.readCount.encode(stream,options);
   this.historyReadCount.encode(stream,options);
   this.writeCount.encode(stream,options);
   this.historyUpdateCount.encode(stream,options);
   this.callCount.encode(stream,options);
   this.createMonitoredItemsCount.encode(stream,options);
   this.modifyMonitoredItemsCount.encode(stream,options);
   this.setMonitoringModeCount.encode(stream,options);
   this.setTriggeringCount.encode(stream,options);
   this.deleteMonitoredItemsCount.encode(stream,options);
   this.createSubscriptionCount.encode(stream,options);
   this.modifySubscriptionCount.encode(stream,options);
   this.setPublishingModeCount.encode(stream,options);
   this.publishCount.encode(stream,options);
   this.republishCount.encode(stream,options);
   this.transferSubscriptionsCount.encode(stream,options);
   this.deleteSubscriptionsCount.encode(stream,options);
   this.addNodesCount.encode(stream,options);
   this.addReferencesCount.encode(stream,options);
   this.deleteNodesCount.encode(stream,options);
   this.deleteReferencesCount.encode(stream,options);
   this.browseCount.encode(stream,options);
   this.browseNextCount.encode(stream,options);
   this.translateBrowsePathsToNodeIdsCount.encode(stream,options);
   this.queryFirstCount.encode(stream,options);
   this.queryNextCount.encode(stream,options);
   this.registerNodesCount.encode(stream,options);
   this.unregisterNodesCount.encode(stream,options);
};
/**
 * decode the object from a binary stream
 * @method decode
 *
 * @param stream {BinaryStream} 
 */
SessionDiagnostics.prototype.decode = function(stream) {
    // call base class implementation first
    BaseUAObject.prototype.decode.call(this,stream);
    this.sessionId = decode_NodeId(stream);
    this.sessionName = decode_String(stream);
    this.clientDescription.decode(stream);
    this.serverUri = decode_String(stream);
    this.endpointUrl = decode_String(stream);
    this.localeIds = decode_LocaleId(stream);
    this.actualSessionTimeout = decode_Duration(stream);
    this.maxResponseMessageSize = decode_UInt32(stream);
    this.clientConnectionTime = decode_UtcTime(stream);
    this.clientLastContactTime = decode_UtcTime(stream);
    this.currentSubscriptionsCount = decode_UInt32(stream);
    this.currentMonitoredItemsCount = decode_UInt32(stream);
    this.currentPublishRequestsInQueue = decode_UInt32(stream);
    this.totalRequestCount.decode(stream);
    this.unauthorizedRequestCount = decode_UInt32(stream);
    this.readCount.decode(stream);
    this.historyReadCount.decode(stream);
    this.writeCount.decode(stream);
    this.historyUpdateCount.decode(stream);
    this.callCount.decode(stream);
    this.createMonitoredItemsCount.decode(stream);
    this.modifyMonitoredItemsCount.decode(stream);
    this.setMonitoringModeCount.decode(stream);
    this.setTriggeringCount.decode(stream);
    this.deleteMonitoredItemsCount.decode(stream);
    this.createSubscriptionCount.decode(stream);
    this.modifySubscriptionCount.decode(stream);
    this.setPublishingModeCount.decode(stream);
    this.publishCount.decode(stream);
    this.republishCount.decode(stream);
    this.transferSubscriptionsCount.decode(stream);
    this.deleteSubscriptionsCount.decode(stream);
    this.addNodesCount.decode(stream);
    this.addReferencesCount.decode(stream);
    this.deleteNodesCount.decode(stream);
    this.deleteReferencesCount.decode(stream);
    this.browseCount.decode(stream);
    this.browseNextCount.decode(stream);
    this.translateBrowsePathsToNodeIdsCount.decode(stream);
    this.queryFirstCount.decode(stream);
    this.queryNextCount.decode(stream);
    this.registerNodesCount.decode(stream);
    this.unregisterNodesCount.decode(stream);
};
SessionDiagnostics.possibleFields = [
  "sessionId",
         "sessionName",
         "clientDescription",
         "serverUri",
         "endpointUrl",
         "localeIds",
         "actualSessionTimeout",
         "maxResponseMessageSize",
         "clientConnectionTime",
         "clientLastContactTime",
         "currentSubscriptionsCount",
         "currentMonitoredItemsCount",
         "currentPublishRequestsInQueue",
         "totalRequestCount",
         "unauthorizedRequestCount",
         "readCount",
         "historyReadCount",
         "writeCount",
         "historyUpdateCount",
         "callCount",
         "createMonitoredItemsCount",
         "modifyMonitoredItemsCount",
         "setMonitoringModeCount",
         "setTriggeringCount",
         "deleteMonitoredItemsCount",
         "createSubscriptionCount",
         "modifySubscriptionCount",
         "setPublishingModeCount",
         "publishCount",
         "republishCount",
         "transferSubscriptionsCount",
         "deleteSubscriptionsCount",
         "addNodesCount",
         "addReferencesCount",
         "deleteNodesCount",
         "deleteReferencesCount",
         "browseCount",
         "browseNextCount",
         "translateBrowsePathsToNodeIdsCount",
         "queryFirstCount",
         "queryNextCount",
         "registerNodesCount",
         "unregisterNodesCount"
];


exports.SessionDiagnostics = SessionDiagnostics;
const register_class_definition = require("node-opcua-factory/src/factories_factories").register_class_definition;
register_class_definition("SessionDiagnostics",SessionDiagnostics);