public class OperationReply
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ERROR_REPLY |
static int |
REPLY
The following are a list of available type of reply.
|
Constructor and Description |
---|
OperationReply()
Basic constructor to create an instance of OperationReply object.
|
OperationReply(int status,
java.lang.Object result)
Basic constructor to create an instance of OperationReply object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getResult()
Return the result to be sent to the client.
|
int |
getStatus()
Return the status of the operation reply.
|
void |
setErrorReply(java.lang.String message)
Set the operation reply to return an error reply with an error message.
|
void |
setResult(java.lang.Object result)
Set the return result to be sent to the client after invoking a method.
|
void |
setStatus(int status)
Set the the status of the operation reply.
|
public static final int REPLY
public static final int ERROR_REPLY
public OperationReply()
public OperationReply(int status, java.lang.Object result)
status
- the type of reply to send. (REPLY or ERROR_REPLY).result
- the return result after invoking a method.public int getStatus()
The status can be either one of the value: REPLY (0) or ERROR_REPLY (1). When the status is on ERROR_REPLY (1), the result variable of this object will contain the error message to describe the error encounter when invoking a method.
public void setStatus(int status)
Use the constant variable in this class to set it to the appropriate types: REPLY or ERROR_REPLY.
status
- the type of the operation reply.public java.lang.Object getResult()
public void setResult(java.lang.Object result)
result
- the return result after invoking a method.public void setErrorReply(java.lang.String message)
message
- the error message.