use of org.neo4j.graphdb.facade.GraphDatabaseDependencies in project neo4j by neo4j.
the class AbstractInProcessNeo4jBuilder method build.
@Override
public InProcessNeo4j build() {
Path userLogFile = serverFolder.resolve("neo4j.log");
Path internalLogFile = serverFolder.resolve("debug.log");
config.set(ServerSettings.third_party_packages, unmanagedExtentions.toList());
config.set(GraphDatabaseSettings.store_internal_log_path, internalLogFile.toAbsolutePath());
var certificates = serverFolder.resolve("certificates");
if (disabledServer) {
config.set(HttpConnector.enabled, false);
config.set(HttpsConnector.enabled, false);
}
Config dbConfig = config.build();
if (dbConfig.get(HttpsConnector.enabled) || dbConfig.get(BoltConnector.enabled) && dbConfig.get(BoltConnector.encryption_level) != BoltConnector.EncryptionLevel.DISABLED) {
SelfSignedCertificateFactory.create(certificates);
List<SslPolicyConfig> policies = List.of(SslPolicyConfig.forScope(HTTPS), SslPolicyConfig.forScope(BOLT));
for (SslPolicyConfig policy : policies) {
config.set(policy.enabled, Boolean.TRUE);
config.set(policy.base_directory, certificates);
config.set(policy.trust_all, true);
config.set(policy.client_auth, ClientAuth.NONE);
}
dbConfig = config.build();
}
Neo4jLoggerContext loggerContext = LogConfig.createBuilder(new DefaultFileSystemAbstraction(), userLogFile, Level.INFO).withTimezone(dbConfig.get(db_timezone)).build();
var userLogProvider = new Log4jLogProvider(loggerContext);
GraphDatabaseDependencies dependencies = GraphDatabaseDependencies.newDependencies().userLogProvider(userLogProvider);
dependencies = dependencies.extensions(buildExtensionList(dependencies));
var managementService = createNeo(dbConfig, dependencies);
InProcessNeo4j controls = new InProcessNeo4j(serverFolder, userLogFile, internalLogFile, managementService, dbConfig, userLogProvider);
controls.start();
try {
fixtures.applyTo(controls);
} catch (Exception e) {
controls.close();
throw e;
}
return controls;
}
Aggregations