Exemple #1
0
 public PathObserverFactory(IIndexFactory indexFactory, IBackupManagerFactory backupFactory, ILogger logger, IFileHelper fileHelper, IPathSubjectFactory pathSubjectFactory)
 {
     this.indexFactory       = indexFactory;
     this.backupFactory      = backupFactory;
     this.logger             = logger;
     this.fileHelper         = fileHelper;
     this.pathSubjectFactory = pathSubjectFactory;
 }
 public ProcessUser_update_userroles_normal(Func <string, IRepositoryFactory> repositoryAccessor, IOptionsSnapshot <SIndexSettings> SIndexSettings)
 {
     _repositoryAccessor = repositoryAccessor;
     _repository         = _repositoryAccessor("EF");
     _SIndexSettings     = SIndexSettings;
     _indexReadFactory   = new IndexReadFactory <UserIndexs>(_SIndexSettings);
     _indexFactory       = new IndexFactory <UserIndexs>(_SIndexSettings);
 }
 public ElasticsearchIndexManager(
     IElasticClientFactory elasticClientFactory,
     IIndexFactory indexFactory
     ) : base(indexFactory)
 {
     // Validate parameters.
     _elasticClient = elasticClientFactory?.CreateClient() ??
                      throw new ArgumentNullException(nameof(elasticClientFactory));
 }
 public void EnsureIndexes(IIndexFactory factory)
 {
     //            //only run if T implements IIndexes<T>
     //            if (typeof(IIndex<T>).IsAssignableFrom(typeof(T)))
     //            {
     //                foreach (var indexTuple in factory.GetIndexes<T>())
     //                {
     //                    Collection.EnsureIndex(indexTuple.Item1, indexTuple.Item2);
     //                }
     //            }
 }
Exemple #5
0
        /// <summary>
        ///     Creates a new unique index.
        /// </summary>
        /// <typeparam name="TUniqueKey">
        ///     The type of the unqiue index key.
        /// </typeparam>
        /// <param name="indexFactory">
        ///     The index factory.
        /// </param>
        /// <param name="keyInfo">
        ///     The definition of the index key
        /// </param>
        /// <returns> The unique index. </returns>
        public IUniqueIndex <TEntity, TUniqueKey> CreateUniqueIndex <TUniqueKey>(
            IIndexFactory indexFactory,
            IKeyInfo <TEntity, TUniqueKey> keyInfo)
        {
            var index = indexFactory.CreateUniqueIndex(this, keyInfo);

            this.indexes.Add(index);
            this.OnIndexChanged();

            return(index);
        }
Exemple #6
0
        /// <summary>
        ///     Creates a new unique index.
        /// </summary>
        /// <typeparam name="TUniqueKey">
        ///     The type of the unique index key.
        /// </typeparam>
        /// <param name="indexFactory">
        ///     The index factory.
        /// </param>
        /// <param name="key">
        ///     The expression representing the definition of the index key.
        /// </param>
        /// <returns>
        ///     The unique index.
        /// </returns>
        public IUniqueIndex <TEntity, TUniqueKey> CreateUniqueIndex <TUniqueKey>(
            IIndexFactory indexFactory,
            Expression <Func <TEntity, TUniqueKey> > keySelector)
        {
            var keyFactory = new ModularKeyInfoFactory(this.Database);
            var key        = keyFactory.Create(keySelector);
            var index      = indexFactory.CreateUniqueIndex(this, key);

            this.indexes.Add(index);
            this.OnIndexChanged();

            return(index);
        }
Exemple #7
0
 public TableCreator(
     IAmazonDynamoDB client,
     IIndexFactory indexFactory,
     IAttributeDefinitionFactory attributeDefinitionFactory,
     IIndexConfigurationFactory indexConfigurationFactory,
     IEntityConfigurationProvider entityConfigurationProvider)
 {
     this.client       = client;
     this.indexFactory = indexFactory;
     this.attributeDefinitionFactory  = attributeDefinitionFactory;
     this.indexConfigurationFactory   = indexConfigurationFactory;
     this.entityConfigurationProvider = entityConfigurationProvider;
 }
        public IndexManager(IIndexFactory indexFactory)
        {
            // Validate parameters.
            if (indexFactory == null)
            {
                throw new ArgumentNullException(nameof(indexFactory));
            }

            // Set indexes.
            _indexes = indexFactory
                       .CreateIndices()
                       .ToReadOnlyDictionary(i => i.Name);
        }
