// Copyright (C) 2018, The Duplicati Team // http://www.duplicati.com, info@duplicati.com // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA using System; using System.Threading.Tasks; namespace Duplicati.Library.Main.Operation.Common { /// /// Interface for just the operations needed by the backendhandler /// internal interface IBackendHandlerDatabase { /// /// Updates the remote volume information. /// /// An awaitable task. /// The name of the remote volume to update. /// The new volume state. /// The new volume size. /// The new volume hash. /// If set to true suppress cleanup operation. /// The new delete grace time. Task UpdateRemoteVolumeAsync(string name, RemoteVolumeState state, long size, string hash, bool suppressCleanup = false, TimeSpan deleteGraceTime = default(TimeSpan)); /// /// Renames a remote file in the database /// /// An awaitable task. /// The old filename. /// The new filename. Task RenameRemoteFileAsync(string oldname, string newname); /// /// Writes remote operation log data to the database /// /// An awaitable task. /// The operation performed. /// The remote path used. /// Any data reported by the operation. Task LogRemoteOperationAsync(string operation, string path, string data); /// /// Writes the current changes to the database /// /// An awaitable task. /// The message to use for logging the time spent in this operation. /// If set to true, a transaction will be started again after this call. Task CommitTransactionAsync(string message, bool restart = true); /// /// Gets the volume information for a remote file, given the name. /// /// The remote volume information. /// The name of the remote file to query. Task GetVolumeInfoAsync(string remotename); } }