001/*
002 * (C) Copyright 2006-2008 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 *     Stephane Lacoin (Nuxeo EP Software Engineer)
018 */
019
020package org.nuxeo.ecm.platform.audit.service;
021
022import java.util.List;
023import java.util.Map;
024
025import org.nuxeo.ecm.platform.audit.api.FilterMapEntry;
026import org.nuxeo.ecm.platform.audit.api.LogEntry;
027
028/**
029 * Minimal interface extracted to be able to share some code inside the {@link AbstractAuditBackend}
030 * 
031 * @author tiry
032 */
033public interface BaseLogEntryProvider {
034
035    public abstract void addLogEntry(LogEntry entry);
036
037    /**
038     * Returns the logs given a doc uuid and a repository id.
039     *
040     * @param uuid the document uuid
041     * @param repositoryId the repository id
042     * @return a list of log entries
043     * @since 8.4
044     */
045    public abstract List<LogEntry> getLogEntriesFor(String uuid, String repositoryId);
046
047    /**
048     * Returns the logs given a doc uuid.
049     *
050     * @param uuid the document uuid
051     * @return a list of log entries
052     * @deprecated since 8.4, use
053     *             {@link (org.nuxeo.ecm.platform.audit.service.BaseLogEntryProvider.getLogEntriesFor(String, String))}
054     *             instead.
055     */
056    @Deprecated
057    public abstract List<LogEntry> getLogEntriesFor(String uuid);
058
059    /**
060     * Returns the logs given a doc uuid, a map of filters and a default sort.
061     *
062     * @param uuid the document uuid
063     * @param filterMap the map of filters to apply
064     * @param doDefaultSort the default sort to set
065     * @return a list of log entries
066     * @deprecated
067     */
068    @Deprecated
069    public abstract List<LogEntry> getLogEntriesFor(String uuid, Map<String, FilterMapEntry> filterMap,
070            boolean doDefaultSort);
071
072    public abstract int removeEntries(String eventId, String pathPattern);
073
074}