// 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.Collections.Generic;
using System.Threading.Tasks;
namespace Duplicati.Library.Main.Operation.Common
{
///
/// An interface for the operations needed by the routine
///
internal interface IIndexVolumeCreatorDatabase
{
///
/// Creates and registers a remote volume
///
/// The newly created volume ID.
/// The name of the remote file.
/// The type of the remote file.
/// The state of the remote file.
Task RegisterRemoteVolumeAsync(string name, RemoteVolumeType type, RemoteVolumeState state);
///
/// Gets a list of all blocks associated with a given volume
///
/// The blocks found in the volume.
/// The ID of the volume to examine.
/// The callback method called for each result
Task GetBlocksAsync(long volumeid, Action callback);
///
/// Gets the blocklists contained in a remote volume
///
/// The blocklists.
/// The ID of the volume to get the blocklists for.
/// The blocksize setting.
/// The size of the hash in bytes.
/// The callback method called for each result
Task GetBlocklistsAsync(long volumeid, int blocksize, int hashsize, Action> callback);
///
/// Adds a link between a block volume and an index volume
///
/// An awaitable task.
/// The index volume ID.
/// The block volume ID.
Task AddIndexBlockLinkAsync(long indexVolumeID, long blockVolumeID);
///
/// 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);
}
}