Interface Cache


  • public interface Cache
    • Method Detail

      • newInMemoryCacheBuilder

        static Cache.InMemoryCacheBuilder newInMemoryCacheBuilder()
        Creates a new InMemoryCacheBuilder instance.
        Returns:
        the new InMemoryCacheBuilder.
      • noop

        static Cache noop()
        Gets the Cache effectively does not do anything.
        Returns:
        a stub cache.
      • get

        Cache.CacheEntry get​(java.net.http.HttpRequest request)
        Gets the cache entry associated with request.
        Parameters:
        request - The request.
        Returns:
        the cache entry associated with request or null.
      • put

        void put​(java.net.http.HttpRequest request,
                 Cache.CacheEntry entry)
        Associates request with entry and stores it in this cache. The previously (if any) associated entry will be evicted.
        Parameters:
        request - The request.
        entry - The entry.
      • evict

        void evict​(java.net.http.HttpRequest request)
        Evicts cache entry (if any) associated with request.
        Parameters:
        request - The request.
      • evictAll

        void evictAll​(java.net.http.HttpRequest request)
        Evicts all cache entries associated with request.
        Parameters:
        request - The request.
      • evictAll

        void evictAll()
        Removes all cache entries. This cache will be empty after method invocation.
      • writer

        <T> Cache.Writer<T> writer​(CacheEntryMetadata metadata)
        Creates a Writer.
        Type Parameters:
        T - The response body type.
        Parameters:
        metadata - The metadata.
        Returns:
        a Writer.