Class RevokeSession

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action

public class RevokeSession extends AbstractRevocationAction
A profile action to optionally record the revocation of a session in a revocation cache and signal back an administrative logout result to the Agent.
Event:
EventIds.PROCEED_EVENT_ID, EventIds.INVALID_PROFILE_CTX
Precondition:
AgentRequestContext.getOutput().isstruct()
Postcondition:
optionally a revocation record is stored
  • Field Details

  • Constructor Details

    • RevokeSession

      public RevokeSession()
      Constructor.
  • Method Details

    • setEventContextLookupStrategy

      public void setEventContextLookupStrategy(@Nonnull Function<ProfileRequestContext,EventContext> strategy)
      Set lookup strategy for EventContext to base resulting status on.
      Parameters:
      strategy - lookup strategy
    • setMaxStorageTimeout

      public void setMaxStorageTimeout(@Nonnull @Positive Duration timeout)
      Sets the maximum storage life for revocation records that an Agent may request.

      Defaults to 1 day.

      Parameters:
      timeout - maximum storage lifetime
    • doPreExecute

      protected boolean doPreExecute(ProfileRequestContext profileRequestContext)
      Overrides:
      doPreExecute in class AbstractRevocationAction
    • doExecute

      protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)
      Overrides:
      doExecute in class AbstractProfileAction
    • doRevocation

      private boolean doRevocation(@Nonnull ProfileRequestContext profileRequestContext)
      Store a revocation record if configured to do so.
      Parameters:
      profileRequestContext - profile request context
      Returns:
      true iff revocation succeeded or was not configured
    • getStorageLifetime

      @Nonnull private Long getStorageLifetime()
      Get Agent-supplied storage lifetime in seconds, bounded by configured maximum.
      Returns:
      effective lifetime in seconds