Interface CacheStore
-
Method Summary
Modifier and TypeMethodDescriptionstatic CacheStorebuild()Builds a no-op cache store.delete(io.vertx.ext.web.client.impl.cache.CacheKey key) Delete a key from the cache.default voiddelete(io.vertx.ext.web.client.impl.cache.CacheKey key, Handler<AsyncResult<Void>> handler) Delete all variations of a key from the cache.flush()Delete all entries from the cache.default voidflush(Handler<AsyncResult<Void>> handler) Delete all entries from the cache.Future<io.vertx.ext.web.client.impl.cache.CachedHttpResponse> get(io.vertx.ext.web.client.impl.cache.CacheKey key) Retrieve a cached response.default voidget(io.vertx.ext.web.client.impl.cache.CacheKey key, Handler<AsyncResult<io.vertx.ext.web.client.impl.cache.CachedHttpResponse>> handler) Retrieve a cached response.static CacheStoreBuilds a cache store that uses aConcurrentHashMap.Future<io.vertx.ext.web.client.impl.cache.CachedHttpResponse> set(io.vertx.ext.web.client.impl.cache.CacheKey key, io.vertx.ext.web.client.impl.cache.CachedHttpResponse response) Add a response in the cache with the given key.default voidset(io.vertx.ext.web.client.impl.cache.CacheKey key, io.vertx.ext.web.client.impl.cache.CachedHttpResponse response, Handler<AsyncResult<io.vertx.ext.web.client.impl.cache.CachedHttpResponse>> handler) Add a response in the cache with the given key.static CacheStoresharedDataStore(Vertx vertx) Builds a cache store that uses anAsyncMapfromSharedData.
-
Method Details
-
build
-
localStore
Builds a cache store that uses aConcurrentHashMap.- Returns:
- the new cache store
-
get
Future<io.vertx.ext.web.client.impl.cache.CachedHttpResponse> get(io.vertx.ext.web.client.impl.cache.CacheKey key) Retrieve a cached response.- Parameters:
key- the key to retrieve- Returns:
- the response as stored in the cache
-
set
Future<io.vertx.ext.web.client.impl.cache.CachedHttpResponse> set(io.vertx.ext.web.client.impl.cache.CacheKey key, io.vertx.ext.web.client.impl.cache.CachedHttpResponse response) Add a response in the cache with the given key.- Parameters:
key- the key to store the response atresponse- the response to store- Returns:
- the response
-
delete
-
flush
-
get
default void get(io.vertx.ext.web.client.impl.cache.CacheKey key, Handler<AsyncResult<io.vertx.ext.web.client.impl.cache.CachedHttpResponse>> handler) Retrieve a cached response.- Parameters:
key- the key to retrievehandler- a handler to receive the cached response- See Also:
-
set
default void set(io.vertx.ext.web.client.impl.cache.CacheKey key, io.vertx.ext.web.client.impl.cache.CachedHttpResponse response, Handler<AsyncResult<io.vertx.ext.web.client.impl.cache.CachedHttpResponse>> handler) Add a response in the cache with the given key.- Parameters:
key- the key to store the response atresponse- the response to storehandler- a handler to receive the stored response- See Also:
-
delete
default void delete(io.vertx.ext.web.client.impl.cache.CacheKey key, Handler<AsyncResult<Void>> handler) Delete all variations of a key from the cache.- Parameters:
key- the key to deletehandler- a handler to receive the delete result- See Also:
-
flush
Delete all entries from the cache.- Parameters:
handler- a handler to receive the flush result.- See Also:
-