Package org.conscrypt

Class FileClientSessionCache


  • @Internal
    public final class FileClientSessionCache
    extends java.lang.Object
    File-based cache implementation. Only one process should access the underlying directory at a time.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  FileClientSessionCache.CacheFile
      A file containing a piece of cached data.
      (package private) static class  FileClientSessionCache.Impl
      This cache creates one file per SSL session using "host.port" for the file name.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.util.Map<java.io.File,​FileClientSessionCache.Impl> caches
      Maps directories to the cache instances that are backed by those directories.
      private static java.util.logging.Logger logger  
      static int MAX_SIZE  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void reset()
      For testing.
      static SSLClientSessionCache usingDirectory​(java.io.File directory)
      Returns a cache backed by the given directory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • caches

        static final java.util.Map<java.io.File,​FileClientSessionCache.Impl> caches
        Maps directories to the cache instances that are backed by those directories. We synchronize access using the cache instance, so it's important that everyone shares the same instance.
    • Constructor Detail

      • FileClientSessionCache

        private FileClientSessionCache()
    • Method Detail

      • usingDirectory

        public static SSLClientSessionCache usingDirectory​(java.io.File directory)
                                                    throws java.io.IOException
        Returns a cache backed by the given directory. Creates the directory (including parent directories) if necessary. This cache should have exclusive access to the given directory.
        Parameters:
        directory - to store files in
        Returns:
        a cache backed by the given directory
        Throws:
        java.io.IOException - if the file exists and is not a directory or if creating the directories fails
      • reset

        static void reset()
        For testing.