001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     anguenot
016 *
017 * $Id: WSAudit.java 28230 2007-12-18 15:21:51Z rdarlea $
018 */
019
020package org.nuxeo.ecm.platform.audit.ws.api;
021
022import javax.jws.WebParam;
023
024import org.nuxeo.ecm.platform.api.ws.BaseNuxeoWebService;
025import org.nuxeo.ecm.platform.audit.ws.EventDescriptorPage;
026import org.nuxeo.ecm.platform.audit.ws.ModifiedDocumentDescriptor;
027import org.nuxeo.ecm.platform.audit.ws.ModifiedDocumentDescriptorPage;
028
029/**
030 * Audit Web service interface.
031 *
032 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a>
033 * @author <a href="mailto:td@nuxeo.com">Thierry Delprat</a>
034 */
035public interface WSAudit extends BaseNuxeoWebService {
036
037    /**
038     * Returns the list of modified document within a timestamp.
039     *
040     * @param sessionId the Nuxeo core session id.
041     * @param dateRangeQuery the date range query.
042     * @return a list of modified document descriptors.
043     * @throws AuditException
044     */
045    ModifiedDocumentDescriptor[] listModifiedDocuments(String sessionId, String dateRangeQuery);
046
047    ModifiedDocumentDescriptorPage listModifiedDocumentsByPage(String sessionId, String dateRangeQuery, String path,
048            int page, int pageSize);
049
050    /**
051     * Returns the list of deleted documents within a timestamp.
052     */
053    ModifiedDocumentDescriptorPage listDeletedDocumentsByPage(@WebParam(name = "sessionId") String sessionId,
054            @WebParam(name = "dataRangeQuery") String dateRangeQuery, @WebParam(name = "docPath") String path,
055            @WebParam(name = "pageIndex") int page, @WebParam(name = "pageSize") int pageSize);
056
057    EventDescriptorPage listEventsByPage(String sessionId, String dateRangeQuery, int page, int pageSize);
058
059    /**
060     * Gets a filtered list of document events.
061     * <p>
062     * Expecting either a dateRangeQuery or a startDate.
063     *
064     * @param sessionId the Nuxeo core session id.
065     * @param dateRangeQuery the date range query like "24h" for the last 24 hours, may be <code>null</code> if
066     *            startDate is set.
067     * @param startDate return events that occurs after startDate, expecting W3C date time format. May be
068     *            <code>null</code> if dateRangeQuery is set. Will be ignored if dateRangeQuery is set.
069     * @param path filter events for documents starting with this path.
070     * @param page page number starting with page 1.
071     * @param pageSize number of items in a page.
072     * @return a list of events descriptors..
073     * @throws AuditException
074     */
075    EventDescriptorPage listDocumentEventsByPage(String sessionId, String dateRangeQuery, String startDate,
076            String path, int page, int pageSize);
077
078    EventDescriptorPage queryEventsByPage(String sessionId, String whereClause, int page, int pageSize);
079
080}