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.-
Constructor Summary
ConstructorDescriptionInstantiates 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 customAccessDecisionManager
for 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 customAccessDecisionManager
for both transitions and events and aSecurityRule
for 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.void
setEventAccessDecisionManager
(org.springframework.security.access.AccessDecisionManager eventAccessDecisionManager) Sets the event access decision manager.void
setEventSecurityRule
(SecurityRule eventSecurityRule) Sets the event security rule.void
setTransitionAccessDecisionManager
(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 customAccessDecisionManager
for 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 customAccessDecisionManager
for both transitions and events and aSecurityRule
for 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:StateMachineInterceptor
Called before message is sent to processing. Throwing exception or returning null will skip the message.- Specified by:
preEvent
in interfaceStateMachineInterceptor<S,
E> - Overrides:
preEvent
in classStateMachineInterceptorAdapter<S,
E> - Parameters:
message
- the messagestateMachine
- the state machine- Returns:
- the intercepted message
-
preTransition
Description copied from interface:StateMachineInterceptor
Called prior of a start of a transition. Returningnull
from this method will break the transtion chain.- Specified by:
preTransition
in interfaceStateMachineInterceptor<S,
E> - Overrides:
preTransition
in 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
-