3 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
5 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7 function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
9 function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
11 var RejectedMessage = function (_Entry) {
12 _inherits(RejectedMessage, _Entry);
14 function RejectedMessage(slot, _machineid, _oldseqnum, _newseqnum, _equalto) {
15 _classCallCheck(this, RejectedMessage);
17 var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(RejectedMessage).call(this, slot));
19 _this.machineid = _machineid;
20 _this.oldseqnum = _oldseqnum;
21 _this.newseqnum = _newseqnum;
22 _this.equalto = _equalto;
23 _this.watchset = new Set();
27 _createClass(RejectedMessage, [{
29 value: function getOldSeqNum() {
30 return this.oldseqnum;
34 value: function getNewSeqNum() {
35 return this.newseqnum;
39 value: function getEqual() {
44 value: function getMachineID() {
45 return this.machineid;
49 value: function setWatchSet(_watchset) {
50 this.watchset = _watchset;
54 value: function removeWatcher(_machineid) {
55 if (this.watchset.remove(_machineid)) {
56 if (this.watchset.isEmpty()) {
63 value: function encode(bb) {
64 bb.writeByte(Entry.TypeRejectedMessage);
65 bb.writeInt64(this.machineid);
66 bb.writeInt64(this.oldseqnum);
67 bb.writeInt64(this.newseqnum);
68 if (this.equalto === true) {
76 value: function getSize() {
81 value: function getType() {
82 return Entry.TypeRejectedMessage;
86 value: function getCopy(s) {
87 return new RejectedMessage(s, this.machineid, this.oldseqnum, this.newseqnum, this.equalto);
91 value: function decode(slot, bb) {
92 this.machineid = bb.readByte();
93 this.oldseqnum = bb.readInt64();
94 this.newseqnum = bb.readInt64();
95 this.equalto = bb.readbyte();
96 return new RejectedMessage(this.slot, this.machineid, this.oldseqnum, this.newseqnum, this.equalto === 1);
100 return RejectedMessage;