Class NoopLogoutService

java.lang.Object
com.svenruppert.jsentinel.logout.NoopLogoutService
All Implemented Interfaces:
LogoutService

public final class NoopLogoutService extends Object implements LogoutService
Default LogoutService — discards every call. Returned by JSentinelServiceResolver.logoutService() when no real implementation has been registered.

Production applications must register a concrete SubjectClearingLogoutService (or an adapter-specific subclass) during startup. The noop fallback exists so the resolver never throws — logout is optional infrastructure, like audit.

  • Field Details

  • Constructor Details

  • Method Details

    • logout

      public void logout(SubjectId subjectId, LogoutScope scope)
      Description copied from interface: LogoutService
      Performs the logout.
      Specified by:
      logout in interface LogoutService
      Parameters:
      subjectId - subject to log out; non-null
      scope - scope of the logout; non-null
    • addListener

      public void addListener(LogoutListener listener)
      Description copied from interface: LogoutService
      Registers a listener that gets notified once per logged-out session id. Idempotent — registering the same listener twice is a no-op.
      Specified by:
      addListener in interface LogoutService
      Parameters:
      listener - non-null
    • removeListener

      public void removeListener(LogoutListener listener)
      Description copied from interface: LogoutService
      Removes a previously registered listener. No-op when the listener was never registered.
      Specified by:
      removeListener in interface LogoutService
      Parameters:
      listener - listener to remove