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 Details

    • getSession

      Types.Session getSession() throws Exception
      Get a valid session, creating a new one if necessary.
      Returns:
      A valid session
      Throws:
      Exception - if session creation fails
    • getSession

      Types.Session getSession(String scope) throws Exception
      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.