diffusion
Version:
Diffusion JavaScript client
62 lines (61 loc) • 3.44 kB
JavaScript
;
/**
* @module Services.ReplaceLicence
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReplaceLicenceResponseSerialiser = exports.ReplaceLicenceResponseSerialiserClass = void 0;
var Codec = require("./../../io/codec");
var serialiser_1 = require("./../../serialisers/serialiser");
var replace_licence_response_1 = require("./replace-licence-response");
/**
* Serialiser for {@link ReplaceLicenceResponse}
*/
var ReplaceLicenceResponseSerialiserClass = /** @class */ (function (_super) {
__extends(ReplaceLicenceResponseSerialiserClass, _super);
function ReplaceLicenceResponseSerialiserClass() {
var _this = _super.call(this) || this;
_this.responseCode = [];
_this.responseCode[0] = 'The license was replaced successfully.';
_this.responseCode[1] = 'The provided license does not match this version of Diffusion.';
_this.responseCode[2] = 'Diffusion was unable to find the IP address provided within the license.';
_this.responseCode[3] = 'The provided license has expired.';
_this.responseCode[4] = 'The date on the provided license is not valid.';
_this.responseCode[5] = 'The license file is missing.'
+ 'Please check the read / write permissions of your Diffusion server.';
_this.responseCode[6] = 'The licencing service has encountered an unknown error.';
_this.responseCode[7] = 'The provided license is not valid for the given IP address(es).';
_this.responseCode[8] = 'The provided license is not valid for the given MAC address(es).';
_this.responseCode[9] = 'The license file provided cannot be read, and may be corrupt.';
_this.responseCode[10] = 'The new license has an non-matching feature set to the current license.\n'
+ 'Please shut down the server and replace the license manually.';
return _this;
}
ReplaceLicenceResponseSerialiserClass.prototype.read = function (bis) {
var result = Codec.readByte(bis);
var resString = result in this.responseCode
? this.responseCode[result]
: 'An unknown response was received from the server.';
return new replace_licence_response_1.ReplaceLicenceResponse(result, resString);
};
return ReplaceLicenceResponseSerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.ReplaceLicenceResponseSerialiserClass = ReplaceLicenceResponseSerialiserClass;
/**
* The {@link ReplaceLicenceResponseSerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.ReplaceLicenceResponseSerialiser = new ReplaceLicenceResponseSerialiserClass();