protected void triggerAuditEvent( String repositoryId, String resource, String action,
AuditInformation auditInformation )
{
User user = auditInformation == null ? null : auditInformation.getUser();
AuditEvent event =
new AuditEvent( repositoryId, user == null ? "null" : (String) user.getPrincipal(), resource, action );
event.setRemoteIP( auditInformation == null ? "null" : auditInformation.getRemoteAddr() );
for ( AuditListener listener : getAuditListeners() )
{
listener.auditEvent( event );
}