001/*
002 * (C) Copyright 2013 Nuxeo SA (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-2.1.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 *     Antoine Taillefer <ataillefer@nuxeo.com>
016 */
017package org.nuxeo.drive.service;
018
019import java.io.Serializable;
020import java.util.List;
021
022/**
023 * Summary of file system changes, including:
024 * <ul>
025 * <li>A list of file system item changes</li>
026 * <li>A global status code</li>
027 * </ul>
028 * A document change is implemented by {@link FileSystemItemChange}.
029 *
030 * @author Antoine Taillefer
031 */
032public interface FileSystemChangeSummary extends Serializable {
033
034    List<FileSystemItemChange> getFileSystemChanges();
035
036    void setFileSystemChanges(List<FileSystemItemChange> changes);
037
038    /**
039     * @return the time code of current sync operation in milliseconds since 1970-01-01 UTC rounded to the second as
040     *         measured on the server clock. This value can be passed to the next call to
041     *         {@link NuxeoDriveManager#getChangeSummary(java.security.Principal, java.util.Map, long)} to get strictly
042     *         monotonic change summaries (without overlap). In this case, changes from the current summary instance all
043     *         happen "strictly" before this time code.
044     */
045    Long getSyncDate();
046
047    /**
048     * @return the upper bound of the range clause in the change query. Changes from the current summary instance all
049     *         happen "strictly before" this bound. This value is expected to be passed to the next call to
050     *         {@link NuxeoDriveManager#getChangeSummaryIntegerBounds(java.security.Principal, java.util.Map, long)} to
051     *         get strictly monotonic change summaries (without overlap).
052     */
053    Long getUpperBound();
054
055    String getActiveSynchronizationRootDefinitions();
056
057    void setActiveSynchronizationRootDefinitions(String activeSynchronizationRootDefinitions);
058
059    void setSyncDate(Long syncDate);
060
061    void setUpperBound(Long upperBound);
062
063    void setHasTooManyChanges(Boolean hasTooManyChanges);
064
065    Boolean getHasTooManyChanges();
066
067}