Package com.atlan.net

Class LiveAtlanResponseGetter

java.lang.Object
com.atlan.net.LiveAtlanResponseGetter
All Implemented Interfaces:
AtlanResponseGetter

public class LiveAtlanResponseGetter extends Object implements AtlanResponseGetter
Class that wraps the API request and response handling, such as detecting errors from specific response codes.
  • Constructor Details

    • LiveAtlanResponseGetter

      public LiveAtlanResponseGetter()
      Initializes a new instance of the LiveAtlanResponseGetter class with default parameters.
    • LiveAtlanResponseGetter

      public LiveAtlanResponseGetter(HttpClient httpClient)
      Initializes a new instance of the LiveAtlanResponseGetter class.
      Parameters:
      httpClient - the HTTP client to use
  • Method Details

    • request

      public void request(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId) throws AtlanException
      Send a request to Atlan API, when no response is expected.
      Specified by:
      request in interface AtlanResponseGetter
      Parameters:
      client - connectivity details for the tenant to which to send the request
      method - type of request
      url - endpoint for the request
      body - payload to send as the body of the request
      options - any one-off options for this specific request
      requestId - unique identifier for this specific request
      Throws:
      AtlanException - on any API interaction problem, indicating the type of problem encountered
    • request

      public <T extends AtlanResponseInterface> T request(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options, String requestId) throws AtlanException
      Send a request to an Atlan API, when a response is expected.
      Specified by:
      request in interface AtlanResponseGetter
      Type Parameters:
      T - the type of the response of the request
      Parameters:
      client - connectivity to Atlan
      method - to use for the request
      url - of the endpoint (with all path and query parameters) for the request
      body - payload for the request, if any
      clazz - the expected response object type from the request
      options - any alternative options to use for the request, or null to use default options
      requestId - unique identifier (GUID) of a single request to Atlan
      Returns:
      the response of the request
      Throws:
      AtlanException - on any API interaction problem, indicating the type of problem encountered
    • requestPlainText

      public String requestPlainText(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId) throws AtlanException
      Send a request to an Atlan API, when a response is expected. This handles the response as plain text, rather than JSON.
      Specified by:
      requestPlainText in interface AtlanResponseGetter
      Parameters:
      client - connectivity to Atlan
      method - to use for the request
      url - of the endpoint (with all path and query parameters) for the request
      body - payload for the request, if any
      options - any alternative options to use for the request, or null to use default options
      requestId - unique identifier (GUID) of a single request to Atlan
      Returns:
      the response of the request
      Throws:
      AtlanException - on any API interaction problem, indicating the type of problem encountered
    • requestStream

      public <T extends AtlanEventStreamResponseInterface> T requestStream(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options, String requestId) throws AtlanException
      Send a request to an Atlan API, when an event-stream response is expected.
      Specified by:
      requestStream in interface AtlanResponseGetter
      Type Parameters:
      T - the type of the response of the request
      Parameters:
      client - connectivity to Atlan
      method - to use for the request
      url - of the endpoint (with all path and query parameters) for the request
      body - payload for the request, if any
      clazz - the expected response object type from the request
      options - any alternative options to use for the request, or null to use default options
      requestId - unique identifier (GUID) of a single request to Atlan
      Returns:
      the response of the request
      Throws:
      AtlanException - on any API interaction problem, indicating the type of problem encountered
    • request

      public <T extends AtlanResponseInterface> T request(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream upload, String filename, Class<T> clazz, Map<String,String> extras, RequestOptions options, String requestId) throws AtlanException
      Send a request to an Atlan API, to upload a file.
      Specified by:
      request in interface AtlanResponseGetter
      Type Parameters:
      T - the type of the response of the request
      Parameters:
      client - connectivity to Atlan
      method - to use for the request
      url - of the endpoint (with all path and query parameters) for the request
      upload - file to be uploaded
      filename - name of the file the InputStream is reading
      clazz - the expected response object type from the request
      extras - (optional) additional form-encoded parameters to send
      options - any alternative options to use for the request, or null to use default options
      requestId - unique identifier (GUID) of a single request to Atlan
      Returns:
      the response of the request
      Throws:
      AtlanException - on any API interaction problems, indicating the type of problem encountered
    • request

      public <T extends AtlanResponseInterface> T request(AtlanClient client, ApiResource.RequestMethod method, String url, Map<String,Object> map, Class<T> clazz, RequestOptions options, String requestId) throws AtlanException
      Makes a request to Atlan's API, to form-urlencode parameters.
      Specified by:
      request in interface AtlanResponseGetter
      Type Parameters:
      T - the type of the response of the request
      Parameters:
      client - connectivity to Atlan
      method - to use for the request
      url - of the endpoint (with all path and query parameters) for the request
      map - of key-value pairs to be form-urlencoded
      clazz - the expected response object type from the request
      options - any alternative options to use for the request, or null to use default options
      requestId - unique identifier (GUID) of a single request to Atlan
      Returns:
      the response of the request
      Throws:
      AtlanException - on any API interaction problems, indicating the type of problem encountered