info.sswap.api.http
Interface HTTPResponse

All Known Subinterfaces:
HTTPClient.RIGResponse, HTTPClient.RQGResponse, HTTPProvider.PDGResponse, HTTPProvider.RDGResponse, HTTPProvider.RRGResponse
All Known Implementing Classes:
AbstractHTTPResponse, HTTPAPIImpl.PDGResponse, HTTPAPIImpl.RDGResponse, HTTPAPIImpl.RIGResponse, HTTPAPIImpl.RQGResponse, HTTPAPIImpl.RRGResponse

public interface HTTPResponse

Response information from a HTTP network call. Based on the Response class of com.clarkparsia.utils.web.Response.


Method Summary
 void close()
          Close this response
 java.io.InputStream getContent()
          Return the response content from the server
 java.io.InputStream getErrorStream()
          Return the error stream from the connection
 java.lang.Exception getException()
          Access to an underlying exception that may have been thrown upon failure to generate a response.
 java.util.Collection<java.lang.String> getHeaders()
          Return all headers returned by the server
 java.lang.String getHeaderValue(java.lang.String headerName)
          Returns the unparsed value of the HTTP header
 java.util.Collection<java.lang.String> getHeaderValues(java.lang.String headerName)
          Returns the values of the HTTP header parsed on the comma delimiter
 java.lang.String getMessage()
          Return the response message from the server
 int getResponseCode()
          Return the response code
 java.lang.String getSSWAPExceptionHeader()
          Returns the header being used for SSWAP Exceptions.
 java.util.Collection<java.lang.String> getSSWAPExceptionValues()
          Returns values, if any, for the SSWAP Exception Header(s).
 boolean hasErrorCode()
          Return whether or not this has an error result
 

Method Detail

getErrorStream

java.io.InputStream getErrorStream()
Return the error stream from the connection

Returns:
the error stream

getMessage

java.lang.String getMessage()
Return the response message from the server

Returns:
the message

getHeaders

java.util.Collection<java.lang.String> getHeaders()
Return all headers returned by the server

Returns:
a Map of each header name and a List of its values

getHeaderValue

java.lang.String getHeaderValue(java.lang.String headerName)
Returns the unparsed value of the HTTP header

Parameters:
headerName - the header name
Returns:
the header value; null if a header for headerName does not exist

getHeaderValues

java.util.Collection<java.lang.String> getHeaderValues(java.lang.String headerName)
Returns the values of the HTTP header parsed on the comma delimiter

Parameters:
headerName - the header name
Returns:
the header values; null if a header for headerName does not exist

getSSWAPExceptionValues

java.util.Collection<java.lang.String> getSSWAPExceptionValues()
Returns values, if any, for the SSWAP Exception Header(s). If there are no exceptions the collection will be empty, but not null.

Returns:
SSWAP over HTTP Exception messages
See Also:
getSSWAPExceptionHeader()

getSSWAPExceptionHeader

java.lang.String getSSWAPExceptionHeader()
Returns the header being used for SSWAP Exceptions.

Returns:
SSWAP Exception header
See Also:
getSSWAPExceptionValues()

getException

java.lang.Exception getException()
Access to an underlying exception that may have been thrown upon failure to generate a response.

Returns:
exception; may be null

getResponseCode

int getResponseCode()
Return the response code

Returns:
the response code

getContent

java.io.InputStream getContent()
Return the response content from the server

Returns:
the response content

hasErrorCode

boolean hasErrorCode()
Return whether or not this has an error result

Returns:
true if there is an error result, false otherwise

close

void close()
           throws java.io.IOException
Close this response

Throws:
java.io.IOException - if there is an error while closing


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.