Exemple #9
0
 public VerifyTokenAppService(ICacheService cacheService, ILogger logger
                              , IUserRepositoryRead userrepositoryread, IRoleRepositoryRead rolerepository
                              , Func <string, IRepositoryFactory> repositoryAccessor, IRepositoryReadFactory repositoryReadFactory
                              , IOptionsSnapshot <SIndexSettings> SIndexSettings)
 {
     _cacheService          = cacheService;
     _userrepositoryread    = userrepositoryread;
     _repositoryAccessor    = repositoryAccessor;
     _repositoryFactory     = _repositoryAccessor("EF");
     _repositoryReadFactory = repositoryReadFactory;
     _rolerepositoryread    = rolerepository;
     _SIndexSettings        = SIndexSettings;
     _indexReadFactory      = new IndexReadFactory <UserIndexs>(_SIndexSettings);
     _indexFactory          = new IndexFactory <UserIndexs>(_SIndexSettings);
     _logger = logger;
 }
Exemple #10
0
        public PathObserver(string indexPath, int delay, RepositoryType reposType, IIndexFactory indexFactory, IBackupManagerFactory backupFactory,
                            ILogger logger, IFileHelper fileHelper, IPathSubjectFactory pathSubjectFactory)
        {
            this.delay = delay;
            var index = indexFactory.GetIndex(indexPath);

            this.manager = backupFactory.GetBackupManager(index, reposType);
            this.logger  = logger;

            //Create path subjects
            foreach (var i in index.Values())
            {
                var parts = i.Value;
                if (!Directory.Exists(parts[0]) || !Directory.Exists(parts[1]))
                {
                    logger.Log(System.Diagnostics.EventLogEntryType.Warning, null, new ArgumentException("Could not create binding to path: " + parts[1]));
                    continue;
                }
                var sub = pathSubjectFactory.GetPathSubject(i.Key, parts[0]);
                Attach(sub);
            }
        }
 public QueryActiveGrainsNode(IIndexFactory indexFactory, IStreamProvider streamProvider) : base(indexFactory, streamProvider)
 {
 }
Exemple #12
0
 public QueryIndexedGrainsNode(IIndexFactory indexFactory, IStreamProvider streamProvider, string indexName, object param) : base(indexFactory, streamProvider)
 {
     this._indexName = indexName;
     this._param     = param;
 }
Exemple #13
0
 public ProcessUser_delete_deleteuser_normal_2(IUserRepository repository, IOptionsSnapshot <SIndexSettings> SIndexSettings)
 {
     _repository     = repository;
     _SIndexSettings = SIndexSettings;
     _indexFactory   = new IndexFactory <UserIndexs>(_SIndexSettings);
 }
Exemple #14
0
 public SearchManager(IIndexFactory indexFactory, string serviceUrl, string apiKey)
 {
     _indexFactory        = indexFactory;
     _searchServiceClient = new SearchServiceClient(new Uri(serviceUrl), new SearchCredentials(apiKey));
 }
 public ProcessUser_update_insertupdate_rpc_2(IUserRepository repository, IOptionsSnapshot <SIndexSettings> SIndexSettings)
 {
     _repository     = repository;
     _SIndexSettings = SIndexSettings;
     _indexFactory   = new IndexFactory <UserIndexs>(_SIndexSettings);
 }
 private bool CheckIsOrleansIndex(Expression e, Type grainInterfaceType, Type iPropertiesType, out IIndexFactory indexFactory, out IStreamProvider streamProvider)
 {
     if (e.NodeType == ExpressionType.Constant)
     {
         var queryActiveNodeType = typeof(QueryActiveGrainsNode <,>).MakeGenericType(grainInterfaceType, iPropertiesType);
         var valueType           = ((ConstantExpression)e).Value.GetType().GetGenericTypeDefinition().MakeGenericType(grainInterfaceType, iPropertiesType);
         if (queryActiveNodeType.IsAssignableFrom(valueType))
         {
             var qNode = (QueryGrainsNode)((ConstantExpression)e).Value;
             indexFactory   = qNode.IndexFactory;
             streamProvider = qNode.StreamProvider;
             return(true);
         }
     }
     indexFactory   = null;
     streamProvider = null;
     return(false);
 }
Exemple #17
0
 public IndexService(IIndexFactory indexFactory, IIndexReadFactory indexReadFactory)
 {
     _indexReadFactory = indexReadFactory;
     _indexFactory     = indexFactory;
 }
 public QueryGrainsNode(IIndexFactory indexFactory, IStreamProvider streamProvider)
 {
     this.IndexFactory   = indexFactory;
     this.StreamProvider = streamProvider;
 }