001/* 002 * (C) Copyright 2006-2007 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 * anguenot 018 * 019 * $Id: WSAudit.java 28230 2007-12-18 15:21:51Z rdarlea $ 020 */ 021 022package org.nuxeo.ecm.platform.audit.ws.api; 023 024import javax.jws.WebParam; 025 026import org.nuxeo.ecm.platform.api.ws.BaseNuxeoWebService; 027import org.nuxeo.ecm.platform.audit.ws.EventDescriptorPage; 028import org.nuxeo.ecm.platform.audit.ws.ModifiedDocumentDescriptor; 029import org.nuxeo.ecm.platform.audit.ws.ModifiedDocumentDescriptorPage; 030 031/** 032 * Audit Web service interface. 033 * 034 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a> 035 * @author <a href="mailto:td@nuxeo.com">Thierry Delprat</a> 036 */ 037public interface WSAudit extends BaseNuxeoWebService { 038 039 /** 040 * Returns the list of modified document within a timestamp. 041 * 042 * @param sessionId the Nuxeo core session id. 043 * @param dateRangeQuery the date range query. 044 * @return a list of modified document descriptors. 045 * @throws AuditException 046 */ 047 ModifiedDocumentDescriptor[] listModifiedDocuments(String sessionId, String dateRangeQuery); 048 049 ModifiedDocumentDescriptorPage listModifiedDocumentsByPage(String sessionId, String dateRangeQuery, String path, 050 int page, int pageSize); 051 052 /** 053 * Returns the list of deleted documents within a timestamp. 054 */ 055 ModifiedDocumentDescriptorPage listDeletedDocumentsByPage(@WebParam(name = "sessionId") String sessionId, 056 @WebParam(name = "dataRangeQuery") String dateRangeQuery, @WebParam(name = "docPath") String path, 057 @WebParam(name = "pageIndex") int page, @WebParam(name = "pageSize") int pageSize); 058 059 EventDescriptorPage listEventsByPage(String sessionId, String dateRangeQuery, int page, int pageSize); 060 061 /** 062 * Gets a filtered list of document events. 063 * <p> 064 * Expecting either a dateRangeQuery or a startDate. 065 * 066 * @param sessionId the Nuxeo core session id. 067 * @param dateRangeQuery the date range query like "24h" for the last 24 hours, may be <code>null</code> if 068 * startDate is set. 069 * @param startDate return events that occurs after startDate, expecting W3C date time format. May be 070 * <code>null</code> if dateRangeQuery is set. Will be ignored if dateRangeQuery is set. 071 * @param path filter events for documents starting with this path. 072 * @param page page number starting with page 1. 073 * @param pageSize number of items in a page. 074 * @return a list of events descriptors.. 075 * @throws AuditException 076 */ 077 EventDescriptorPage listDocumentEventsByPage(String sessionId, String dateRangeQuery, String startDate, 078 String path, int page, int pageSize); 079 080 EventDescriptorPage queryEventsByPage(String sessionId, String whereClause, int page, int pageSize); 081 082}