Search in sources :

Example 1 with DefaultDatabaseResolver

use of org.neo4j.kernel.database.DefaultDatabaseResolver in project neo4j by neo4j.

the class SessionExtension method beforeEach.

@Override
public void beforeEach(ExtensionContext extensionContext) {
    managementService = builderFactory.get().impermanent().setConfig(GraphDatabaseSettings.auth_enabled, authEnabled).build();
    gdb = (GraphDatabaseAPI) managementService.database(GraphDatabaseSettings.DEFAULT_DATABASE_NAME);
    DependencyResolver resolver = gdb.getDependencyResolver();
    Authentication authentication = authentication(resolver.resolveDependency(AuthManager.class));
    Config config = resolver.resolveDependency(Config.class);
    SystemNanoClock clock = Clocks.nanoClock();
    DefaultDatabaseResolver defaultDatabaseResolver = new CommunityDefaultDatabaseResolver(config, () -> managementService.database(GraphDatabaseSettings.SYSTEM_DATABASE_NAME));
    BoltGraphDatabaseManagementServiceSPI databaseManagementService = new BoltKernelDatabaseManagementServiceProvider(managementService, new Monitors(), clock, ofSeconds(30));
    boltFactory = new BoltStateMachineFactoryImpl(databaseManagementService, authentication, clock, config, NullLogService.getInstance(), defaultDatabaseResolver);
}
Also used : BoltStateMachineFactoryImpl(org.neo4j.bolt.runtime.statemachine.impl.BoltStateMachineFactoryImpl) SystemNanoClock(org.neo4j.time.SystemNanoClock) AuthManager(org.neo4j.kernel.api.security.AuthManager) BoltKernelDatabaseManagementServiceProvider(org.neo4j.bolt.dbapi.impl.BoltKernelDatabaseManagementServiceProvider) Authentication(org.neo4j.bolt.security.auth.Authentication) BasicAuthentication(org.neo4j.bolt.security.auth.BasicAuthentication) Config(org.neo4j.configuration.Config) DefaultDatabaseResolver(org.neo4j.kernel.database.DefaultDatabaseResolver) CommunityDefaultDatabaseResolver(org.neo4j.server.security.systemgraph.CommunityDefaultDatabaseResolver) CommunityDefaultDatabaseResolver(org.neo4j.server.security.systemgraph.CommunityDefaultDatabaseResolver) Monitors(org.neo4j.monitoring.Monitors) DependencyResolver(org.neo4j.common.DependencyResolver) BoltGraphDatabaseManagementServiceSPI(org.neo4j.bolt.dbapi.BoltGraphDatabaseManagementServiceSPI)

Aggregations

BoltGraphDatabaseManagementServiceSPI (org.neo4j.bolt.dbapi.BoltGraphDatabaseManagementServiceSPI)1 BoltKernelDatabaseManagementServiceProvider (org.neo4j.bolt.dbapi.impl.BoltKernelDatabaseManagementServiceProvider)1 BoltStateMachineFactoryImpl (org.neo4j.bolt.runtime.statemachine.impl.BoltStateMachineFactoryImpl)1 Authentication (org.neo4j.bolt.security.auth.Authentication)1 BasicAuthentication (org.neo4j.bolt.security.auth.BasicAuthentication)1 DependencyResolver (org.neo4j.common.DependencyResolver)1 Config (org.neo4j.configuration.Config)1 AuthManager (org.neo4j.kernel.api.security.AuthManager)1 DefaultDatabaseResolver (org.neo4j.kernel.database.DefaultDatabaseResolver)1 Monitors (org.neo4j.monitoring.Monitors)1 CommunityDefaultDatabaseResolver (org.neo4j.server.security.systemgraph.CommunityDefaultDatabaseResolver)1 SystemNanoClock (org.neo4j.time.SystemNanoClock)1