<PackageReference Include="Relativity.Server.Import.SDK" Version="2.9.2" />

kCura.WinEDDS.ImportTapiBase

public abstract class ImportTapiBase
Represents the base-class object for all TAPI-based import and export instances.
namespace kCura.WinEDDS { public abstract class ImportTapiBase { public delegate void UploadModeChangeEventEventHandler (string statusBarText); internal delegate void BatchCompletedEventHandler (BatchInformation batchInformation); protected readonly ILog _logger; protected Func<string> CorrelationIdFunc; public ImportStatistics Statistics { get; } protected abstract int CurrentLineNumber { get; } protected UploadTapiBridge2 BulkLoadTapiBridge { get; } protected TapiClient BulkLoadTapiClient { get; } protected string BulkLoadTapiClientName { get; } protected CancellationToken CancellationToken { get; } protected IDictionary CurrentStatisticsSnapshot { get; set; } protected int JobCounter { get; set; } protected ILog Logger { get; } protected UploadTapiBridge2 FileTapiBridge { get; } protected TapiClient FileTapiClient { get; } protected string FileTapiClientName { get; } public string TapiClientName { get; } public TapiClient TapiClient { get; } public bool DisableNativeLocationValidation { get; set; } public int FileTapiProgressCount { get; set; } public int TotalTransferredFilesCount { get; set; } protected bool ShouldImport { get; set; } protected int ImportFilesCount { get; set; } protected int MetadataFilesCount { get; set; } protected RetryOptions RetryOptions { get; } protected IFileSystem FileSystem { get; } public event UploadModeChangeEventEventHandler UploadModeChangeEvent; public ImportTapiBase(IIoReporter reporter, ILog logger, CancellationTokenSource cancellationTokenSource, Func<string> correlationIdFunc); protected virtual void OnBatchCompleted(BatchInformation batchInformation); protected static bool IsTimeoutException(Exception ex); protected static bool IsBulkImportSqlException(Exception ex); protected static bool IsInsufficientPermissionsForImportException(Exception ex); protected void CopyFile(string sourceFileName, string destFileName); protected IWaitAndRetryPolicy CreateWaitAndRetryPolicy(); protected void CopyFile(string sourceFileName, string destFileName, bool overwrite); protected string GetExistingFilePath(string path, bool retry); protected bool GetFileExists(string path); protected long GetFileLength(string path, bool retry); protected void PublishIoRetryMessage(Exception exception, TimeSpan timeSpan, int retryCount, int totalRetryCount); protected void PublishIoWarningEvent(IoWarningEventArgs args); protected void CreateTapiBridges(UploadTapiBridgeParameters2 fileParameters, UploadTapiBridgeParameters2 bulkLoadParameters, IAuthenticationTokenProvider authTokenProvider, IRelativityManagerServiceFactory managerServiceFactory); protected void DestroyTapiBridges(); protected void LogStatistics(); protected void LogInformation(Exception exception, string messageTemplate, params object[] propertyValues); protected void LogInformation(string messageTemplate, params object[] propertyValues); protected void LogError(Exception exception, string messageTemplate, params object[] propertyValues); protected void LogError(string messageTemplate, params object[] propertyValues); protected void LogFatal(Exception exception, string messageTemplate, params object[] propertyValues); protected void LogFatal(string messageTemplate, params object[] propertyValues); protected void LogWarning(Exception exception, string messageTemplate, params object[] propertyValues); protected void LogWarning(string messageTemplate, params object[] propertyValues); protected virtual void OnStopImport(); protected virtual void OnTapiClientChanged(); protected virtual void OnWriteStatusMessage(EventType2 eventType, string message); protected virtual void OnWriteStatusMessage(EventType2 eventType, string message, int progressLineNumber, int physicalLineNumber); protected virtual void OnWriteFatalError(Exception exception); protected void StopImport(bool userCancelRequest = false); protected void UpdateStatisticsSnapshot(DateTime time, bool force = false); protected string GetLineMessage(string line, int lineNumber); protected virtual void RaiseWarningAndPause(Exception exception, int timeoutSeconds); protected virtual void RaiseWarningAndPause(Exception exception, int timeoutSeconds, int retryCount, int totalRetryCount); protected void PublishUploadModeChangeEvent(bool nativeFilesCopied); protected void AwaitPendingBulkLoadFileUploadsForBatch(); protected void AwaitPendingBulkLoadFileUploadsForJob(); protected void AwaitPendingPhysicalFileUploadsForBatch(); protected void AwaitPendingPhysicalFileUploadsForJob(); public bool WaitForRetry(Func<bool> retryFunction, string startMessage, string successMessage, string warningMessage, int retryCount, int waitBetweenRetriesMilliseconds); } }