Class AbstractHttpRequestClientImpl

java.lang.Object
com.codebarrel.tenant.api.http.AbstractHttpRequestClientImpl
All Implemented Interfaces:
HttpRequestClient

public abstract class AbstractHttpRequestClientImpl extends Object implements HttpRequestClient
  • Constructor Details

    • AbstractHttpRequestClientImpl

      public AbstractHttpRequestClientImpl(HttpClient httpClient)
  • Method Details

    • getRequest

      public <T> HttpEntityResponse<T> getRequest(Class<T> clazz, String path, HttpRequestProperties properties)
      Description copied from interface: HttpRequestClient
      Performs a GET request and marshals the response to the given type
      Specified by:
      getRequest in interface HttpRequestClient
      Type Parameters:
      T - The type to return
      Parameters:
      clazz - the type to return
      path - the path of the resource. E.g. /rest/api/2/issue/createmeta
      properties - extra request properties to add
      Returns:
      the returned response
    • deleteRequest

      public HttpResponse deleteRequest(String path, HttpRequestProperties properties)
      Description copied from interface: HttpRequestClient
      Performs a DELETE request
      Specified by:
      deleteRequest in interface HttpRequestClient
      Parameters:
      path - the path of the resource. E.g. /rest/api/2/issue/createmeta
      properties - extra request properties to add
      Returns:
      the returned response
    • postRequest

      public <T> HttpEntityResponse<T> postRequest(Class<T> clazz, String path, HttpRequestProperties properties, Object body)
      Description copied from interface: HttpRequestClient
      Performs a POST request and marshals the response to the given type
      Specified by:
      postRequest in interface HttpRequestClient
      Type Parameters:
      T - The type to return
      Parameters:
      clazz - the type to return
      path - the path of the resource. E.g. /rest/api/2/issue/createmeta
      properties - extra request properties to add
      body - and object to serialize to JSON and incluse as the body of the post
      Returns:
      the returned response
    • putRequest

      public <T> HttpEntityResponse<T> putRequest(Class<T> clazz, String path, HttpRequestProperties properties, Object body)
      Description copied from interface: HttpRequestClient
      Performs a PUT request and marshals the response to the given type
      Specified by:
      putRequest in interface HttpRequestClient
      Type Parameters:
      T - The type to return
      Parameters:
      clazz - the type to return
      path - the path of the resource. E.g. /rest/api/2/issue/createmeta
      properties - extra request properties to add
      body - and object to serialize to JSON and incluse as the body of the post
      Returns:
      the returned response
    • getUrl

      protected abstract String getUrl(HttpMethod method, String path, Map<String,String[]> params)
    • getAdditionalHeaders

      protected Map<String,String> getAdditionalHeaders()