APIs

Show:
// --------- This code has been automatically generated !!! 2018-09-03T20:28:07.358Z
"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/SubscriptionDiagnostics_schema").SubscriptionDiagnostics_Schema;
const getFactory = require("node-opcua-factory/src/factories_factories").getFactory;
const BaseUAObject = require("node-opcua-factory/src/factories_baseobject").BaseUAObject;

/**
 * 
 * @class SubscriptionDiagnostics
 * @constructor
 * @extends BaseUAObject
 * @param  options {Object}
 */
function SubscriptionDiagnostics(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);
        return ;
    }

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

const encode_NodeId = _defaultTypeMap.NodeId.encode;
const decode_NodeId = _defaultTypeMap.NodeId.decode;
const encode_UInt32 = _defaultTypeMap.UInt32.encode;
const decode_UInt32 = _defaultTypeMap.UInt32.decode;
const encode_Byte = _defaultTypeMap.Byte.encode;
const decode_Byte = _defaultTypeMap.Byte.decode;
const encode_Double = _defaultTypeMap.Double.encode;
const decode_Double = _defaultTypeMap.Double.decode;
const encode_Boolean = _defaultTypeMap.Boolean.encode;
const 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} 
 */
SubscriptionDiagnostics.prototype.decode = function(stream) {
    // call base class implementation first
    BaseUAObject.prototype.decode.call(this,stream);
    this.sessionId = decode_NodeId(stream);
    this.subscriptionId = decode_UInt32(stream);
    this.priority = decode_Byte(stream);
    this.publishingInterval = decode_Double(stream);
    this.maxKeepAliveCount = decode_UInt32(stream);
    this.maxLifetimeCount = decode_UInt32(stream);
    this.maxNotificationsPerPublish = decode_UInt32(stream);
    this.publishingEnabled = decode_Boolean(stream);
    this.modifyCount = decode_UInt32(stream);
    this.enableCount = decode_UInt32(stream);
    this.disableCount = decode_UInt32(stream);
    this.republishRequestCount = decode_UInt32(stream);
    this.republishMessageRequestCount = decode_UInt32(stream);
    this.republishMessageCount = decode_UInt32(stream);
    this.transferRequestCount = decode_UInt32(stream);
    this.transferredToAltClientCount = decode_UInt32(stream);
    this.transferredToSameClientCount = decode_UInt32(stream);
    this.publishRequestCount = decode_UInt32(stream);
    this.dataChangeNotificationsCount = decode_UInt32(stream);
    this.eventNotificationsCount = decode_UInt32(stream);
    this.notificationsCount = decode_UInt32(stream);
    this.latePublishRequestCount = decode_UInt32(stream);
    this.currentKeepAliveCount = decode_UInt32(stream);
    this.currentLifetimeCount = decode_UInt32(stream);
    this.unacknowledgedMessageCount = decode_UInt32(stream);
    this.discardedMessageCount = decode_UInt32(stream);
    this.monitoredItemCount = decode_UInt32(stream);
    this.disabledMonitoredItemCount = decode_UInt32(stream);
    this.monitoringQueueOverflowCount = decode_UInt32(stream);
    this.nextSequenceNumber = decode_UInt32(stream);
    this.eventQueueOverFlowCount = decode_UInt32(stream);
};
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;
const register_class_definition = require("node-opcua-factory/src/factories_factories").register_class_definition;
register_class_definition("SubscriptionDiagnostics",SubscriptionDiagnostics);