public abstract class RestResponse extends Object
This class abstracts the response from the admin console code so that we can use JSON / REST interchangeably.
Constructor and Description |
---|
RestResponse() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close() |
abstract Map<String,Object> |
getResponse()
This method abstracts the physical response to return a consistent
data structure.
|
abstract String |
getResponseBody() |
abstract int |
getResponseCode() |
static RestResponse |
getRestResponse(javax.ws.rs.core.Response response) |
boolean |
isSuccess() |
public abstract int getResponseCode()
public abstract String getResponseBody()
public static RestResponse getRestResponse(javax.ws.rs.core.Response response)
public boolean isSuccess()
public abstract Map<String,Object> getResponse()
This method abstracts the physical response to return a consistent data structure. For many responses, this data structure may look like:
Map<String, Object>
{
"responseCode" : Integer // HTTP Response code, ie. 200
"output" : String // The Raw Response Body
"description" : String // Command Description
// 0 or more messages returned from the command
"messages" : List<Map<String, Object>>
[
{
"message" : String // Raw Message String
"..." : String // Additional custom attributes
// List of properties for this message
"properties" : List<Map<String, Object>>
[
{
"name" : String // The Property Name
"value" : String // The Property Value
"properties" : List // Child Properties
}, ...
]
}, ...
]
}
public abstract void close()
Copyright © 2019. All rights reserved.