public class SimpleQueryRequest extends SimpleRequest
Query for a data value. Some data values require a user identity for access.
The request data object is defined as:
data = {
"#mandatory" : [ "key" ],
"key" : "string"
} where:
key is the data key identifying the value.SimpleRequest.Type| Constructor and Description |
|---|
SimpleQueryRequest(java.lang.String identity,
SimpleUser user,
org.json.JSONObject data)
Create a new query request.
|
| Modifier and Type | Method and Description |
|---|---|
SimpleRespondMessageContext |
execute()
Executes the operation and returns the response.
|
org.json.JSONObject |
getData() |
java.lang.String |
getKey() |
getIdentity, getType, getUser, parse, toJSONStringpublic SimpleQueryRequest(java.lang.String identity,
SimpleUser user,
org.json.JSONObject data)
throws SimpleRequestParseException
Create a new query request.
identity - requesting entity identity.user - requesting user. May be null.data - the request data.SimpleRequestParseException - if there is an error parsing the
request data.public java.lang.String getKey()
public org.json.JSONObject getData()
getData in class SimpleRequestpublic SimpleRespondMessageContext execute() throws SimpleRequestUserException, SimpleRequestExecutionException
SimpleRequestExecutes the operation and returns the response.
execute in class SimpleRequestSimpleRequestUserException - if the request type requires a user
but there is none provided.SimpleRequestExecutionException - if there is an error executing
the request.