Interface LogoutService

All Known Implementing Classes:
NoopLogoutService, SubjectClearingLogoutService

public interface LogoutService
Bundles the logout flow so callers do not have to manually orchestrate subject removal, session invalidation and navigation.

The logout(SubjectId, LogoutScope) call has two pieces:

Adapters that care about session invalidation register a LogoutListener via addListener(LogoutListener). The Vaadin adapter listens to invalidate the VaadinSession and close the underlying servlet session; the REST adapter listens to revoke the bearer token.

The core implementation (SubjectClearingLogoutService) clears the subject from the SubjectStore, consults the registry, and fans out the notification to every registered listener. It does not know about Vaadin sessions, HTTP sessions, or any specific transport.

  • Method Details

    • logout

      void logout(SubjectId subjectId, LogoutScope scope)
      Performs the logout.
      Parameters:
      subjectId - subject to log out; non-null
      scope - scope of the logout; non-null
    • addListener

      void addListener(LogoutListener listener)
      Registers a listener that gets notified once per logged-out session id. Idempotent — registering the same listener twice is a no-op.
      Parameters:
      listener - non-null
    • removeListener

      void removeListener(LogoutListener listener)
      Removes a previously registered listener. No-op when the listener was never registered.
      Parameters:
      listener - listener to remove