From 2019b57dcbba43e8b3feba9385aec4a25bfa55b2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 21 Aug 2008 10:41:18 +0000 Subject: Pass a RunStatusProvider and a ReadLoggingStream::Logger from BackupDaemon through BackupClientDirectoryRecord, BackupStoreFile and BackupStoreFileEncodeStream to ReadLoggingStream, to allow progress callbacks during file upload and cancelling upload part-way. Implement ReadLoggingStream::Logger in BackupClientDirectoryRecord::SyncParams, which thunks the notifications back to the ProgressNotifier. Add the SysadminNotifier interface from Boxi. Add NotifyIDMapsSetup() to ProgressNotifier. Change BackupClientDirectoryRecord::SyncParams to store references to the individual callback interfaces rather than BackupDaemon. Initialise all members in BackupDaemon. Add ability for BackupDaemon user to override the ProgressNotifier, LocationResolver, SysadminNotifier and RunStatusProvider that will be used during the backup. Make BackupDaemon::Location class public and provide access to the configured locations for Boxi (dangerous, they could be modified without BackupDaemon knowing it). --- lib/backupclient/BackupStoreFileEncodeStream.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/backupclient/BackupStoreFileEncodeStream.h') diff --git a/lib/backupclient/BackupStoreFileEncodeStream.h b/lib/backupclient/BackupStoreFileEncodeStream.h index fb5d0851..c5fa780a 100644 --- a/lib/backupclient/BackupStoreFileEncodeStream.h +++ b/lib/backupclient/BackupStoreFileEncodeStream.h @@ -18,6 +18,7 @@ #include "MD5Digest.h" #include "BackupStoreFile.h" #include "ReadLoggingStream.h" +#include "RunStatusProvider.h" namespace BackupStoreFileCreation { @@ -74,7 +75,11 @@ public: int64_t mOtherFileID; }; - void Setup(const char *Filename, Recipe *pRecipe, int64_t ContainerID, const BackupStoreFilename &rStoreFilename, int64_t *pModificationTime); + void Setup(const char *Filename, Recipe *pRecipe, int64_t ContainerID, + const BackupStoreFilename &rStoreFilename, + int64_t *pModificationTime, + ReadLoggingStream::Logger* pLogger = NULL, + RunStatusProvider* pRunStatusProvider = NULL); virtual int Read(void *pBuffer, int NBytes, int Timeout); virtual void Write(const void *pBuffer, int NBytes); @@ -101,7 +106,8 @@ private: Recipe *mpRecipe; IOStream *mpFile; // source file CollectInBufferStream mData; // buffer for header and index entries - ReadLoggingStream *mpLogging; + IOStream *mpLogging; + RunStatusProvider* mpRunStatusProvider; int mStatus; bool mSendData; // true if there's file data to send (ie not a symlink) int64_t mTotalBlocks; // Total number of blocks in the file -- cgit v1.2.3