public class MessageFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
COLLECT |
static int |
DECIDE |
static int |
FREEZE |
static int |
PROPOSE |
static int |
STRONG |
static int |
WEAK |
Constructor and Description |
---|
MessageFactory(int from)
Creates a message factory
|
Modifier and Type | Method and Description |
---|---|
PaxosMessage |
createCollect(int id,
int round,
java.lang.Object proof)
Creates a COLLECT message to be sent by this process
|
PaxosMessage |
createDecide(int id,
int round,
byte[] value)
Creates a DECIDE message to be sent by this process
|
PaxosMessage |
createFreeze(int id,
int round)
Creates a FREEZE message to be sent by this process
|
PaxosMessage |
createPropose(int id,
int round,
byte[] value,
java.lang.Object proof)
Creates a PROPOSE message to be sent by this process
|
PaxosMessage |
createStrong(int id,
int round,
byte[] value)
Creates a STRONG message to be sent by this process
|
PaxosMessage |
createWeak(int id,
int round,
byte[] value)
Creates a WEAK message to be sent by this process
|
public static final int PROPOSE
public static final int WEAK
public static final int STRONG
public static final int DECIDE
public static final int FREEZE
public static final int COLLECT
public MessageFactory(int from)
from
- Replica ID of the process which sent this messagepublic PaxosMessage createPropose(int id, int round, byte[] value, java.lang.Object proof)
id
- Consensus's execution IDround
- Round numbervalue
- Proposed valueproof
- Proofs from other replicaspublic PaxosMessage createWeak(int id, int round, byte[] value)
id
- Consensus's execution IDround
- Round numbervalue
- Weakly accepted valuepublic PaxosMessage createStrong(int id, int round, byte[] value)
id
- Consensus's execution IDround
- Round numbervalue
- Strongly accepted valuepublic PaxosMessage createDecide(int id, int round, byte[] value)
id
- Consensus's execution IDround
- Round numbervalue
- Decided valuepublic PaxosMessage createFreeze(int id, int round)
id
- Consensus's execution IDround
- Round numberpublic PaxosMessage createCollect(int id, int round, java.lang.Object proof)
id
- Consensus's execution IDround
- Round numberproof
- The proof to be sent by the leader for all replicas