1 package org.lsst.ccs.bus;
2
3
4
5
6
7
8 public class CommandReply extends CommandAckOrReply {
9
10 private static final long serialVersionUID = -8056794161035014352L;
11
12 @Override
13 public String getMessageType() {
14 return "lsst.reply";
15 }
16
17
18
19
20
21 public enum CommandStatus {
22 OK, OK_VOID, ERROR;
23 };
24
25 CommandStatus status;
26 Object reply;
27
28
29 @Deprecated
30 public CommandReply(Object reply, CommandStatus status) {
31 super();
32 this.reply = reply;
33 this.status = status;
34 }
35
36
37 public CommandReply(Command command, Object reply, CommandStatus status, String origin) {
38 super(command,origin);
39 this.status = status;
40 this.reply = reply;
41 }
42 public CommandReply(Command command, String origin) {
43 super(command,origin);
44 this.status= CommandStatus.OK_VOID ;
45 }
46
47 public CommandReply(Command command, Throwable th , String origin) {
48 super(command,origin);
49 this.status= CommandStatus.ERROR ;
50 this.reply = th ;
51 }
52
53
54
55
56 public CommandStatus getStatus() {
57 return status;
58 }
59
60
61
62
63 public Object getReply() {
64 return reply;
65 }
66
67 @Override
68 public String toString() {
69 return getClass().getName() + "(" + status + "/" + reply + " from "
70 + origin + ")";
71 }
72 }