Class InstrumentedSecurityActionListener

java.lang.Object
org.elasticsearch.xpack.security.metric.InstrumentedSecurityActionListener

public class InstrumentedSecurityActionListener extends Object
  • Constructor Details

    • InstrumentedSecurityActionListener

      public InstrumentedSecurityActionListener()
  • Method Details

    • wrapForAuthc

      public static <R, C> ActionListener<AuthenticationResult<R>> wrapForAuthc(SecurityMetrics<C> metrics, C context, ActionListener<AuthenticationResult<R>> listener)
      Wraps the provided listener and returns a new wrapped listener which handles authentication metrics collection.
      Type Parameters:
      R - The type of authentication result value.
      C - The type of context object which is used to attach additional attributes to collected authentication metrics.
      Parameters:
      metrics - The metrics to collect.
      context - The context object is used to collect and attach additional metric attributes.
      listener - The authentication result handling listener.
      Returns:
      a new "wrapped" listener which overrides onResponse and onFailure methods in order to collect authentication metrics.