class StoreCopyClient {

    public void copyStore( StoreCopyRequester requester, CancellationRequest cancellationRequest, MoveAfterCopy moveAfterCopy ) throws Exception
    {
        // Create a temp directory (or clean if present)
        File tempDatabaseDirectory = databaseLayout.file( StoreUtil.TEMP_COPY_DIRECTORY_NAME );
        try
        {
            cleanDirectory( tempDatabaseDirectory );

            // Request store files and transactions that will need recovery
            monitor.startReceivingStoreFiles();
            ToFileStoreWriter storeWriter = new ToFileStoreWriter( tempDatabaseDirectory, fs, monitor );
            try ( Response<?> response = requester.copyStore( decorateWithProgressIndicator( storeWriter ) ) )
            {
                monitor.finishReceivingStoreFiles();
                // Update highest archived log id
                // Write transactions that happened during the copy to the currently active logical log
                writeTransactionsToActiveLogFile( DatabaseLayout.of( tempDatabaseDirectory ), response );
            }
            finally
            {
                requester.done();
            }

            // This is a good place to check if the switch has been cancelled
            checkCancellation( cancellationRequest, tempDatabaseDirectory );

            // Run recovery, so that the transactions we just wrote into the active log will be applied.
            recoverDatabase( tempDatabaseDirectory );

            // All is well, move the streamed files to the real store directory.
            // Should only be record store files.
            // Note that the stream is lazy, so the file system traversal won't happen until *after* the store files
            // have been moved. Thus we ensure that we only attempt to move them once.
            moveFromTemporaryLocationToCorrect( tempDatabaseDirectory, moveAfterCopy );
        }
        finally
        {
            // All done, delete temp directory
            FileUtils.deleteRecursively( tempDatabaseDirectory );
        }
    }

    public  StoreCopyClient( DatabaseLayout databaseLayout, Config config, Iterable<KernelExtensionFactory<?>> kernelExtensions, LogProvider logProvider,
            FileSystemAbstraction fs, PageCache pageCache, StoreCopyClientMonitor monitor, boolean forensics );
    public  StoreCopyClient( DatabaseLayout databaseLayout, Config config, Iterable<KernelExtensionFactory<?>> kernelExtensions, LogProvider logProvider,
            FileSystemAbstraction fs, PageCache pageCache, StoreCopyClientMonitor monitor, boolean forensics, FileMoveProvider fileMoveProvider );

}