Class StateMachineSecurityInterceptor<S,E>

java.lang.Object
org.springframework.statemachine.support.StateMachineInterceptorAdapter<S,E>
org.springframework.statemachine.security.StateMachineSecurityInterceptor<S,E>
Type Parameters:
S - the type of state
E - the type of event
All Implemented Interfaces:
StateMachineInterceptor<S,E>

public class StateMachineSecurityInterceptor<S,E> extends StateMachineInterceptorAdapter<S,E>
StateMachineInterceptor which can be registered into a StateMachine order to intercept a various security related checks.
  • Constructor Details

    • StateMachineSecurityInterceptor

      public StateMachineSecurityInterceptor()
      Instantiates a new state machine security interceptor.
    • StateMachineSecurityInterceptor

      public StateMachineSecurityInterceptor(org.springframework.security.access.AccessDecisionManager transitionAccessDecisionManager, org.springframework.security.access.AccessDecisionManager eventAccessDecisionManager)
      Instantiates a new state machine security interceptor with a custom AccessDecisionManager for both transitions and events.
      Parameters:
      transitionAccessDecisionManager - the transition access decision manager
      eventAccessDecisionManager - the event access decision manager
    • StateMachineSecurityInterceptor

      public StateMachineSecurityInterceptor(org.springframework.security.access.AccessDecisionManager transitionAccessDecisionManager, org.springframework.security.access.AccessDecisionManager eventAccessDecisionManager, SecurityRule eventSecurityRule)
      Instantiates a new state machine security interceptor with a custom AccessDecisionManager for both transitions and events and a SecurityRule for events;
      Parameters:
      transitionAccessDecisionManager - the transition access decision manager
      eventAccessDecisionManager - the event access decision manager
      eventSecurityRule - the event security rule
  • Method Details

    • preEvent

      public org.springframework.messaging.Message<E> preEvent(org.springframework.messaging.Message<E> message, StateMachine<S,E> stateMachine)
      Description copied from interface: StateMachineInterceptor
      Called before message is sent to processing. Throwing exception or returning null will skip the message.
      Specified by:
      preEvent in interface StateMachineInterceptor<S,E>
      Overrides:
      preEvent in class StateMachineInterceptorAdapter<S,E>
      Parameters:
      message - the message
      stateMachine - the state machine
      Returns:
      the intercepted message
    • preTransition

      public StateContext<S,E> preTransition(StateContext<S,E> stateContext)
      Description copied from interface: StateMachineInterceptor
      Called prior of a start of a transition. Returning null from this method will break the transtion chain.
      Specified by:
      preTransition in interface StateMachineInterceptor<S,E>
      Overrides:
      preTransition in class StateMachineInterceptorAdapter<S,E>
      Parameters:
      stateContext - the state context
      Returns:
      the state context
    • setEventAccessDecisionManager

      public void setEventAccessDecisionManager(org.springframework.security.access.AccessDecisionManager eventAccessDecisionManager)
      Sets the event access decision manager.
      Parameters:
      eventAccessDecisionManager - the new event access decision manager
    • setTransitionAccessDecisionManager

      public void setTransitionAccessDecisionManager(org.springframework.security.access.AccessDecisionManager transitionAccessDecisionManager)
      Sets the transition access decision manager.
      Parameters:
      transitionAccessDecisionManager - the new transition access decision manager
    • setEventSecurityRule

      public void setEventSecurityRule(SecurityRule eventSecurityRule)
      Sets the event security rule.
      Parameters:
      eventSecurityRule - the new event security rule
    • toString

      public String toString()
      Overrides:
      toString in class Object