m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pl/edu/mimuw/cloudatlas/agent/messages/UDUPMessage.java
blob: b955340dd8b2538822c00828a2908b96c6e17e3e (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
package pl.edu.mimuw.cloudatlas.agent.messages;

import pl.edu.mimuw.cloudatlas.agent.modules.Module;
import pl.edu.mimuw.cloudatlas.agent.modules.ModuleType;
import pl.edu.mimuw.cloudatlas.model.ValueContact;

public class UDUPMessage extends AgentMessage {
    private ValueContact contact;
    private RemoteGossipGirlMessage content;

    public UDUPMessage(String messageId, long timestamp, ValueContact contact, RemoteGossipGirlMessage content) {
        super(messageId, ModuleType.UDP, timestamp);
        this.contact = contact;
        this.content = content;
    }

    public UDUPMessage(String messageId, ValueContact contact, RemoteGossipGirlMessage content) {
        super(messageId, ModuleType.UDP);
        this.contact = contact;
        this.content = content;
    }

    public UDUPMessage() {}

    @Override
    public void callMe(Module module) throws InterruptedException, Module.InvalidMessageType {
        module.handleTyped(this);
    }

    public RemoteGossipGirlMessage getContent() {
        return content;
    }

    public void setContent(RemoteGossipGirlMessage content) {
        this.content = content;
    }

    public ValueContact getContact() { return contact; }

    public void setContact(ValueContact contact) {
        this.contact = contact;
    }
}