pl.allegro.tech.hermes.management.infrastructure.audit.CompositeAuditor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-management Show documentation
Show all versions of hermes-management Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.management.infrastructure.audit;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collection;
import pl.allegro.tech.hermes.api.PatchData;
import pl.allegro.tech.hermes.management.domain.Auditor;
public class CompositeAuditor implements Auditor {
private final Collection auditors;
public CompositeAuditor(Collection auditors) {
this.auditors = checkNotNull(auditors);
}
@Override
public void beforeObjectCreation(String username, Object createdObject) {
auditors.forEach(auditor -> auditor.beforeObjectCreation(username, createdObject));
}
@Override
public void beforeObjectRemoval(
String username, String removedObjectType, String removedObjectName) {
auditors.forEach(
auditor -> auditor.beforeObjectRemoval(username, removedObjectType, removedObjectName));
}
@Override
public void beforeObjectUpdate(
String username, String objectClassName, Object objectName, PatchData patchData) {
auditors.forEach(
auditor -> auditor.beforeObjectUpdate(username, objectClassName, objectName, patchData));
}
@Override
public void objectCreated(String username, Object createdObject) {
auditors.forEach(auditor -> auditor.objectCreated(username, createdObject));
}
@Override
public void objectRemoved(String username, Object removedObject) {
auditors.forEach(auditor -> auditor.objectRemoved(username, removedObject));
}
@Override
public void objectUpdated(String username, Object oldObject, Object newObject) {
auditors.forEach(auditor -> auditor.objectUpdated(username, oldObject, newObject));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy