-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmessage.js
More file actions
70 lines (54 loc) · 1.22 KB
/
message.js
File metadata and controls
70 lines (54 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'use strict';
const shortId = require('shortid');
class Message {
constructor(topic) {
this._id = shortId.generate();
this._topic = topic;
this._created = new Date().valueOf();
this._value = '';
this._processing_details = [];
this._processed = false;
this._dropped = false;
this._allowed_retries = 0;
}
getTopic() {
return this._topic;
}
setValue(value) {
this._value = value;
}
getValue() {
return this._value;
}
getId() {
return this._id;
}
setProcessingDetails(processingDetails) {
this._processing_details = processingDetails;
}
getProcessingDetails() {
return this._processing_details;
}
getCreated() {
return this._created;
}
getProcessed() {
return this._processed;
}
setProcessed(value) {
this._processed = value;
}
getDropped() {
return this._dropped;
}
setDropped(value) {
this._dropped = value;
}
setAllowedRetries(value) {
this._allowed_retries = value;
}
getAllowedRetries() {
return this._allowed_retries;
}
}
module.exports = Message;