internal BrightstarAccountsRepository(string superUserAccountId, string superUserAccountKey, IAccountsCache cache) { Task.Factory.StartNew(() => { while (true) { try { try { BrightstarCluster.Instance.GetLastModifiedDate(StoreName); return; } catch (StoreNotFoundException) { Trace.TraceInformation("Attempting to create Accounts Repository"); BrightstarCluster.Instance.CreateStore(StoreName); } } catch (EndpointNotFoundException) { Thread.Sleep(3000); } catch(Exception) { return; } } }); _superUserAccount = new AccountDetails{AccountId = superUserAccountId, PrimaryKey = superUserAccountKey, SecondaryKey = superUserAccountKey}; _cache = cache; }
public ClaimsTransformation( IUserRoleToPermissionsTransformer userRoleToPermissionsTransformer, IAccountsCache accountsCache) { this.userRoleToPermissionsTransformer = userRoleToPermissionsTransformer; this.accountsCache = accountsCache; }
internal BrightstarAccountsRepository(string superUserAccountId, string superUserAccountKey, IAccountsCache cache) { Task.Factory.StartNew(() => { while (true) { try { try { BrightstarCluster.Instance.GetLastModifiedDate(StoreName); return; } catch (StoreNotFoundException) { Trace.TraceInformation("Attempting to create Accounts Repository"); BrightstarCluster.Instance.CreateStore(StoreName); } } catch (EndpointNotFoundException) { Thread.Sleep(3000); } catch (Exception) { return; } } }); _superUserAccount = new AccountDetails { AccountId = superUserAccountId, PrimaryKey = superUserAccountKey, SecondaryKey = superUserAccountKey }; _cache = cache; }
public static void Initialize(IAccountsCache cache) { _instance = new BrightstarAccountsRepository( RoleEnvironment.GetConfigurationSettingValue(AzureConstants.SuperUserAccountPropertyName), RoleEnvironment.GetConfigurationSettingValue(AzureConstants.SuperUserKeyPropertyName), cache ); }