Interface ResponseHandler

All Known Implementing Classes:
BaseResponseHandler

public interface ResponseHandler
Interface to handle the response from the Vantiq server.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onError(List<VantiqError> errors, okhttp3.Response response)
    Called if a server error is returned (e.g.
    void
    Called if a client side exception occurs during the request or response processing.
    void
    onSuccess(Object body, okhttp3.Response response)
    This is called when a successful HTTP response is returned from the server.
  • Method Details

    • onSuccess

      void onSuccess(Object body, okhttp3.Response response)
      This is called when a successful HTTP response is returned from the server. The type of the body is determined by the Content-Type of the response. For JSON responses, the body will be a Gson JsonElement. Otherwise, a string is returned.
      Parameters:
      body - The parsed response from the server. The type of the response is determined by SDK method being called.
      response - The raw response from the server. This provides access to the HTTP status code, headers, and raw body.
    • onError

      void onError(List<VantiqError> errors, okhttp3.Response response)
      Called if a server error is returned (e.g. HTTP 4xx or 5xx status codes), then the status code is returned along with the errors that were found.
      Parameters:
      errors - The errors returned by the Vantiq server.
      response - The raw response from the server. This provides access to the HTTP status code, headers, and raw body.
    • onFailure

      void onFailure(Throwable t)
      Called if a client side exception occurs during the request or response processing.
      Parameters:
      t - The exception thrown during the client-side processing.