public class DefaultRequest extends Request
Request.Builder
Constructor and Description |
---|
DefaultRequest(NetService.NetRequest request)
Initialize.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAuthorization()
Returns authorization of the request.
|
java.lang.String |
getCommand()
Returns command.
|
org.json.JSONObject |
getJson()
Returns JSONObject of the request.
|
long |
getReciveTime()
Returns receive time of the request.
|
java.lang.String |
getSource()
Returns source text of the request.
|
void |
send(java.lang.String message)
Send message as a response.
|
void |
sendClose(java.lang.String message)
Send message as a response and close connection.
|
void |
setAuthorization(java.lang.String authorization)
Set authorization of the request.
|
void |
setCommand(java.lang.String command)
Set command of the request.
|
void |
setJson(org.json.JSONObject json)
Set JSONObject of the request.
|
void |
setReciveTime(long timestamp)
Set receive time of the request.
|
void |
setSource(java.lang.String source)
Set source text of the request.
|
public DefaultRequest(NetService.NetRequest request)
request
- requestpublic java.lang.String getCommand()
public void setCommand(java.lang.String command)
command
- commandpublic long getReciveTime()
public void setReciveTime(long timestamp)
timestamp
- millisecondpublic java.lang.String getAuthorization()
public void setAuthorization(java.lang.String authorization)
authorization
- authorizationpublic java.lang.String getSource()
public void setSource(java.lang.String source)
source
- sourcepublic org.json.JSONObject getJson()
public void setJson(org.json.JSONObject json)
json
- jsonpublic void send(java.lang.String message)
message
- messagepublic void sendClose(java.lang.String message)
message
- message