[44] | 1 | package omq.common.message; |
---|
| 2 | |
---|
| 3 | import java.io.Serializable; |
---|
| 4 | |
---|
| 5 | import omq.exception.OmqException; |
---|
| 6 | |
---|
[83] | 7 | /** |
---|
| 8 | * Serializable response information. This class is used to send the information |
---|
| 9 | * to the client proxy. It has information about which remoteObject has invoked |
---|
| 10 | * the method and its correlation id. This class also has the result of the |
---|
| 11 | * invoke if everything has gone fine in the server or an error otherwise. |
---|
| 12 | * |
---|
| 13 | * @author Sergi Toda <sergi.toda@estudiants.urv.cat> |
---|
| 14 | * |
---|
| 15 | */ |
---|
[44] | 16 | public class Response implements Serializable { |
---|
| 17 | |
---|
| 18 | /** |
---|
| 19 | * |
---|
| 20 | */ |
---|
| 21 | private static final long serialVersionUID = 3368363997012527189L; |
---|
| 22 | |
---|
| 23 | private Object result; |
---|
| 24 | private OmqException error; |
---|
| 25 | private String id; |
---|
| 26 | private String idOmq; |
---|
| 27 | |
---|
[83] | 28 | // Used by kryo |
---|
[44] | 29 | public Response() { |
---|
| 30 | } |
---|
| 31 | |
---|
[83] | 32 | /** |
---|
| 33 | * Creates a new Response object to be serialized |
---|
| 34 | * |
---|
| 35 | * @param id |
---|
| 36 | * - correlation id of the invoke |
---|
| 37 | * @param idOmq |
---|
| 38 | * - objectmq's identifier -bind reference- |
---|
| 39 | * @param result |
---|
| 40 | * - result of the invocation |
---|
| 41 | * @param error |
---|
| 42 | * - error thrown by the invocation |
---|
| 43 | */ |
---|
[44] | 44 | public Response(String id, String idOmq, Object result, OmqException error) { |
---|
| 45 | this.id = id; |
---|
| 46 | this.idOmq = idOmq; |
---|
| 47 | this.result = result; |
---|
| 48 | this.error = error; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | public String getId() { |
---|
| 52 | return id; |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | public void setId(String id) { |
---|
| 56 | this.id = id; |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | public String getIdOmq() { |
---|
| 60 | return idOmq; |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | public void setIdOmq(String idOmq) { |
---|
| 64 | this.idOmq = idOmq; |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | public Object getResult() { |
---|
| 68 | return result; |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | public void setResult(Object result) { |
---|
| 72 | this.result = result; |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | public OmqException getError() { |
---|
| 76 | return error; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | public void setError(OmqException error) { |
---|
| 80 | this.error = error; |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | } |
---|