Package org.apache.iceberg.rest.auth
Class AuthSessionCache
java.lang.Object
org.apache.iceberg.rest.auth.AuthSessionCache
- All Implemented Interfaces:
- AutoCloseable
A cache for 
AuthSession instances.- 
Constructor SummaryConstructorsConstructorDescriptionAuthSessionCache(String name, Duration sessionTimeout) Creates a new cache with the given session timeout, and with default executor and default ticker for eviction tasks.
- 
Method SummaryModifier and TypeMethodDescription<T extends AuthSession>
 TcachedSession(String key, Function<String, T> loader) Returns a cached session for the given key, loading it with the given loader if it is not already cached.voidclose()
- 
Constructor Details- 
AuthSessionCacheCreates a new cache with the given session timeout, and with default executor and default ticker for eviction tasks.- Parameters:
- name- a distinctive name for the cache.
- sessionTimeout- the session timeout. Sessions will become eligible for eviction after this duration of inactivity.
 
 
- 
- 
Method Details- 
cachedSessionReturns a cached session for the given key, loading it with the given loader if it is not already cached.- Type Parameters:
- T- the type of the session.
- Parameters:
- key- the key to use for the session.
- loader- the loader to use to load the session if it is not already cached.
- Returns:
- the cached session.
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
 
-