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