public HomeController(IOptions <SwiftCredentials> credentials, IMemoryCache cache) { Credentials = credentials.Value; Client = new Client(new SwiftAuthManagerWithCache(Credentials, cache)); Client.SetRetryCount(2) .SetLogger(new SwiftLogger()); }
public SwiftAuthManagerMemoryCache(IOptions<SwiftServiceOptions> options, IMemoryCache cache) { var _options = options.Value; Credentials = new SwiftCredentials { Endpoints = _options.Endpoints, Password = _options.Password, Username = _options.Username }; this.cache = cache; }
public SwiftAuthManagerDistributedCache(IOptions<SwiftServiceOptions> options, IDistributedCache cache) { var _options = options.Value; Credentials = new SwiftCredentials { Endpoints = _options.Endpoints, Password = _options.Password, Username = _options.Username }; _cache = cache; }
public SwiftAuthManagerMemoryCache(IOptions <SwiftServiceOptions> options, IMemoryCache cache) { var _options = options.Value; Credentials = new SwiftCredentials { Endpoints = _options.Endpoints, Password = _options.Password, Username = _options.Username }; this.cache = cache; }
public SwiftAuthManagerDistributedCache(IOptions <SwiftServiceOptions> options, IDistributedCache cache) { var _options = options.Value; Credentials = new SwiftCredentials { Endpoints = _options.Endpoints, Password = _options.Password, Username = _options.Username }; _cache = cache; }
public async Task <IActionResult> GetByIdAsync(string swiftCredentialsId) { SwiftCredentials swiftCredentials = await _swiftCredentialsService.GetByIdAsync(swiftCredentialsId); if (swiftCredentials == null) { return(NotFound()); } var model = Mapper.Map <SwiftCredentialsModel>(swiftCredentials); return(Ok(model)); }
public async Task UpdateAsync(SwiftCredentials swiftCredentials) { var existingSwiftCredentials = await _swiftCredentialsRepository.GetByIdAsync(swiftCredentials.Id); if (existingSwiftCredentials == null) { throw new SwiftCredentialsNotFoundException(swiftCredentials.Id); } await _swiftCredentialsRepository.UpdateAsync(swiftCredentials); await _clientSwiftCredentialsCache.ClearAsync("Swift credentials updated"); await _log.WriteInfoAsync(nameof(SwiftCredentialsService), nameof(UpdateAsync), swiftCredentials.ToJson(), "Swift credentials updated"); }
public async Task InsertAsync(SwiftCredentials swiftCredentials) { var entity = new SwiftCredentialsEntity( GetPartitionKey(swiftCredentials.LegalEntityId), GetRowKey()) { LegalEntityId = swiftCredentials.LegalEntityId, AssetId = swiftCredentials.AssetId }; Mapper.Map(swiftCredentials, entity); await _storage.InsertAsync(entity); await _indexIdStorage.InsertAsync(AzureIndex.Create( GetIndexIdPartitionKey(entity.RowKey), GetIndexIdRowKey(entity.RowKey), entity)); }
public async Task UpdateAsync(SwiftCredentials swiftCredentials) { var index = await _indexIdStorage.GetDataAsync( GetIndexIdPartitionKey(swiftCredentials.Id), GetIndexIdRowKey(swiftCredentials.Id)); if (index == null) { return; } await _storage.MergeAsync(index.PrimaryPartitionKey, index.PrimaryRowKey, entity => { Mapper.Map(swiftCredentials, entity); return(entity); }); }
public async Task AddAsync(SwiftCredentials swiftCredentials) { var existingSwiftCredentials = await _swiftCredentialsRepository .FindAsync(swiftCredentials.LegalEntityId, swiftCredentials.AssetId); if (existingSwiftCredentials.Count > 0) { throw new SwiftCredentialsAlreadyExistsException(swiftCredentials.LegalEntityId, swiftCredentials.AssetId); } var legalEntity = await _legalEntityRepository.GetByIdAsync(swiftCredentials.LegalEntityId); if (legalEntity == null) { throw new LegalEntityNotFoundException(swiftCredentials.LegalEntityId); } await _swiftCredentialsRepository.InsertAsync(swiftCredentials); await _log.WriteInfoAsync(nameof(SwiftCredentialsService), nameof(AddAsync), swiftCredentials.ToJson(), "Swift credentials added"); }
public SwiftInitFixture() { Credentials = GetConfigCredentials(); }
public Exporter(Client client, SwiftCredentials credentials) { this.client = client; this.credentials = credentials; }
public SwiftFixture() { Credentials = GetConfigCredentials(); }
public SwiftAuthManagerWithCache(SwiftCredentials credentials, IMemoryCache cache) { Credentials = credentials; this.cache = cache; }
public Importer(SwiftCredentials credentials, string rootPath) { this.credentials = credentials; this.rootPath = rootPath; }