APIs

Show:
// --------- This code has been automatically generated !!! 2017-12-15T21:13:58.747Z
"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/SubscriptionDiagnostics_schema").SubscriptionDiagnostics_Schema;
var getFactory = require("node-opcua-factory/src/factories_factories").getFactory;
var BaseUAObject = require("node-opcua-factory/src/factories_baseobject").BaseUAObject;

/**
 * 
 * @class SubscriptionDiagnostics
 * @constructor
 * @extends BaseUAObject
 * @param  options {Object}
 * @param  [options.sessionId] {NodeId} 
 * @param  [options.subscriptionId] {UInt32} 
 * @param  [options.priority] {Byte} 
 * @param  [options.publishingInterval] {Double} 
 * @param  [options.maxKeepAliveCount] {UInt32} 
 * @param  [options.maxLifetimeCount] {UInt32} 
 * @param  [options.maxNotificationsPerPublish] {UInt32} 
 * @param  [options.publishingEnabled] {Boolean} 
 * @param  [options.modifyCount] {UInt32} 
 * @param  [options.enableCount] {UInt32} 
 * @param  [options.disableCount] {UInt32} 
 * @param  [options.republishRequestCount] {UInt32} 
 * @param  [options.republishMessageRequestCount] {UInt32} 
 * @param  [options.republishMessageCount] {UInt32} 
 * @param  [options.transferRequestCount] {UInt32} 
 * @param  [options.transferredToAltClientCount] {UInt32} 
 * @param  [options.transferredToSameClientCount] {UInt32} 
 * @param  [options.publishRequestCount] {UInt32} 
 * @param  [options.dataChangeNotificationsCount] {UInt32} 
 * @param  [options.eventNotificationsCount] {UInt32} 
 * @param  [options.notificationsCount] {UInt32} 
 * @param  [options.latePublishRequestCount] {UInt32} 
 * @param  [options.currentKeepAliveCount] {UInt32} 
 * @param  [options.currentLifetimeCount] {UInt32} 
 * @param  [options.unacknowledgedMessageCount] {UInt32} 
 * @param  [options.discardedMessageCount] {UInt32} 
 * @param  [options.monitoredItemCount] {UInt32} 
 * @param  [options.disabledMonitoredItemCount] {UInt32} 
 * @param  [options.monitoringQueueOverflowCount] {UInt32} 
 * @param  [options.nextSequenceNumber] {UInt32} 
 * @param  [options.eventQueueOverFlowCount] {UInt32} 
 */
