Interface ExchangeHint


public interface ExchangeHint
Extra message exchange hint representation for backend services.
  • Method Details

    • getMethodName

      String getMethodName()
      Return method name hint. e.g, "POST", "PUT", "DELETE", "GET", etc. for http-based backends.
      Returns:
      method name hint. e.g, "POST", "PUT", "DELETE", "GET", etc. for http-based backends
    • getRequest

      @Deprecated Object getRequest()
      Deprecated.
      Return request object representation or custom request callback instance that can be understood by the underlying ResourceResolver implementation.
      Returns:
      request object representation to be understood by the underlying ResourceResolver implementation
    • getRequestHeaders

      Map<String,List<String>> getRequestHeaders()
      Return request headers map.
      Returns:
      request headers map
    • getRequestBody

      Object getRequestBody()
      Return request body.
      Returns:
      request body
    • getCacheKey

      Object getCacheKey()
      Return a cache key of this hint.
      Returns:
      a cache key of this hint
    • getResponseStatusCode

      int getResponseStatusCode()
      Return response status code.
      Returns:
      response status code
    • setResponseStatusCode

      void setResponseStatusCode(int responseStatusCode)
      Set response status code.
      Parameters:
      responseStatusCode - response status code
    • getResponseHeaders

      Map<String,List<String>> getResponseHeaders()
      Return response headers map.
      Returns:
      response headers map
    • setResponseHeaders

      void setResponseHeaders(Map<String,List<String>> responseHeaders)
      Set response headers map.
      Parameters:
      responseHeaders - response headers map
    • getResponseBody

      Object getResponseBody()
      Return response body. Null if the underlying ResourceResolver doesn't set it. The type of response body depends on the underlying ResourceResolver implementation. It could be a Resource object (mostly likely when the backend produces the same content type for both normal response and error response), byte[] or String, for example.

      Note: This method can be used mostly when the underlying ResourceResolver throws an exception instead of returning a result.

      Returns:
      response body
    • setResponseBody

      void setResponseBody(Object responseBody)
      Set response body. The type of response body depends on the underlying ResourceResolver implementation. It could be a Resource object (mostly likely when the backend produces the same content type for both normal response and error response), byte[] or String, for example.

      Note: This method can be used by the underlying ResourceResolver when a call on the backend returns an error, instead of a normal result.

      Parameters:
      responseBody - response body
    • isNoCache

      boolean isNoCache()
      Return true if the underlying ResourceResolver should disallow caching.
      Returns:
      true if the underlying ResourceResolver should disallow caching
    • setNoCache

      void setNoCache(boolean noCache)
      Set flag whether or not the underlying ResourceResolver should disallow caching.
      Parameters:
      noCache - flag whether or not the underlying ResourceResolver should disallow caching