-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClientMessage.java
executable file
·74 lines (59 loc) · 1.73 KB
/
ClientMessage.java
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
71
72
73
74
public class ClientMessage extends MessageBase{
public Integer TransactionNo = null;
public String readObject = null;
public String writeObject = null;
public String qualifier = null;
public String value = null;
public MessageType type = null;
public String source = null;
//begin trans
public ClientMessage(String source, MessageType type)
{
this.source = source;
this.type = type;
}
//read
public ClientMessage(String source,MessageType type,Integer transNo, String readObject,String qualifier)
{
this.source = source;
this.type = type;
this.TransactionNo = transNo;
this.readObject = readObject;
this.qualifier = qualifier;
}
//write
public ClientMessage(String source,MessageType type,Integer transNo, String writeObject, String qual, String value)
{
this.source = source;
this.type = type;
this.TransactionNo = transNo;
this.writeObject = writeObject;
this.qualifier = qual;
this.value = value;
}
//commit or abort
public ClientMessage(String source,MessageType type, Integer transNo)
{
this.source = source;
this.type = type;
this.TransactionNo = transNo;
}
@Override
public String toString() {
// TODO Auto-generated method stub
StringBuffer buffer = new StringBuffer();
buffer.append("Source : "+source+" \n");
buffer.append("Message Type : "+type+" \n");
if(TransactionNo != null)
buffer.append("Trans Number : "+TransactionNo+" \n");
if(readObject != null)
buffer.append("Read Object : "+readObject+" \n");
if(writeObject != null)
buffer.append("Write Object : "+writeObject+" \n");
if(qualifier != null)
buffer.append("Qualifier : "+qualifier+" \n");
if(value != null)
buffer.append("Value : "+value+" \n");
return buffer.toString();
}
}