function SubscriptionDiagnostics(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 subscriptionId
      * @type {UInt32}
      */
    self.subscriptionId = initialize_field(schema.fields[1], options.subscriptionId);

    /**
      * 
      * @property priority
      * @type {Byte}
      */
    self.priority = initialize_field(schema.fields[2], options.priority);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

var encode_NodeId = _defaultTypeMap.NodeId.encode;
var decode_NodeId = _defaultTypeMap.NodeId.decode;
var encode_UInt32 = _defaultTypeMap.UInt32.encode;
var decode_UInt32 = _defaultTypeMap.UInt32.decode;
var encode_Byte = _defaultTypeMap.Byte.encode;
var decode_Byte = _defaultTypeMap.Byte.decode;
var encode_Double = _defaultTypeMap.Double.encode;
var decode_Double = _defaultTypeMap.Double.decode;
var encode_Boolean = _defaultTypeMap.Boolean.encode;
var decode_Boolean = _defaultTypeMap.Boolean.decode;
/**
 * encode the object into a binary stream
 * @method encode
 *
 * @param stream {BinaryStream} 
 */
SubscriptionDiagnostics.prototype.encode = function(stream,options) {
    // call base class implementation first
    BaseUAObject.prototype.encode.call(this,stream,options);
    encode_NodeId(this.sessionId,stream);
    encode_UInt32(this.subscriptionId,stream);
    encode_Byte(this.priority,stream);
    encode_Double(this.publishingInterval,stream);
    encode_UInt32(this.maxKeepAliveCount,stream);
    encode_UInt32(this.maxLifetimeCount,stream);
    encode_UInt32(this.maxNotificationsPerPublish,stream);
    encode_Boolean(this.publishingEnabled,stream);
    encode_UInt32(this.modifyCount,stream);
    encode_UInt32(this.enableCount,stream);
    encode_UInt32(this.disableCount,stream);
    encode_UInt32(this.republishRequestCount,stream);
    encode_UInt32(this.republishMessageRequestCount,stream);
    encode_UInt32(this.republishMessageCount,stream);
    encode_UInt32(this.transferRequestCount,stream);
    encode_UInt32(this.transferredToAltClientCount,stream);
    encode_UInt32(this.transferredToSameClientCount,stream);
    encode_UInt32(this.publishRequestCount,stream);
    encode_UInt32(this.dataChangeNotificationsCount,stream);
    encode_UInt32(this.eventNotificationsCount,stream);
    encode_UInt32(this.notificationsCount,stream);
    encode_UInt32(this.latePublishRequestCount,stream);
    encode_UInt32(this.currentKeepAliveCount,stream);
    encode_UInt32(this.currentLifetimeCount,stream);
    encode_UInt32(this.unacknowledgedMessageCount,stream);
    encode_UInt32(this.discardedMessageCount,stream);
    encode_UInt32(this.monitoredItemCount,stream);
    encode_UInt32(this.disabledMonitoredItemCount,stream);
    encode_UInt32(this.monitoringQueueOverflowCount,stream);
    encode_UInt32(this.nextSequenceNumber,stream);
    encode_UInt32(this.eventQueueOverFlowCount,stream);
};
/**
 * decode the object from a binary stream
 * @method decode
 *
 * @param stream {BinaryStream} 
 * @param [option] {object} 
 */
SubscriptionDiagnostics.prototype.decode = function(stream,options) {
    // call base class implementation first
    BaseUAObject.prototype.decode.call(this,stream,options);
    this.sessionId = decode_NodeId(stream,options);
    this.subscriptionId = decode_UInt32(stream,options);
    this.priority = decode_Byte(stream,options);
    this.publishingInterval = decode_Double(stream,options);
    this.maxKeepAliveCount = decode_UInt32(stream,options);
    this.maxLifetimeCount = decode_UInt32(stream,options);
    this.maxNotificationsPerPublish = decode_UInt32(stream,options);
    this.publishingEnabled = decode_Boolean(stream,options);
    this.modifyCount = decode_UInt32(stream,options);
    this.enableCount = decode_UInt32(stream,options);
    this.disableCount = decode_UInt32(stream,options);
    this.republishRequestCount = decode_UInt32(stream,options);
    this.republishMessageRequestCount = decode_UInt32(stream,options);
    this.republishMessageCount = decode_UInt32(stream,options);
    this.transferRequestCount = decode_UInt32(stream,options);
    this.transferredToAltClientCount = decode_UInt32(stream,options);
    this.transferredToSameClientCount = decode_UInt32(stream,options);
    this.publishRequestCount = decode_UInt32(stream,options);
    this.dataChangeNotificationsCount = decode_UInt32(stream,options);
    this.eventNotificationsCount = decode_UInt32(stream,options);
    this.notificationsCount = decode_UInt32(stream,options);
    this.latePublishRequestCount = decode_UInt32(stream,options);
    this.currentKeepAliveCount = decode_UInt32(stream,options);
    this.currentLifetimeCount = decode_UInt32(stream,options);
    this.unacknowledgedMessageCount = decode_UInt32(stream,options);
    this.discardedMessageCount = decode_UInt32(stream,options);
    this.monitoredItemCount = decode_UInt32(stream,options);
    this.disabledMonitoredItemCount = decode_UInt32(stream,options);
    this.monitoringQueueOverflowCount = decode_UInt32(stream,options);
    this.nextSequenceNumber = decode_UInt32(stream,options);
    this.eventQueueOverFlowCount = decode_UInt32(stream,options);
};
SubscriptionDiagnostics.possibleFields = [
  "sessionId",
         "subscriptionId",
         "priority",
         "publishingInterval",
         "maxKeepAliveCount",
         "maxLifetimeCount",
         "maxNotificationsPerPublish",
         "publishingEnabled",
         "modifyCount",
         "enableCount",
         "disableCount",
         "republishRequestCount",
         "republishMessageRequestCount",
         "republishMessageCount",
         "transferRequestCount",
         "transferredToAltClientCount",
         "transferredToSameClientCount",
         "publishRequestCount",
         "dataChangeNotificationsCount",
         "eventNotificationsCount",
         "notificationsCount",
         "latePublishRequestCount",
         "currentKeepAliveCount",
         "currentLifetimeCount",
         "unacknowledgedMessageCount",
         "discardedMessageCount",
         "monitoredItemCount",
         "disabledMonitoredItemCount",
         "monitoringQueueOverflowCount",
         "nextSequenceNumber",
         "eventQueueOverFlowCount"
];


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