Class CommandResponse
java.lang.Object
org.apache.zookeeper.server.admin.CommandResponse
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommandResponse(String command) Creates a new response with no error string.CommandResponse(String command, String error, int statusCode) Creates a new response.CommandResponse(String command, String error, int statusCode, InputStream inputStream) Creates a new response. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a header to this response.Gets the command name.getError()Gets the error string (may be null).Returns all headersGets the InputStream (may be null).intGets the http status codeAdds a key/value pair to this response.voidAdds all key/value pairs in the given map to this response.voidsetInputStream(InputStream inputStream) Sets the InputStreamvoidsetStatusCode(int statusCode) Sets the http status codetoMap()Converts this response to a map.
-
Field Details
-
KEY_COMMAND
-
KEY_ERROR
-
-
Constructor Details
-
CommandResponse
Creates a new response with no error string.- Parameters:
command- command name
-
CommandResponse
-
CommandResponse
Creates a new response.- Parameters:
command- command nameerror- error string (may be null)statusCode- http status codeinputStream- inputStream to send out data (may be null)
-
-
Method Details
-
getCommand
-
getError
-
getStatusCode
public int getStatusCode()Gets the http status code- Returns:
- http status code
-
setStatusCode
public void setStatusCode(int statusCode) Sets the http status code -
getInputStream
-
setInputStream
Sets the InputStream -
put
-
putAll
-
addHeader
-
getHeaders
-
toMap
-