Class AbstractHttpConnector<Q extends HttpBaseRequest<Q,R>,R extends HttpResponse>

java.lang.Object
org.camunda.connect.impl.AbstractConnector<Q,R>
org.camunda.connect.httpclient.impl.AbstractHttpConnector<Q,R>
All Implemented Interfaces:
Connector<Q>
Direct Known Subclasses:
HttpConnectorImpl, SoapHttpConnectorImpl

public abstract class AbstractHttpConnector<Q extends HttpBaseRequest<Q,R>,R extends HttpResponse> extends AbstractConnector<Q,R>
  • Field Details

    • LOG

      protected static HttpConnectorLogger LOG
    • httpClient

      protected org.apache.http.impl.client.CloseableHttpClient httpClient
    • charset

      protected final Charset charset
  • Constructor Details

    • AbstractHttpConnector

      public AbstractHttpConnector(String connectorId)
  • Method Details

    • createClient

      protected org.apache.http.impl.client.CloseableHttpClient createClient()
    • getHttpClient

      public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
    • setHttpClient

      public void setHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
    • execute

      public R execute(Q request)
      Description copied from interface: Connector
      Execute the request on the connector.
      Parameters:
      request - the request
      Returns:
      the result.
    • handleErrorResponse

      protected void handleErrorResponse(Q request, R invocationResult)
    • createResponse

      protected abstract R createResponse(org.apache.http.client.methods.CloseableHttpResponse response)
    • createRequest

      public abstract Q createRequest()
      Description copied from interface: Connector
      Create a request on the connector.
      Returns:
      the connector-specific request object.
    • createHttpRequest

      protected <T extends org.apache.http.client.methods.HttpRequestBase> T createHttpRequest(Q request)
      creates a apache Http* representation of the request.
      Parameters:
      request - the given request
      Returns:
      HttpRequestBase an apache representation of the request
    • createHttpRequestBase

      protected <T extends org.apache.http.client.methods.HttpRequestBase> T createHttpRequestBase(Q request)
    • applyHeaders

      protected <T extends org.apache.http.client.methods.HttpRequestBase> void applyHeaders(T httpRequest, Map<String,String> headers)
    • applyPayload

      protected <T extends org.apache.http.client.methods.HttpRequestBase> void applyPayload(T httpRequest, Q request)
    • httpMethodSupportsPayload

      protected <T extends org.apache.http.client.methods.HttpRequestBase> boolean httpMethodSupportsPayload(T httpRequest)
    • applyConfig

      protected <T extends org.apache.http.client.methods.HttpRequestBase> void applyConfig(T httpRequest, Map<String,Object> configOptions)