-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathClientConfigurationFactory.cs
More file actions
53 lines (49 loc) · 2.03 KB
/
ClientConfigurationFactory.cs
File metadata and controls
53 lines (49 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// ----------------------------------------------------------------------------
// <copyright file="ClientConfigurationFactory.cs" company="Relativity ODA LLC">
// © Relativity All Rights Reserved.
// </copyright>
// ----------------------------------------------------------------------------
namespace Relativity.Server.Transfer.SDK.Samples
{
using System.ComponentModel;
using Relativity.Transfer;
using Relativity.Transfer.Aspera;
using Relativity.Transfer.FileShare;
using Relativity.Server.Transfer.SDK.Samples.Enums;
public class ClientConfigurationFactory
{
public ClientConfiguration Create()
{
TransferMode transferMode = SampleRunner.GetTransferMode();
switch (transferMode)
{
case TransferMode.Aspera:
return new AsperaClientConfiguration
{
// Common properties
BadPathErrorsRetry = false,
FileNotFoundErrorsRetry = false,
MaxHttpRetryAttempts = 2,
PreserveDates = true,
TargetDataRateMbps = 5,
// Aspera specific properties
EncryptionCipher = "AES_256",
OverwritePolicy = "ALWAYS",
Policy = "FAIR",
};
case TransferMode.Fileshare:
return new FileShareClientConfiguration()
{
// Common properties
BadPathErrorsRetry = false,
FileNotFoundErrorsRetry = false,
MaxHttpRetryAttempts = 2,
PreserveDates = true,
TargetDataRateMbps = 5,
};
default:
throw new InvalidEnumArgumentException("Specified TransferMode enum value is invalid");
}
}
}
}