TapiTotals
Represents a class object that provides Transfer API totals. This class cannot be inherited.
using System.Threading;
namespace Relativity.DataExchange.Transfer
{
public sealed class TapiTotals
{
private long totalFileTransferRequests;
private long totalCompletedFileTransfers;
private long totalSuccessfulFileTransfers;
public long TotalFileTransferRequests => totalFileTransferRequests;
public long TotalCompletedFileTransfers => totalCompletedFileTransfers;
public long TotalSuccessfulFileTransfers => totalSuccessfulFileTransfers;
public TapiTotals()
: this(0, 0, 0)
{
}
public TapiTotals(long totalCompletedFileTransfers, long totalFileTransferRequests, long totalSuccessfulFileTransfers)
{
this.totalCompletedFileTransfers = totalCompletedFileTransfers;
this.totalFileTransferRequests = totalFileTransferRequests;
this.totalSuccessfulFileTransfers = totalSuccessfulFileTransfers;
}
public void Clear()
{
Interlocked.Exchange(ref totalCompletedFileTransfers, 0);
Interlocked.Exchange(ref totalFileTransferRequests, 0);
Interlocked.Exchange(ref totalSuccessfulFileTransfers, 0);
}
public void IncrementTotalCompletedFileTransfers()
{
Interlocked.Increment(ref totalCompletedFileTransfers);
}
public void IncrementTotalFileTransferRequests()
{
Interlocked.Increment(ref totalFileTransferRequests);
}
public void IncrementTotalSuccessfulFileTransfers()
{
Interlocked.Increment(ref totalSuccessfulFileTransfers);
}
public TapiTotals DeepCopy()
{
return new TapiTotals(TotalCompletedFileTransfers, TotalFileTransferRequests, TotalSuccessfulFileTransfers);
}
}
}