blob: b71831ffb5b314ef7eb8ab14faee423a966d5012 (
plain)
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
|
package pl.edu.mimuw.cloudatlas.agent.messages;
public abstract class AgentMessage {
public enum AgentModule {
TIMER_SCHEDULER,
TIMER_GTP,
RMI,
UDP,
GOSSIP_IN,
GOSSIP_OUT,
STATE,
QUERY
}
private String messageId;
private AgentModule destinationModule;
private long timestamp;
public AgentMessage(String messageId, AgentModule destinationModule, long timestamp) {
this.messageId = messageId;
this.destinationModule = destinationModule;
this.timestamp = timestamp;
}
public AgentMessage(String messageId, AgentModule destinationModule) {
this.messageId = messageId;
this.destinationModule = destinationModule;
this.timestamp = System.currentTimeMillis() / 1000L;
}
public abstract AgentModule getCorrectMessageType();
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public AgentModule getDestinationModule() {
return destinationModule;
}
public void setDestinationModule(AgentModule destinationModule) {
this.destinationModule = destinationModule;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
}
|