Package org.conscrypt
Class FileClientSessionCache
- java.lang.Object
-
- org.conscrypt.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
-
Constructor Summary
Constructors Modifier Constructor Description private
FileClientSessionCache()
-
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.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
MAX_SIZE
public static final int MAX_SIZE
- See Also:
- Constant Field Values
-
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.
-
-
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.
-
-