internal ModularDatabaseCreationContext(string databaseName, PlatformModule platformModule, DatabaseEditionContext editionContext, Procedures procedures, GraphDatabaseFacade facade) { this._databaseName = databaseName; this._config = platformModule.Config; DatabaseIdContext idContext = editionContext.IdContext; this._idGeneratorFactory = idContext.IdGeneratorFactory; this._idController = idContext.IdController; this._databaseLayout = platformModule.StoreLayout.databaseLayout(databaseName); this._logService = platformModule.Logging; this._scheduler = platformModule.JobScheduler; this._globalDependencies = platformModule.Dependencies; this._tokenHolders = editionContext.CreateTokenHolders(); this._tokenNameLookup = new NonTransactionalTokenNameLookup(_tokenHolders); this._locks = editionContext.CreateLocks(); this._statementLocksFactory = editionContext.CreateStatementLocksFactory(); this._schemaWriteGuard = editionContext.SchemaWriteGuard; this._transactionEventHandlers = new TransactionEventHandlers(facade); this._monitors = new Monitors(platformModule.Monitors); this._indexingServiceMonitor = _monitors.newMonitor(typeof(IndexingService.Monitor)); this._physicalLogMonitor = _monitors.newMonitor(typeof(LogFileCreationMonitor)); this._fs = platformModule.FileSystem; this._transactionStats = editionContext.CreateTransactionMonitor(); this._databaseHealth = new DatabaseHealth(platformModule.PanicEventGenerator, _logService.getInternalLog(typeof(DatabaseHealth))); this._transactionHeaderInformationFactory = editionContext.HeaderInformationFactory; this._commitProcessFactory = editionContext.CommitProcessFactory; this._autoIndexing = new InternalAutoIndexing(platformModule.Config, _tokenHolders.propertyKeyTokens()); this._indexConfigStore = new IndexConfigStore(_databaseLayout, _fs); this._explicitIndexProvider = new DefaultExplicitIndexProvider(); this._pageCache = platformModule.PageCache; this._constraintSemantics = editionContext.ConstraintSemantics; this._tracers = platformModule.Tracers; this._procedures = procedures; this._ioLimiter = editionContext.IoLimiter; this._clock = platformModule.Clock; this._databaseAvailabilityGuard = editionContext.CreateDatabaseAvailabilityGuard(_clock, _logService, _config); this._databaseAvailability = new DatabaseAvailability(_databaseAvailabilityGuard, _transactionStats, platformModule.Clock, AwaitActiveTransactionDeadlineMillis); this._coreAPIAvailabilityGuard = new CoreAPIAvailabilityGuard(_databaseAvailabilityGuard, editionContext.TransactionStartTimeout); this._accessCapability = editionContext.AccessCapability; this._storeCopyCheckPointMutex = new StoreCopyCheckPointMutex(); this._recoveryCleanupWorkCollector = platformModule.RecoveryCleanupWorkCollector; this._databaseInfo = platformModule.DatabaseInfo; this._versionContextSupplier = platformModule.VersionContextSupplier; this._collectionsFactorySupplier = platformModule.CollectionsFactorySupplier; this._kernelExtensionFactories = platformModule.KernelExtensionFactories; this._watcherServiceFactory = editionContext.WatcherServiceFactory; this._facade = facade; this._engineProviders = platformModule.EngineProviders; }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void setup(Dependencies dependencies) throws org.neo4j.internal.kernel.api.exceptions.KernelException public override void Setup(Dependencies dependencies) { Config config = dependencies.Config(); Procedures procedures = dependencies.Procedures(); LogProvider logProvider = dependencies.LogService().UserLogProvider; JobScheduler jobScheduler = dependencies.Scheduler(); FileSystemAbstraction fileSystem = dependencies.FileSystem(); AccessCapability accessCapability = dependencies.AccessCapability(); SecurityLog securityLog = SecurityLog.create(config, dependencies.LogService().getInternalLog(typeof(GraphDatabaseFacade)), fileSystem, jobScheduler); Life.add(securityLog); _authManager = NewAuthManager(config, logProvider, securityLog, fileSystem, jobScheduler, accessCapability); Life.add(dependencies.DependencySatisfier().satisfyDependency(_authManager)); // Register procedures procedures.RegisterComponent(typeof(SecurityLog), ctx => securityLog, false); procedures.RegisterComponent(typeof(EnterpriseAuthManager), ctx => _authManager, false); procedures.RegisterComponent(typeof(EnterpriseSecurityContext), ctx => AsEnterprise(ctx.get(SECURITY_CONTEXT)), true); if (SecurityConfig.nativeAuthEnabled) { procedures.RegisterComponent(typeof(EnterpriseUserManager), ctx => _authManager.getUserManager(ctx.get(SECURITY_CONTEXT).subject(), ctx.get(SECURITY_CONTEXT).Admin), true); if (config.Get(SecuritySettings.auth_providers).Count > 1) { procedures.RegisterProcedure(typeof(UserManagementProcedures), true, "%s only applies to native users."); } else { procedures.RegisterProcedure(typeof(UserManagementProcedures), true); } } else { procedures.RegisterComponent(typeof(EnterpriseUserManager), ctx => EnterpriseUserManager.NOOP, true); } procedures.RegisterProcedure(typeof(SecurityProcedures), true); }
public KernelTransactions(Config config, StatementLocksFactory statementLocksFactory, ConstraintIndexCreator constraintIndexCreator, StatementOperationParts statementOperations, SchemaWriteGuard schemaWriteGuard, TransactionHeaderInformationFactory txHeaderFactory, TransactionCommitProcess transactionCommitProcess, AuxiliaryTransactionStateManager auxTxStateManager, TransactionHooks hooks, TransactionMonitor transactionMonitor, AvailabilityGuard databaseAvailabilityGuard, Tracers tracers, StorageEngine storageEngine, Procedures procedures, TransactionIdStore transactionIdStore, SystemNanoClock clock, AtomicReference <CpuClock> cpuClockRef, AtomicReference <HeapAllocation> heapAllocationRef, AccessCapability accessCapability, AutoIndexing autoIndexing, ExplicitIndexStore explicitIndexStore, VersionContextSupplier versionContextSupplier, CollectionsFactorySupplier collectionsFactorySupplier, ConstraintSemantics constraintSemantics, SchemaState schemaState, IndexingService indexingService, TokenHolders tokenHolders, string currentDatabaseName, Dependencies dataSourceDependencies) { if (!InstanceFieldsInitialized) { InitializeInstanceFields(); InstanceFieldsInitialized = true; } this._config = config; this._statementLocksFactory = statementLocksFactory; this._constraintIndexCreator = constraintIndexCreator; this._statementOperations = statementOperations; this._schemaWriteGuard = schemaWriteGuard; this._transactionHeaderInformationFactory = txHeaderFactory; this._transactionCommitProcess = transactionCommitProcess; this._auxTxStateManager = auxTxStateManager; this._hooks = hooks; this._transactionMonitor = transactionMonitor; this._databaseAvailabilityGuard = databaseAvailabilityGuard; this._tracers = tracers; this._storageEngine = storageEngine; this._procedures = procedures; this._transactionIdStore = transactionIdStore; this._cpuClockRef = cpuClockRef; this._heapAllocationRef = heapAllocationRef; this._accessCapability = accessCapability; this._autoIndexing = autoIndexing; this._explicitIndexStore = explicitIndexStore; this._indexingService = indexingService; this._tokenHolders = tokenHolders; this._currentDatabaseName = currentDatabaseName; this._dataSourceDependencies = dataSourceDependencies; this._versionContextSupplier = versionContextSupplier; this._clock = clock; DoBlockNewTransactions(); this._collectionsFactorySupplier = collectionsFactorySupplier; this._constraintSemantics = constraintSemantics; this._schemaState = schemaState; }
protected internal virtual EnterpriseUserManager CreateInternalRealm(Config config, LogProvider logProvider, FileSystemAbstraction fileSystem, JobScheduler jobScheduler, SecurityLog securityLog, AccessCapability accessCapability) { EnterpriseUserManager internalRealm = null; if (SecurityConfig.hasNativeProvider) { internalRealm = CreateInternalFlatFileRealm(config, logProvider, fileSystem, jobScheduler); } return(internalRealm); }
public virtual EnterpriseAuthAndUserManager NewAuthManager(Config config, LogProvider logProvider, SecurityLog securityLog, FileSystemAbstraction fileSystem, JobScheduler jobScheduler, AccessCapability accessCapability) { SecurityConfig = GetValidatedSecurityConfig(config); IList <Realm> realms = new List <Realm>(SecurityConfig.authProviders.Count + 1); SecureHasher secureHasher = new SecureHasher(); EnterpriseUserManager internalRealm = CreateInternalRealm(config, logProvider, fileSystem, jobScheduler, securityLog, accessCapability); if (internalRealm != null) { realms.Add(( Realm )internalRealm); } if (SecurityConfig.hasLdapProvider) { realms.Add(new LdapRealm(config, securityLog, secureHasher)); } if (SecurityConfig.pluginAuthProviders.Count > 0) { ((IList <Realm>)realms).AddRange(CreatePluginRealms(config, securityLog, secureHasher, SecurityConfig)); } // Select the active realms in the order they are configured IList <Realm> orderedActiveRealms = SelectOrderedActiveRealms(SecurityConfig.authProviders, realms); if (orderedActiveRealms.Count == 0) { throw IllegalConfiguration("No valid auth provider is active."); } return(new MultiRealmAuthManager(internalRealm, orderedActiveRealms, CreateCacheManager(config), securityLog, config.Get(SecuritySettings.security_log_successful_authentication), SecurityConfig.propertyAuthorization, SecurityConfig.propertyBlacklist)); }
internal TestKernelTransactions(StatementLocksFactory statementLocksFactory, ConstraintIndexCreator constraintIndexCreator, StatementOperationParts statementOperations, SchemaWriteGuard schemaWriteGuard, TransactionHeaderInformationFactory txHeaderFactory, TransactionCommitProcess transactionCommitProcess, AuxiliaryTransactionStateManager auxTxStateManager, TransactionHooks hooks, TransactionMonitor transactionMonitor, AvailabilityGuard databaseAvailabilityGuard, Tracers tracers, StorageEngine storageEngine, Procedures procedures, TransactionIdStore transactionIdStore, SystemNanoClock clock, AccessCapability accessCapability, AutoIndexing autoIndexing, VersionContextSupplier versionContextSupplier, TokenHolders tokenHolders, Dependencies dataSourceDependencies) : base(Config.defaults(), statementLocksFactory, constraintIndexCreator, statementOperations, schemaWriteGuard, txHeaderFactory, transactionCommitProcess, auxTxStateManager, hooks, transactionMonitor, databaseAvailabilityGuard, tracers, storageEngine, procedures, transactionIdStore, clock, new AtomicReference <CpuClock>(CpuClock.NOT_AVAILABLE), new AtomicReference <HeapAllocation>(HeapAllocation.NOT_AVAILABLE), accessCapability, autoIndexing, mock(typeof(ExplicitIndexStore)), versionContextSupplier, ON_HEAP, new StandardConstraintSemantics(), mock(typeof(SchemaState)), mock(typeof(IndexingService)), tokenHolders, DEFAULT_DATABASE_NAME, dataSourceDependencies) { }