コード例 #1
0
        public DataSourceModule(string databaseName, PlatformModule platformModule, AbstractEditionModule editionModule, Procedures procedures, GraphDatabaseFacade graphDatabaseFacade)
        {
            platformModule.DiagnosticsManager.prependProvider(platformModule.Config);
            DatabaseEditionContext         editionContext = editionModule.CreateDatabaseContext(databaseName);
            ModularDatabaseCreationContext context        = new ModularDatabaseCreationContext(databaseName, platformModule, editionContext, procedures, graphDatabaseFacade);

            NeoStoreDataSource = new NeoStoreDataSource(context);

            this.CoreAPIAvailabilityGuardConflict = context.CoreAPIAvailabilityGuard;
            this.StoreId   = NeoStoreDataSource.getStoreId;
            this.KernelAPI = NeoStoreDataSource.getKernel;

            ProcedureGDSFactory gdsFactory = new ProcedureGDSFactory(platformModule, this, CoreAPIAvailabilityGuardConflict, context.TokenHolders, editionModule.ThreadToTransactionBridge);

            procedures.RegisterComponent(typeof(GraphDatabaseService), gdsFactory.apply, true);
        }
コード例 #2
0
        public static void CreateEnterpriseSecurityModule(AbstractEditionModule editionModule, PlatformModule platformModule, Procedures procedures)
        {
            SecurityProvider securityProvider;

            if (platformModule.Config.get(GraphDatabaseSettings.auth_enabled))
            {
                SecurityModule securityModule = SetupSecurityModule(platformModule, editionModule, platformModule.Logging.getUserLog(typeof(EnterpriseEditionModule)), procedures, platformModule.Config.get(EnterpriseEditionSettings.security_module));
                platformModule.Life.add(securityModule);
                securityProvider = securityModule;
            }
            else
            {
                EnterpriseNoAuthSecurityProvider provider = EnterpriseNoAuthSecurityProvider.INSTANCE;
                platformModule.Life.add(provider);
                securityProvider = provider;
            }
            editionModule.SecurityProvider = securityProvider;
        }