001/* 002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Nuxeo - initial API and implementation 011 * 012 * $Id$ 013 */ 014 015package org.nuxeo.ecm.platform.audit.api; 016 017import java.io.Serializable; 018import java.util.List; 019import java.util.Set; 020 021import org.nuxeo.ecm.core.event.Event; 022import org.nuxeo.ecm.core.event.EventBundle; 023 024/** 025 * Interface for adding audit logs. 026 * 027 * @author tiry 028 */ 029public interface AuditLogger { 030 031 /** 032 * Returns the list of auditable event names. 033 * 034 * @return list of String representing event names. 035 */ 036 Set<String> getAuditableEventNames(); 037 038 /** 039 * Create a new LogEntry instance. 040 * 041 * @return 042 */ 043 LogEntry newLogEntry(); 044 045 /** 046 * Create a new ExtendedInfo instance 047 * 048 * @return 049 */ 050 ExtendedInfo newExtendedInfo(Serializable value); 051 052 /** 053 * Adds given log entries. 054 * 055 * @param entries the list of log entries. 056 */ 057 void addLogEntries(List<LogEntry> entries); 058 059 /** 060 * Logs an Event. 061 */ 062 void logEvent(Event event); 063 064 /** 065 * Logs a bundle of events 066 */ 067 void logEvents(EventBundle eventBundle); 068 069}