joynr.types.DiscoveryEntry.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libjoynr-js Show documentation
Show all versions of libjoynr-js Show documentation
JOYnr JavaScript libjoynr-js
/**
* This is the generated struct type DiscoveryEntry: DOCS GENERATED FROM INTERFACE DESCRIPTION
* Generation date: Mon Feb 12 16:22:04 CET 2018
*/
(function(undefined) {
/**
* @name DiscoveryEntry
* @constructor
*
* @classdesc
* This is the generated struct type DiscoveryEntry: DOCS GENERATED FROM INTERFACE DESCRIPTION
*
Generation date: Mon Feb 12 16:22:04 CET 2018
*
Stores information about a provider instance and is used to communicate
* capabilities between a cluster controller and a lib-joynr instance.
*
* @param {Object} members - an object containing the individual member elements
* @param {Version} members.providerVersion - semantic version information
* @param {String} members.domain - the domain to register the provider with
* @param {String} members.interfaceName - the name of the provider interface
* @param {String} members.participantId - the participant ID of the provider
* @param {ProviderQos} members.qos - the qos of the provider
* @param {Number} members.lastSeenDateMs - the date in millis since epoch when the source for this provider last
* contacted the directory
* @param {Number} members.expiryDateMs - the date in millis since epoch when this entry can be purged from the
* directory and caches
* @param {String} members.publicKeyId - the ID of the public key to be used to encrypt messages to
* this provider
* @returns {DiscoveryEntry} a new instance of a DiscoveryEntry
*/
var DiscoveryEntry = function DiscoveryEntry(members) {
if (!(this instanceof DiscoveryEntry)) {
// in case someone calls constructor without new keyword (e.g. var c = Constructor({..}))
return new DiscoveryEntry(members);
}
/**
* Used for serialization.
* @name DiscoveryEntry#_typeName
* @type String
* @readonly
*/
Object.defineProperty(this, "_typeName", {
configurable : false,
writable : false,
enumerable : true,
value : DiscoveryEntry._typeName
});
/**
* semantic version information
* @name DiscoveryEntry#providerVersion
* @type Version
*/
/**
* the domain to register the provider with
* @name DiscoveryEntry#domain
* @type String
*/
/**
* the name of the provider interface
* @name DiscoveryEntry#interfaceName
* @type String
*/
/**
* the participant ID of the provider
* @name DiscoveryEntry#participantId
* @type String
*/
/**
* the qos of the provider
* @name DiscoveryEntry#qos
* @type ProviderQos
*/
/**
* the date in millis since epoch when the source for this provider last
* contacted the directory
* @name DiscoveryEntry#lastSeenDateMs
* @type Number
*/
/**
* the date in millis since epoch when this entry can be purged from the
* directory and caches
* @name DiscoveryEntry#expiryDateMs
* @type Number
*/
/**
* the ID of the public key to be used to encrypt messages to
* this provider
* @name DiscoveryEntry#publicKeyId
* @type String
*/
if (members !== undefined) {
this.providerVersion = members.providerVersion;
this.domain = members.domain;
this.interfaceName = members.interfaceName;
this.participantId = members.participantId;
this.qos = members.qos;
this.lastSeenDateMs = members.lastSeenDateMs;
this.expiryDateMs = members.expiryDateMs;
this.publicKeyId = members.publicKeyId;
}
};
Object.defineProperty(DiscoveryEntry, "_typeName", {
configurable : false,
writable : false,
enumerable : false,
value : "joynr.types.DiscoveryEntry"
});
Object.defineProperty(DiscoveryEntry, 'checkMembers', {
enumerable: false,
configurable: false,
writable: false,
readable: true,
value: function checkMembers(instance, check) {
check(instance.providerVersion, ["Object", "Version"], "members.providerVersion");
check(instance.domain, "String", "members.domain");
check(instance.interfaceName, "String", "members.interfaceName");
check(instance.participantId, "String", "members.participantId");
check(instance.qos, ["Object", "ProviderQos"], "members.qos");
check(instance.lastSeenDateMs, "Number", "members.lastSeenDateMs");
check(instance.expiryDateMs, "Number", "members.expiryDateMs");
check(instance.publicKeyId, "String", "members.publicKeyId");
}
});
/**
* @name DiscoveryEntry#MAJOR_VERSION
* @constant {Number}
* @default 0
* @summary The MAJOR_VERSION of the struct type DiscoveryEntry is GENERATED FROM THE INTERFACE DESCRIPTION
*/
Object.defineProperty(DiscoveryEntry, 'MAJOR_VERSION', {
enumerable: false,
configurable: false,
writable: false,
readable: true,
value: 0
});
/**
* @name DiscoveryEntry#MINOR_VERSION
* @constant {Number}
* @default 0
* @summary The MINOR_VERSION of the struct type DiscoveryEntry is GENERATED FROM THE INTERFACE DESCRIPTION
*/
Object.defineProperty(DiscoveryEntry, 'MINOR_VERSION', {
enumerable: false,
configurable: false,
writable: false,
readable: true,
value: 0
});
var preparePrototype = function(joynr) {
DiscoveryEntry.prototype = new joynr.JoynrObject();
DiscoveryEntry.prototype.constructor = DiscoveryEntry;
Object.defineProperty(DiscoveryEntry.prototype, 'equals', {
enumerable: false,
configurable: false,
writable: false,
readable: true,
value: function equals(other) {
var i;
if (this === other) {
return true;
}
if (other === undefined || other === null) {
return false;
}
if (other._typeName === undefined || this._typeName !== other._typeName) {
return false;
}
if (this.providerVersion === undefined || this.providerVersion === null) {
if (other.providerVersion !== null && other.providerVersion !== undefined) {
return false;
}
} else if (!this.providerVersion.equals(other.providerVersion)){
return false;
}
if (this.domain === undefined || this.domain === null) {
if (other.domain !== null && other.domain !== undefined) {
return false;
}
} else if (this.domain !== other.domain){
return false;
}
if (this.interfaceName === undefined || this.interfaceName === null) {
if (other.interfaceName !== null && other.interfaceName !== undefined) {
return false;
}
} else if (this.interfaceName !== other.interfaceName){
return false;
}
if (this.participantId === undefined || this.participantId === null) {
if (other.participantId !== null && other.participantId !== undefined) {
return false;
}
} else if (this.participantId !== other.participantId){
return false;
}
if (this.qos === undefined || this.qos === null) {
if (other.qos !== null && other.qos !== undefined) {
return false;
}
} else if (!this.qos.equals(other.qos)){
return false;
}
if (this.lastSeenDateMs === undefined || this.lastSeenDateMs === null) {
if (other.lastSeenDateMs !== null && other.lastSeenDateMs !== undefined) {
return false;
}
} else if (this.lastSeenDateMs !== other.lastSeenDateMs){
return false;
}
if (this.expiryDateMs === undefined || this.expiryDateMs === null) {
if (other.expiryDateMs !== null && other.expiryDateMs !== undefined) {
return false;
}
} else if (this.expiryDateMs !== other.expiryDateMs){
return false;
}
if (this.publicKeyId === undefined || this.publicKeyId === null) {
if (other.publicKeyId !== null && other.publicKeyId !== undefined) {
return false;
}
} else if (this.publicKeyId !== other.publicKeyId){
return false;
}
return true;
}
});
};
var memberTypes = {
providerVersion: function() { return "joynr.types.Version"; },
domain: function() { return "String"; },
interfaceName: function() { return "String"; },
participantId: function() { return "String"; },
qos: function() { return "joynr.types.ProviderQos"; },
lastSeenDateMs: function() { return "Long"; },
expiryDateMs: function() { return "Long"; },
publicKeyId: function() { return "String"; }
};
Object.defineProperty(DiscoveryEntry, 'getMemberType', {
enumerable: false,
value: function getMemberType(memberName) {
if (memberTypes[memberName] !== undefined) {
return memberTypes[memberName]();
}
return undefined;
}
});
// AMD support
if (typeof define === 'function' && define.amd) {
define("joynr/types/DiscoveryEntry", ["joynr"], function (joynr) {
preparePrototype(joynr);
joynr.addType("joynr.types.DiscoveryEntry", DiscoveryEntry);
return DiscoveryEntry;
});
} else if (typeof exports !== 'undefined' ) {
if ((module !== undefined) && module.exports) {
exports = module.exports = DiscoveryEntry;
} else {
// support CommonJS module 1.1.1 spec (`exports` cannot be a function)
exports.DiscoveryEntry = DiscoveryEntry;
}
var joynr = require("joynr");
preparePrototype(joynr);
joynr.addType("joynr.types.DiscoveryEntry", DiscoveryEntry);
} else {
preparePrototype(window.joynr);
window.joynr.addType("joynr.types.DiscoveryEntry", DiscoveryEntry);
window.DiscoveryEntry = DiscoveryEntry;
}
})();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy