Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
package org.apache.kafka.common;
public interface AuditExtension extends Configurable, Closeable {
    /**
     * AuditExtension implementations received an audit event via the {@link
     * #audit(AuditEvent<T extends AbstractRequest>#onEvent(AuditEvent)} method. The extension implementation will invoke this method for every audit event occurrence.
     *
     * @param event The audit event we want to describe{@link org.apache.kafka.common.AuditEvent<T extends AbstractRequest>AuditEvent}.
     */
    void audit<T extends AbstractRequest>(AuditEvent<T>onEvent(AuditEvent event);
}

As mentioned above, even though the developers are required to only implement the AuditExtension, they will be using new public interface implemented by default.

...

Code Block
languagejava
package org.apache.kafka.common.audit;
import java.util.UUID
public interface AuditEvent<T extends AbstractRequest>AuditEvent {
    /**
     * Get the unique event id.
     *
     * @return the guid, formatted as a Stringuuid
     */
    StringUUID guiduuid();
	
    /**
     * Get the request context.
     *
     * @return {@link org.apache.kafka.common.requests.RequestContext}
     */
    RequestContext requestContext();
	
    /**
     * Get the request.
     *
     * @return Detail request information.
     */
    T request();
}

This also introduces a new configuration that audit.extension.classes that allows to configure a comma separated list of Audit extension implementations.

...