Interface ExchangeHint
-
public interface ExchangeHint
Extra message exchange hint representation for backend services.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Object
getCacheKey()
Return a cache key of this hint.String
getMethodName()
Return method name hint.Object
getRequest()
Deprecated.UsegetRequestHeaders()
andgetRequestBody()
instead.Object
getRequestBody()
Return request body.Map<String,List<String>>
getRequestHeaders()
Return request headers map.Object
getResponseBody()
Return response body.Map<String,List<String>>
getResponseHeaders()
Return response headers map.int
getResponseStatusCode()
Return response status code.boolean
isNoCache()
Return true if the underlyingResourceResolver
should disallow caching.void
setNoCache(boolean noCache)
Set flag whether or not the underlyingResourceResolver
should disallow caching.void
setResponseBody(Object responseBody)
Set response body.void
setResponseHeaders(Map<String,List<String>> responseHeaders)
Set response headers map.void
setResponseStatusCode(int responseStatusCode)
Set response status code.
-
-
-
Method Detail
-
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.UsegetRequestHeaders()
andgetRequestBody()
instead.Return request object representation or custom request callback instance that can be understood by the underlyingResourceResolver
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 underlyingResourceResolver
doesn't set it. The type of response body depends on the underlyingResourceResolver
implementation. It could be aResource
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 underlyingResourceResolver
implementation. It could be aResource
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 underlyingResourceResolver
should disallow caching.- Returns:
- true if the underlying
ResourceResolver
should disallow caching
-
setNoCache
void setNoCache(boolean noCache)
Set flag whether or not the underlyingResourceResolver
should disallow caching.- Parameters:
noCache
- flag whether or not the underlyingResourceResolver
should disallow caching
-
-