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