HttpConnectionService
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace Relativity.Transfer.Http
{
public class HttpConnectionService : ConnectionServiceBase
{
private readonly IFileTransferService fileTransferService;
private readonly Workspace workspace;
public override string ClientDisplayName => "Web";
public override Guid ClientId => new Guid("18F9E382-288C-4B6D-8AE8-FBA4D88CD841");
public HttpConnectionService(RelativityConnectionInfo connectionInfo, Workspace workspace, ClientConfiguration configuration, IFileSystemService fileSystemService, ITransferLog log, DiagnosticsContext context)
: base(connectionInfo, configuration, fileSystemService, log, context)
{
if (workspace == null)
throw new ArgumentNullException("workspace");
this.workspace = workspace;
fileTransferService = new FileTransferService(connectionInfo, workspace, (configuration as HttpClientConfiguration) ?? new HttpClientConfiguration(configuration), base.FileSystemService, log);
}
protected override Task RunPreTestsAsync(CancellationToken token)
{
base.RunPortsTestAsync(token);
fileTransferService.Login();
return Task.FromResult(true);
}
[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;
}
}
}