java.lang.Object
com.github.mizosoft.methanol.internal.cache.RawResponse
com.github.mizosoft.methanol.internal.cache.CacheResponse
- All Implemented Interfaces:
Closeable
,AutoCloseable
A
RawResponse
retrieved from cache.-
Constructor Summary
ConstructorDescriptionCacheResponse
(TrackedResponse<?> response, Store.Viewer viewer, Executor executor, CacheReadingPublisher.Listener readListener, HttpRequest request, Instant now) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
conditionalize
(HttpRequest request) edit()
<T> CompletableFuture
<TrackedResponse<T>> handleAsync
(HttpResponse.BodyHandler<T> handler, Executor executor) boolean
boolean
boolean
with
(Consumer<ResponseBuilder<?>> mutator) Add the additional cache headers advised by rfc7234 like Age and Warning.Methods inherited from class com.github.mizosoft.methanol.internal.cache.RawResponse
get, handle
-
Constructor Details
-
CacheResponse
public CacheResponse(TrackedResponse<?> response, Store.Viewer viewer, Executor executor, CacheReadingPublisher.Listener readListener, HttpRequest request, Instant now)
-
-
Method Details
-
with
- Specified by:
with
in classRawResponse
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
edit
- Throws:
IOException
InterruptedException
-
isServable
public boolean isServable() -
isServableWhileRevalidating
public boolean isServableWhileRevalidating() -
isServableOnError
public boolean isServableOnError() -
conditionalize
-
withCacheHeaders
Add the additional cache headers advised by rfc7234 like Age and Warning. -
handleAsync
public <T> CompletableFuture<TrackedResponse<T>> handleAsync(HttpResponse.BodyHandler<T> handler, Executor executor) - Specified by:
handleAsync
in classRawResponse
-