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

ImportTapiBase

public abstract class ImportTapiBase
Represents the base-class object for all TAPI-based import and export instances.

protected readonly ILog _logger

protected Func<string> CorrelationIdFunc

protected TapiClient BulkLoadTapiClient { get; }

protected string BulkLoadTapiClientName { get; }

protected abstract int CurrentLineNumber { get; }

protected IDictionary CurrentStatisticsSnapshot { get; protected set; }

public bool DisableNativeLocationValidation { get; set; }

protected IFileSystem FileSystem { get; }

Gets the file system instance.

protected UploadTapiBridge2 FileTapiBridge { get; }

protected TapiClient FileTapiClient { get; }

protected string FileTapiClientName { get; }

public int FileTapiProgressCount { get; protected set; }

protected int ImportFilesCount { get; protected set; }

protected int JobCounter { get; protected set; }

protected ILog Logger { get; }

protected int MetadataFilesCount { get; protected set; }

protected RetryOptions RetryOptions { get; }

Gets the configurable retry options.

protected bool ShouldImport { get; protected set; }

public ImportStatistics Statistics { get; }

public TapiClient TapiClient { get; }

public string TapiClientName { get; }

public int TotalTransferredFilesCount { get; protected set; }

public ImportTapiBase(IIoReporter reporter, ILog logger, CancellationTokenSource cancellationTokenSource, Func<string> correlationIdFunc)

protected static bool IsBulkImportSqlException(Exception ex)

protected static bool IsTimeoutException(Exception ex)

Awaits completion of all pending metadata uploads for the current batch and optimize file transfers by not disposing the transfer job. This should be executed before the mass import API service call.

Awaits completion of all pending metadata uploads for the import job and dispose all transfer related objects. This should be called before the mass import API service call.

Awaits completion of all pending physical file uploads for the current batch and optimize file transfers by not disposing the transfer job.

Awaits completion of all pending physical file uploads for the import job and dispose all transfer related objects.

protected void CopyFile(string sourceFileName, string destFileName)

Copies an existing file to a new file. Overwriting a file of the same name is not allowed.

protected void CopyFile(string sourceFileName, string destFileName, bool overwrite)

Copies an existing file to a new file. Overwriting a file of the same name is allowed.

protected void CreateTapiBridges(UploadTapiBridgeParameters2 fileParameters, UploadTapiBridgeParameters2 bulkLoadParameters, IAuthenticationTokenProvider authTokenProvider, IRelativityManagerServiceFactory managerServiceFactory)

Creates a policy object capable of performing resiliency operations.

protected void DestroyTapiBridges()

protected string GetExistingFilePath(string path, bool retry)

Retrieves the case-sensitive or case-insensitive file path and optionally retries all thrown IOException.

protected bool GetFileExists(string path)

Determines whether the specified file exists and optionally retries all thrown IOException.

protected long GetFileLength(string path, bool retry)

Retrieves the specified file length and optionally retries all thrown IOException.

protected string GetLineMessage(string line, int lineNumber)

protected void LogError(Exception exception, string messageTemplate, object[] propertyValues)

protected void LogError(string messageTemplate, object[] propertyValues)

protected void LogFatal(Exception exception, string messageTemplate, object[] propertyValues)

protected void LogFatal(string messageTemplate, object[] propertyValues)

protected void LogInformation(Exception exception, string messageTemplate, object[] propertyValues)

protected void LogInformation(string messageTemplate, object[] propertyValues)

protected void LogStatistics()

Logs the statistics object.

protected void LogWarning(Exception exception, string messageTemplate, object[] propertyValues)

protected void LogWarning(string messageTemplate, object[] propertyValues)

protected virtual void OnBatchCompleted(BatchInformation batchInformation)

protected virtual void OnStopImport()

protected virtual void OnTapiClientChanged()

protected virtual void OnWriteFatalError(Exception exception)

protected virtual void OnWriteStatusMessage(EventType2 eventType, string message)

protected virtual void OnWriteStatusMessage(EventType2 eventType, string message, int progressLineNumber, int physicalLineNumber)

protected void PublishIoRetryMessage(Exception exception, TimeSpan timeSpan, int retryCount, int totalRetryCount)

Publishes a retry-based warning message and logs the exception.

Publishes a raw warning message and logs the information.

protected void PublishUploadModeChangeEvent(bool nativeFilesCopied)

protected virtual void RaiseWarningAndPause(Exception exception, int timeoutSeconds)

protected virtual void RaiseWarningAndPause(Exception exception, int timeoutSeconds, int retryCount, int totalRetryCount)

protected void StopImport(bool userCancelRequest = false)

protected void UpdateStatisticsSnapshot(DateTime time, bool force = false)

public bool WaitForRetry(Func<bool> retryFunction, string startMessage, string successMessage, string warningMessage, int retryCount, int waitBetweenRetriesMilliseconds)