AsperaConnectionService
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace Relativity.Transfer.Aspera
{
public class AsperaConnectionService : ConnectionServiceBase
{
private readonly AsperaClientConfiguration clientConfiguration;
private AsperaDiagnosticsService diagnosticsService;
public override Guid ClientId => new Guid("812A70A5-7311-46CC-BE53-07BB8C5F9A7D");
public override string ClientDisplayName => "Aspera";
public AsperaConnectionService(RelativityConnectionInfo connectionInfo, ClientConfiguration configuration, IFileSystemService fileSystemService, ITransferLog log, DiagnosticsContext context)
: base(connectionInfo, configuration, fileSystemService, log, context)
{
clientConfiguration = ((configuration as AsperaClientConfiguration) ?? new AsperaClientConfiguration(configuration));
}
[AsyncStateMachine(typeof(<RunPreTestsAsync>d__7))]
protected override Task RunPreTestsAsync(CancellationToken token)
{
<RunPreTestsAsync>d__7 stateMachine = default(<RunPreTestsAsync>d__7);
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<TestUploadAsync>d__8))]
protected override Task TestUploadAsync(CancellationToken token)
{
<TestUploadAsync>d__8 stateMachine = default(<TestUploadAsync>d__8);
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<TestDownloadAsync>d__9))]
protected override Task TestDownloadAsync(CancellationToken token)
{
<TestDownloadAsync>d__9 stateMachine = default(<TestDownloadAsync>d__9);
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<RunPortsTestAsync>d__10))]
protected override Task RunPortsTestAsync(CancellationToken token)
{
<RunPortsTestAsync>d__10 stateMachine = default(<RunPortsTestAsync>d__10);
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
private static string FormatErrorMessage(ISupportCheckResult supportCheckResult)
{
string str = supportCheckResult.StandardError.FirstOrDefault() ?? "Unknown.";
string text = supportCheckResult.ErrorMessage + " Details: " + str;
if (!text.EndsWith("."))
text += ".";
return text;
}
[AsyncStateMachine(typeof(<AutoConfigureAsync>d__12))]
private Task AutoConfigureAsync(CancellationToken token)
{
<AutoConfigureAsync>d__12 stateMachine = default(<AutoConfigureAsync>d__12);
stateMachine.<>t__builder = AsyncTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.token = token;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
private void AddAsperaLogToHealthCheck(ISupportCheckResult supportCheckResult)
{
List<string> value = supportCheckResult.LogFileLines.Take(clientConfiguration.HealthCheckLogMaxLine).ToList();
AddClientInfoToHealthCheck("aspera-log", value);
}
}
}