APIs

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

/**
 * 
 * @class SessionDiagnostics
 * @constructor
 * @extends BaseUAObject
 * @param  options {Object}
 * @param  [options.sessionId] {NodeId} 
 * @param  [options.sessionName] {String} 
 * @param  [options.clientDescription] {ApplicationDescription} 
 * @param  [options.serverUri] {String} 
 * @param  [options.endpointUrl] {String} 
 * @param  [options.localeIds] {LocaleId} 
 * @param  [options.actualSessionTimeout] {Duration} 
 * @param  [options.maxResponseMessageSize] {UInt32} 
 * @param  [options.clientConnectionTime] {UtcTime} 
 * @param  [options.clientLastContactTime] {UtcTime} 
 * @param  [options.currentSubscriptionsCount] {UInt32} 
 * @param  [options.currentMonitoredItemsCount] {UInt32} 
 * @param  [options.currentPublishRequestsInQueue] {UInt32} 
 * @param  [options.totalRequestCount] {ServiceCounter} 
 * @param  [options.unauthorizedRequestCount] {UInt32} 
 * @param  [options.readCount] {ServiceCounter} 
 * @param  [options.historyReadCount] {ServiceCounter} 
 * @param  [options.writeCount] {ServiceCounter} 
 * @param  [options.historyUpdateCount] {ServiceCounter} 
 * @param  [options.callCount] {ServiceCounter} 
 * @param  [options.createMonitoredItemsCount] {ServiceCounter} 
 * @param  [options.modifyMonitoredItemsCount] {ServiceCounter} 
 * @param  [options.setMonitoringModeCount] {ServiceCounter} 
 * @param  [options.setTriggeringCount] {ServiceCounter} 
 * @param  [options.deleteMonitoredItemsCount] {ServiceCounter} 
 * @param  [options.createSubscriptionCount] {ServiceCounter} 
 * @param  [options.modifySubscriptionCount] {ServiceCounter} 
 * @param  [options.setPublishingModeCount] {ServiceCounter} 
 * @param  [options.publishCount] {ServiceCounter} 
 * @param  [options.republishCount] {ServiceCounter} 
 * @param  [options.transferSubscriptionsCount] {ServiceCounter} 
 * @param  [options.deleteSubscriptionsCount] {ServiceCounter} 
 * @param  [options.addNodesCount] {ServiceCounter} 
 * @param  [options.addReferencesCount] {ServiceCounter} 
 * @param  [options.deleteNodesCount] {ServiceCounter} 
 * @param  [options.deleteReferencesCount] {ServiceCounter} 
 * @param  [options.browseCount] {ServiceCounter} 
 * @param  [options.browseNextCount] {ServiceCounter} 
 * @param  [options.translateBrowsePathsToNodeIdsCount] {ServiceCounter} 
 * @param  [options.queryFirstCount] {ServiceCounter} 
 * @param  [options.queryNextCount] {ServiceCounter} 
 * @param  [options.registerNodesCount] {ServiceCounter} 
 * @param  [options.unregisterNodesCount] {ServiceCounter} 
 */
function SessionDiagnostics(options)
{
    options = options || {};
    /* istanbul ignore next */
    if (schema_helpers.doDebug) { check_options_correctness_against_schema(this,schema,options); }
    var self = this;
    assert(this instanceof BaseUAObject); //  ' keyword "new" is required for constructor call')
    resolve_schema_field_types(schema);

    BaseUAObject.call(this,options);

    /**
      * 
      * @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;

var encode_NodeId = _defaultTypeMap.NodeId.encode;
var decode_NodeId = _defaultTypeMap.NodeId.decode;
var encode_String = _defaultTypeMap.String.encode;
var decode_String = _defaultTypeMap.String.decode;
var encode_LocaleId = _defaultTypeMap.LocaleId.encode;
var decode_LocaleId = _defaultTypeMap.LocaleId.decode;
var encode_Duration = _defaultTypeMap.Duration.encode;
var decode_Duration = _defaultTypeMap.Duration.decode;
var encode_UInt32 = _defaultTypeMap.UInt32.encode;
var decode_UInt32 = _defaultTypeMap.UInt32.decode;
var encode_UtcTime = _defaultTypeMap.UtcTime.encode;
var 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} 
 * @param [option] {object} 
 */
SessionDiagnostics.prototype.decode = function(stream,options) {
    // call base class implementation first
    BaseUAObject.prototype.decode.call(this,stream,options);
    this.sessionId = decode_NodeId(stream,options);
    this.sessionName = decode_String(stream,options);
    this.clientDescription.decode(stream,options);
    this.serverUri = decode_String(stream,options);
    this.endpointUrl = decode_String(stream,options);
    this.localeIds = decode_LocaleId(stream,options);
    this.actualSessionTimeout = decode_Duration(stream,options);
    this.maxResponseMessageSize = decode_UInt32(stream,options);
    this.clientConnectionTime = decode_UtcTime(stream,options);
    this.clientLastContactTime = decode_UtcTime(stream,options);
    this.currentSubscriptionsCount = decode_UInt32(stream,options);
    this.currentMonitoredItemsCount = decode_UInt32(stream,options);
    this.currentPublishRequestsInQueue = decode_UInt32(stream,options);
    this.totalRequestCount.decode(stream,options);
    this.unauthorizedRequestCount = decode_UInt32(stream,options);
    this.readCount.decode(stream,options);
    this.historyReadCount.decode(stream,options);
    this.writeCount.decode(stream,options);
    this.historyUpdateCount.decode(stream,options);
    this.callCount.decode(stream,options);
    this.createMonitoredItemsCount.decode(stream,options);
    this.modifyMonitoredItemsCount.decode(stream,options);
    this.setMonitoringModeCount.decode(stream,options);
    this.setTriggeringCount.decode(stream,options);
    this.deleteMonitoredItemsCount.decode(stream,options);
    this.createSubscriptionCount.decode(stream,options);
    this.modifySubscriptionCount.decode(stream,options);
    this.setPublishingModeCount.decode(stream,options);
    this.publishCount.decode(stream,options);
    this.republishCount.decode(stream,options);
    this.transferSubscriptionsCount.decode(stream,options);
    this.deleteSubscriptionsCount.decode(stream,options);
    this.addNodesCount.decode(stream,options);
    this.addReferencesCount.decode(stream,options);
    this.deleteNodesCount.decode(stream,options);
    this.deleteReferencesCount.decode(stream,options);
    this.browseCount.decode(stream,options);
    this.browseNextCount.decode(stream,options);
    this.translateBrowsePathsToNodeIdsCount.decode(stream,options);
    this.queryFirstCount.decode(stream,options);
    this.queryNextCount.decode(stream,options);
    this.registerNodesCount.decode(stream,options);
    this.unregisterNodesCount.decode(stream,options);
};
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;
var register_class_definition = require("node-opcua-factory/src/factories_factories").register_class_definition;
register_class_definition("SessionDiagnostics",SessionDiagnostics);