Class HttpResponseImpl
- java.lang.Object
-
- org.camunda.connect.impl.AbstractConnectorResponse
-
- org.camunda.connect.impl.AbstractCloseableConnectorResponse
-
- org.camunda.connect.httpclient.impl.HttpResponseImpl
-
- All Implemented Interfaces:
HttpResponse,CloseableConnectorResponse,ConnectorResponse
- Direct Known Subclasses:
SoapHttpResponseImpl
public class HttpResponseImpl extends AbstractCloseableConnectorResponse implements HttpResponse
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.http.client.methods.CloseableHttpResponsehttpResponse-
Fields inherited from class org.camunda.connect.impl.AbstractConnectorResponse
responseParameters
-
Fields inherited from interface org.camunda.connect.httpclient.HttpResponse
PARAM_NAME_RESPONSE, PARAM_NAME_RESPONSE_HEADERS, PARAM_NAME_STATUS_CODE
-
-
Constructor Summary
Constructors Constructor Description HttpResponseImpl(org.apache.http.client.methods.CloseableHttpResponse httpResponse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcollectResponseHeaders()protected voidcollectResponseParameters(java.util.Map<java.lang.String,java.lang.Object> responseParameters)To be implemented by subclasses for collecting the generic response parameters of a response.protected java.io.CloseablegetClosable()Allows subclasses to provide the closeable resource.java.lang.StringgetHeader(java.lang.String field)java.util.Map<java.lang.String,java.lang.String>getHeaders()java.lang.StringgetResponse()java.lang.IntegergetStatusCode()-
Methods inherited from class org.camunda.connect.impl.AbstractCloseableConnectorResponse
close
-
Methods inherited from class org.camunda.connect.impl.AbstractConnectorResponse
getResponseParameter, getResponseParameters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.camunda.connect.spi.CloseableConnectorResponse
close
-
Methods inherited from interface org.camunda.connect.spi.ConnectorResponse
getResponseParameter, getResponseParameters
-
-
-
-
Method Detail
-
getStatusCode
public java.lang.Integer getStatusCode()
- Specified by:
getStatusCodein interfaceHttpResponse- Returns:
- the HTTP status code of the response
-
getResponse
public java.lang.String getResponse()
- Specified by:
getResponsein interfaceHttpResponse- Returns:
- the response body or null if non exists
-
getHeaders
public java.util.Map<java.lang.String,java.lang.String> getHeaders()
- Specified by:
getHeadersin interfaceHttpResponse- Returns:
- the response headers
-
getHeader
public java.lang.String getHeader(java.lang.String field)
- Specified by:
getHeaderin interfaceHttpResponse- Returns:
- return the response header value for the given field or null if not set
-
collectResponseParameters
protected void collectResponseParameters(java.util.Map<java.lang.String,java.lang.Object> responseParameters)
Description copied from class:AbstractConnectorResponseTo be implemented by subclasses for collecting the generic response parameters of a response.- Specified by:
collectResponseParametersin classAbstractConnectorResponse- Parameters:
responseParameters- a map to save the response parameters in
-
collectResponseHeaders
protected void collectResponseHeaders()
-
getClosable
protected java.io.Closeable getClosable()
Description copied from class:AbstractCloseableConnectorResponseAllows subclasses to provide the closeable resource.- Specified by:
getClosablein classAbstractCloseableConnectorResponse- Returns:
- the
Closeableresource
-
-