Class MessageAuthorizationHandlerInterceptor<M extends Message>
java.lang.Object
org.axonframework.extension.spring.authorization.MessageAuthorizationHandlerInterceptor<M>
- Type Parameters:
T- The message type this interceptor can process
- All Implemented Interfaces:
MessageHandlerInterceptor<M>
public class MessageAuthorizationHandlerInterceptor<M extends Message>
extends Object
implements MessageHandlerInterceptor<M>
A
MessageHandlerInterceptor that verifies authorization based on Secured annotations on the payload
of Messages.- Since:
- 4.11.0
- Author:
- Roald Bankras
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninterceptOnHandle(M message, ProcessingContext context, MessageHandlerInterceptorChain<M> interceptorChain) Intercepts a givenmessageon handling before reaching the designatedMessageHandler.
-
Field Details
-
METADATA_AUTHORITIES_KEY
Metadata key for authorities.- See Also:
-
-
Constructor Details
-
MessageAuthorizationHandlerInterceptor
public MessageAuthorizationHandlerInterceptor()
-
-
Method Details
-
interceptOnHandle
@Nonnull public MessageStream<?> interceptOnHandle(@Nonnull M message, @Nonnull ProcessingContext context, @Nonnull MessageHandlerInterceptorChain<M> interceptorChain) Description copied from interface:MessageHandlerInterceptorIntercepts a givenmessageon handling before reaching the designatedMessageHandler. The interceptor is responsible for the continuation of the handling process by invoking theMessageHandlerInterceptorChain.proceed(Message, ProcessingContext)method on the giveninterceptorChain. The givencontextcontains contextual information. Any information gathered by interceptors may be attached to the context. Interceptors are not allowed to change the type of the message handling result, as the dispatching component expects a result of a specific type.- Specified by:
interceptOnHandlein interfaceMessageHandlerInterceptor<M extends Message>- Parameters:
message- The message to intercept on handling.context- The active processing context of themessagebeing processed.interceptorChain- The interceptor chain that allows this interceptor to proceed the dispatch process.- Returns:
- The resulting message stream from
MessageHandlerInterceptorChain.proceed(Message, ProcessingContext).
-