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 stateE- the type of event
- All Implemented Interfaces:
StateMachineInterceptor<S,E>
StateMachineInterceptor which can be registered into a StateMachine
order to intercept a various security related checks.- Author:
- Janne Valkealahti
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new state machine security interceptor.StateMachineSecurityInterceptor(org.springframework.security.access.AccessDecisionManager transitionAccessDecisionManager, org.springframework.security.access.AccessDecisionManager eventAccessDecisionManager) Instantiates a new state machine security interceptor with a customAccessDecisionManagerfor both transitions and events.StateMachineSecurityInterceptor(org.springframework.security.access.AccessDecisionManager transitionAccessDecisionManager, org.springframework.security.access.AccessDecisionManager eventAccessDecisionManager, SecurityRule eventSecurityRule) Instantiates a new state machine security interceptor with a customAccessDecisionManagerfor both transitions and events and aSecurityRulefor events; -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.messaging.Message<E>preEvent(org.springframework.messaging.Message<E> message, StateMachine<S, E> stateMachine) Called before message is sent to processing.preTransition(StateContext<S, E> stateContext) Called prior of a start of a transition.voidsetEventAccessDecisionManager(org.springframework.security.access.AccessDecisionManager eventAccessDecisionManager) Sets the event access decision manager.voidsetEventSecurityRule(SecurityRule eventSecurityRule) Sets the event security rule.voidsetTransitionAccessDecisionManager(org.springframework.security.access.AccessDecisionManager transitionAccessDecisionManager) Sets the transition access decision manager.toString()Methods inherited from class org.springframework.statemachine.support.StateMachineInterceptorAdapter
postStateChange, postTransition, preStateChange, stateMachineError
-
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 customAccessDecisionManagerfor both transitions and events.- Parameters:
transitionAccessDecisionManager- the transition access decision managereventAccessDecisionManager- 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 customAccessDecisionManagerfor both transitions and events and aSecurityRulefor events;- Parameters:
transitionAccessDecisionManager- the transition access decision managereventAccessDecisionManager- the event access decision managereventSecurityRule- 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:StateMachineInterceptorCalled before message is sent to processing. Throwing exception or returning null will skip the message.- Specified by:
preEventin interfaceStateMachineInterceptor<S,E> - Overrides:
preEventin classStateMachineInterceptorAdapter<S,E> - Parameters:
message- the messagestateMachine- the state machine- Returns:
- the intercepted message
-
preTransition
Description copied from interface:StateMachineInterceptorCalled prior of a start of a transition. Returningnullfrom this method will break the transtion chain.- Specified by:
preTransitionin interfaceStateMachineInterceptor<S,E> - Overrides:
preTransitionin classStateMachineInterceptorAdapter<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
Sets the event security rule.- Parameters:
eventSecurityRule- the new event security rule
-
toString
-