ExtendedImportAPI
using kCura.Relativity.DataReaderClient;
using kCura.WinEDDS.Service;
using kCura.WinEDDS.Service.Replacement;
using Relativity.DataExchange;
using Relativity.Logging;
using System.Reflection;
namespace kCura.Relativity.ImportAPI
{
public class ExtendedImportAPI : ImportAPI, IExtendedImportAPI, IImportAPI
{
public ExtendedImportAPI(string userName, string password)
: base(userName, password)
{
}
public ExtendedImportAPI(string userName, string password, ILog logger)
: base(userName, password, logger)
{
}
public ExtendedImportAPI(string userName, string password, string webServiceUrl)
: base(userName, password, webServiceUrl)
{
}
public ExtendedImportAPI(string userName, string password, string webServiceUrl, ILog logger)
: base(userName, password, webServiceUrl, logger)
{
}
public new static ImportAPI CreateByTokenProvider(string webServiceUrl, IRelativityTokenProvider relativityTokenProvider, ILog logger = null)
{
return ImportAPI.CreateByTokenProvider(webServiceUrl, relativityTokenProvider, logger);
}
public void CleanUpAfterJobWithSpoofing(string onBehalfOfUserToken)
{
if (!string.IsNullOrWhiteSpace(onBehalfOfUserToken)) {
using (IAuditManager auditManager = ManagerFactory.CreateAuditManager(_credentials, _cookieMonster, base.GetCorrelationId))
try {
auditManager.DeleteAuditToken(onBehalfOfUserToken);
} catch {
}
}
}
public ImportBulkArtifactJob NewNativeDocumentImportJob(string token)
{
_runningContext.CallingAssembly = Assembly.GetCallingAssembly().GetName().Name;
ImportBulkArtifactJob importBulkArtifactJob = NewNativeDocumentImportJob();
importBulkArtifactJob.Settings.OnBehalfOfUserToken = token;
return importBulkArtifactJob;
}
public ImportBulkArtifactJob NewArtifactImportJob(string token, int artifactTypeID)
{
_runningContext.CallingAssembly = Assembly.GetCallingAssembly().GetName().Name;
ImportBulkArtifactJob importBulkArtifactJob = NewObjectImportJob(artifactTypeID);
importBulkArtifactJob.Settings.OnBehalfOfUserToken = token;
return importBulkArtifactJob;
}
}
}