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;
 }
Пример #2
0
 public ClaimsTransformation(
     IUserRoleToPermissionsTransformer userRoleToPermissionsTransformer,
     IAccountsCache accountsCache)
 {
     this.userRoleToPermissionsTransformer = userRoleToPermissionsTransformer;
     this.accountsCache = accountsCache;
 }
Пример #3
0
 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
         );
 }