001/*
002 * (C) Copyright 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id$
020 */
021
022package org.nuxeo.ecm.platform.audit.api;
023
024import java.io.Serializable;
025import java.util.List;
026import java.util.Set;
027
028import org.nuxeo.ecm.core.event.Event;
029import org.nuxeo.ecm.core.event.EventBundle;
030
031/**
032 * Interface for adding audit logs.
033 *
034 * @author tiry
035 */
036public interface AuditLogger {
037
038    /**
039     * Returns the list of auditable event names.
040     *
041     * @return list of String representing event names.
042     */
043    Set<String> getAuditableEventNames();
044
045    /**
046     * Create a new LogEntry instance.
047     *
048     * @return
049     */
050    LogEntry newLogEntry();
051
052    /**
053     * Create a new ExtendedInfo instance
054     *
055     * @return
056     */
057    ExtendedInfo newExtendedInfo(Serializable value);
058
059    /**
060     * Adds given log entries.
061     *
062     * @param entries the list of log entries.
063     */
064    void addLogEntries(List<LogEntry> entries);
065
066    /**
067     * Logs an Event.
068     */
069    void logEvent(Event event);
070
071    /**
072     * Logs a bundle of events
073     */
074    void logEvents(EventBundle eventBundle);
075
076}