ConfigAuditEventLogger.java revision a97a4ced3330c02d8e2413956a450889bf77d6f0
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
*/
/**
* Utilizing the ConfigAuditEventBuilder this class will send log events of config changes to the commons
* audit module.
*
* @see ConfigAuditEventBuilder
*/
public class ConfigAuditEventLogger {
/**
* Calls buildAuditEvent() and invokes the request to the audit path.
*
* @param connectionFactory factory used to make crest call to audit service.
*/
public final Promise<ResourceResponse, ResourceException> log(ConfigAuditState configAuditState, Request request,
try {
// Get authenticationId from security context, if it exists.
// Build the event utilizing the config builder.
.toEvent();
} catch (ResourceException e) {
return e.asPromise();
} catch (Exception e) {
}
}
return new String[0];
}
// Default to empty json when they are null.
}
}
// Now find the changed fields.
// Config objects require id only for repo storage and not on the filesystem.
// As far as reporting changes to a config, it is not relevant to be reported as changes.
}
}
}
}