/** * Preprocess the event, regardless of whether we actually want to send it or not. To check whether it should be * collected, use {@link #canCollect}. * * @param event event that is processed */ public ProcessedEvent preprocess(final RawEvent event, final boolean isOnDemand) { final Map<String, Object> whitelistedProperties = whitelistFilter.applyWhitelistToEvent(event.getName(), event.getProperties(), isOnDemand); return new ProcessedEvent.Builder(event) .server(anonymizeServer(event, isOnDemand)) .user(anonymizeUser(event, isOnDemand)) .sourceIP(anonymizeSourceIP(event, isOnDemand)) .atlPath(anonymizeAtlPath(event, isOnDemand)) .properties(whitelistedProperties) .build(); }