org.glassfish.admingui.common.util
Class RestResponse

java.lang.Object
  extended by org.glassfish.admingui.common.util.RestResponse

public abstract class RestResponse
extends java.lang.Object

This class abstracts the response from the admin console code so that we can use JSON / REST interchangeably.

Author:
jasonlee, Ken Paulsen (ken.paulsen@oracle.com)

Constructor Summary
RestResponse()
           
 
Method Summary
abstract  void close()
           
abstract  java.util.Map<java.lang.String,java.lang.Object> getResponse()
           This method abstracts the physical response to return a consistent data structure.
abstract  java.lang.String getResponseBody()
           
abstract  int getResponseCode()
           
static RestResponse getRestResponse(com.sun.jersey.api.client.ClientResponse response)
           
 boolean isSuccess()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestResponse

public RestResponse()
Method Detail

getResponseCode

public abstract int getResponseCode()

getResponseBody

public abstract java.lang.String getResponseBody()

getRestResponse

public static RestResponse getRestResponse(com.sun.jersey.api.client.ClientResponse response)

isSuccess

public boolean isSuccess()

getResponse

public abstract java.util.Map<java.lang.String,java.lang.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 }, ... ] }, ... ] }


close

public abstract void close()


Copyright © 2012 GlassFish Community. All Rights Reserved.