Class ExecuteJSONReply
java.lang.Object
pt.unl.fct.di.novasys.babel.generic.ProtoIPC
pt.unl.fct.di.novasys.babel.generic.ProtoReply
pt.unl.fct.di.novasys.babel.protocols.storage.replies.common.CommonReply
pt.unl.fct.di.novasys.babel.protocols.storage.replies.common.CommonExecuteReply
pt.unl.fct.di.novasys.babel.protocols.storage.replies.ExecuteJSONReply
A reply of an operation parsed as a JSON string. The object representing the
result is passed as an argument in the construct and converted to a JSON
string by the GSON package. It stores information about the result of the
operation as well as the type of operation (e.g., READ, UPDATE, etc.) issued.
-
Nested Class Summary
Nested classes/interfaces inherited from class pt.unl.fct.di.novasys.babel.generic.ProtoIPC
pt.unl.fct.di.novasys.babel.generic.ProtoIPC.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gson.Gsonstatic final shortFields inherited from class pt.unl.fct.di.novasys.babel.protocols.storage.replies.common.CommonReply
EMPTY_MSG -
Constructor Summary
ConstructorsConstructorDescriptionExecuteJSONReply(CommonOperationStatus status, CommonOperationType type, Object result) Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string.ExecuteJSONReply(CommonOperationStatus status, CommonOperationType type, String keySpace, String collection, String objectID, Object result) Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string.ExecuteJSONReply(CommonOperationStatus status, CommonOperationType type, String keySpace, String collection, String objectID, String message, Object result) Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string.ExecuteJSONReply(CommonOperationStatus status, CommonOperationType type, String keySpace, String collection, String objectID, String message, Object result, String reqID) Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string. -
Method Summary
Modifier and TypeMethodDescriptionGets the result of the operation as a JSON string.Gets the class type associated with the result.Methods inherited from class pt.unl.fct.di.novasys.babel.protocols.storage.replies.common.CommonExecuteReply
getCollection, getKeySpace, getObjectID, getOperationTypeMethods inherited from class pt.unl.fct.di.novasys.babel.protocols.storage.replies.common.CommonReply
getMessage, getReqID, getStatus, hasReqIDMethods inherited from class pt.unl.fct.di.novasys.babel.generic.ProtoReply
getIdMethods inherited from class pt.unl.fct.di.novasys.babel.generic.ProtoIPC
getType
-
Field Details
-
REPLY_ID
public static final short REPLY_ID- See Also:
-
gson
public static final com.google.gson.Gson gson
-
-
Constructor Details
-
ExecuteJSONReply
Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string. No information about the keySpace or collection is passed- Parameters:
status- the status of the operation.type- the type of operation committed.result- the result of the operation.
-
ExecuteJSONReply
public ExecuteJSONReply(CommonOperationStatus status, CommonOperationType type, String keySpace, String collection, String objectID, Object result) Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string.- Parameters:
status- the status of the operation.type- the type of operation committed.keySpace- the keySpace where the operation was executedcollection- the collection where the operation was executedobjectID- the identifier of the objectresult- the result of the operation.
-
ExecuteJSONReply
public ExecuteJSONReply(CommonOperationStatus status, CommonOperationType type, String keySpace, String collection, String objectID, String message, Object result) Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string. The message should detail the status of the operation.- Parameters:
status- the status of the operation.type- the type of operation committed.keySpace- the keySpace where the operation was executedcollection- the collection where the operation was executedobjectID- the identifier of the objectmessage- a message detailing the status.result- the result of the operation.
-
ExecuteJSONReply
public ExecuteJSONReply(CommonOperationStatus status, CommonOperationType type, String keySpace, String collection, String objectID, String message, Object result, String reqID) Creates a execute JSON reply with the status of the operation, the type of operation issued, and an object representing the result, that is going to be converted to a JSON string. The message should detail the status of the operation. Additionally, the reply also stores the request identifier associated with the reply.- Parameters:
status- the status of the operation.type- the type of operation committed.keySpace- the keySpace where the operation was executedcollection- the collection where the operation was executedobjectID- the identifier of the objectmessage- a message detailing the status.result- the result of the operation.reqID- the request identifier associated with the reply.
-
-
Method Details
-
getResult
Gets the result of the operation as a JSON string.- Returns:
- the result of the operation.
-
getResultType
Gets the class type associated with the result. This can aid in parsing the result back to a readable object.- Returns:
- the class type associated with the result.
-