public abstract class OAuthClientResponse extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
body |
protected String |
contentType |
protected Map<String,List<String>> |
headers |
protected Map<String,Object> |
parameters |
protected int |
responseCode |
protected OAuthClientValidator |
validator |
| Constructor and Description |
|---|
OAuthClientResponse() |
| Modifier and Type | Method and Description |
|---|---|
String |
getParam(String param) |
int |
getResponseCode() |
protected void |
init(InputStream body,
String contentType,
int responseCode,
Map<String,List<String>> headers)
Default implementation that converts the body InputStream to a String and delegates
to
init(String, String, int). |
protected void |
init(String body,
String contentType,
int responseCode) |
protected void |
init(String body,
String contentType,
int responseCode,
Map<String,List<String>> headers) |
protected void |
setBody(InputStream body)
Allows setting the response body to an InputStream value.
|
protected void |
setBody(String body)
Allows setting the response body to a String value.
|
protected abstract void |
setContentType(String contentType) |
void |
setHeaders(Map<String,List<String>> headers) |
protected abstract void |
setResponseCode(int responseCode) |
protected void |
validate() |
protected String body
protected String contentType
protected int responseCode
protected OAuthClientValidator validator
public int getResponseCode()
protected void setBody(String body) throws org.apache.oltu.oauth2.common.exception.OAuthProblemException
body - A String representing the response body.org.apache.oltu.oauth2.common.exception.OAuthProblemExceptionUnsupportedOperationException - for subclasses that only
support InputStream as bodyprotected void setBody(InputStream body) throws org.apache.oltu.oauth2.common.exception.OAuthProblemException
body - An InputStream representing the response body.org.apache.oltu.oauth2.common.exception.OAuthProblemExceptionUnsupportedOperationException - for subclasses that only
support String as bodyprotected abstract void setContentType(String contentType)
protected abstract void setResponseCode(int responseCode)
protected void init(String body, String contentType, int responseCode, Map<String,List<String>> headers) throws org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthProblemExceptionprotected void init(String body, String contentType, int responseCode) throws org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthProblemExceptionprotected void init(InputStream body, String contentType, int responseCode, Map<String,List<String>> headers) throws org.apache.oltu.oauth2.common.exception.OAuthProblemException
init(String, String, int).
body - an InputStream representing the response bodycontentType - the content type of the response.responseCode - the HTTP response code of the response.headers - The HTTP response headersorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionprotected void validate()
throws org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthProblemExceptionCopyright © 2010–2016 The Apache Software Foundation. All rights reserved.