Class AuthenticatingInterceptor

java.lang.Object
io.fluxcapacitor.javaclient.tracking.handling.authentication.AuthenticatingInterceptor
All Implemented Interfaces:
DispatchInterceptor, HandlerDecorator, HandlerInterceptor

public class AuthenticatingInterceptor extends Object implements DispatchInterceptor, HandlerInterceptor
  • Constructor Details

    • AuthenticatingInterceptor

      public AuthenticatingInterceptor()
  • Method Details

    • interceptDispatch

      public Message interceptDispatch(Message m, MessageType messageType, String topic)
      Description copied from interface: DispatchInterceptor
      Intercepts the dispatch of a message before it is serialized and published or locally handled.

      You may modify the message or return null to block dispatching. Throwing an exception also prevents dispatching.

      Specified by:
      interceptDispatch in interface DispatchInterceptor
      Parameters:
      m - the message to be dispatched
      messageType - the type of the message (e.g., COMMAND, EVENT, etc.)
      topic - the target topic or null if not applicable
      Returns:
      the modified message, the same message, or null to prevent dispatch
    • interceptHandling

      public Function<DeserializingMessage,Object> interceptHandling(Function<DeserializingMessage,Object> function, HandlerInvoker invoker)
      Description copied from interface: HandlerInterceptor
      Intercepts the message handling logic.

      The function parameter represents the next step in the handling chain— typically the actual message handler. The invoker provides metadata and invocation logic for the underlying handler method.

      Within this method, an interceptor may:

      • Modify the DeserializingMessage before passing it to the handler
      • Bypass the handler entirely and return a value directly
      • Wrap the result after the handler is invoked

      Note: Interceptors may return a different DeserializingMessage, but it must be compatible with a handler method in the same target class. If no suitable handler is found, an exception will be thrown.

      Specified by:
      interceptHandling in interface HandlerInterceptor
      Parameters:
      function - the next step in the handler chain (typically the handler itself)
      invoker - the metadata and execution strategy for the actual handler method
      Returns:
      a decorated function that wraps handling behavior
    • wrap

      Description copied from interface: HandlerInterceptor
      Wraps a Handler with this interceptor, producing an intercepted handler.
      Specified by:
      wrap in interface HandlerDecorator
      Specified by:
      wrap in interface HandlerInterceptor
      Parameters:
      handler - the original handler to wrap
      Returns:
      an intercepted handler that applies this interceptor to all handled messages