Package com.glideapi.session
Interface SessionStrategy
- All Known Implementing Classes:
CachedStrategy,PerRequestStrategy,ThreadLocalStrategy
public interface SessionStrategy
Strategy interface for managing OAuth sessions.
Different implementations provide different performance and concurrency characteristics.
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear any cached sessions.Get a valid session, creating a new one if necessary.getSession(String scope) Get a valid session with specific scopes, creating a new one if necessary.Get a valid session asynchronously.
-
Method Details
-
getSession
Get a valid session, creating a new one if necessary.- Returns:
- A valid session
- Throws:
Exception- if session creation fails
-
getSession
Get a valid session with specific scopes, creating a new one if necessary.- Parameters:
scope- Space-separated list of scopes to request- Returns:
- A valid session
- Throws:
Exception- if session creation fails
-
getSessionAsync
CompletableFuture<Types.Session> getSessionAsync()Get a valid session asynchronously.- Returns:
- CompletableFuture that will complete with a valid session
-
clearCache
void clearCache()Clear any cached sessions. Useful for forcing a fresh session on the next request.
-