Search in sources :

Example 1 with ConfigAdapter

use of org.neo4j.server.plugins.ConfigAdapter in project neo4j by neo4j.

the class RestfulGraphDatabaseTest method doBefore.

@BeforeClass
public static void doBefore() throws IOException {
    graph = (GraphDatabaseFacade) new TestGraphDatabaseFactory().newImpermanentDatabase();
    database = new WrappedDatabase(graph);
    helper = new GraphDbHelper(database);
    output = new EntityOutputFormat(new JsonFormat(), URI.create(BASE_URI), null);
    service = new TransactionWrappingRestfulGraphDatabase(graph, new RestfulGraphDatabase(new JsonFormat(), output, new DatabaseActions(new LeaseManager(Clocks.fakeClock()), true, database.getGraph()), new ConfigAdapter(Config.embeddedDefaults())));
}
Also used : GraphDbHelper(org.neo4j.server.rest.domain.GraphDbHelper) JsonFormat(org.neo4j.server.rest.repr.formats.JsonFormat) LeaseManager(org.neo4j.server.rest.paging.LeaseManager) ConfigAdapter(org.neo4j.server.plugins.ConfigAdapter) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) WrappedDatabase(org.neo4j.server.database.WrappedDatabase) EntityOutputFormat(org.neo4j.test.server.EntityOutputFormat) BeforeClass(org.junit.BeforeClass)

Example 2 with ConfigAdapter

use of org.neo4j.server.plugins.ConfigAdapter in project neo4j by neo4j.

the class ExtensionInitializer method initializePackages.

public Collection<Injectable<?>> initializePackages(Iterable<String> packageNames) {
    GraphDatabaseAPI graphDatabaseService = neoServer.getDatabase().getGraph();
    Config configuration = neoServer.getConfig();
    Collection<Injectable<?>> injectables = new HashSet<>();
    for (PluginLifecycle lifecycle : lifecycles) {
        if (hasPackage(lifecycle, packageNames)) {
            if (lifecycle instanceof SPIPluginLifecycle) {
                SPIPluginLifecycle lifeCycleSpi = (SPIPluginLifecycle) lifecycle;
                injectables.addAll(lifeCycleSpi.start(neoServer));
            } else {
                injectables.addAll(lifecycle.start(graphDatabaseService, new ConfigAdapter(configuration)));
            }
        }
    }
    return injectables;
}
Also used : Injectable(org.neo4j.server.plugins.Injectable) SPIPluginLifecycle(org.neo4j.server.plugins.SPIPluginLifecycle) PluginLifecycle(org.neo4j.server.plugins.PluginLifecycle) GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) ConfigAdapter(org.neo4j.server.plugins.ConfigAdapter) Config(org.neo4j.kernel.configuration.Config) SPIPluginLifecycle(org.neo4j.server.plugins.SPIPluginLifecycle) HashSet(java.util.HashSet)

Example 3 with ConfigAdapter

use of org.neo4j.server.plugins.ConfigAdapter in project neo4j by neo4j.

the class AbstractNeoServer method createDefaultInjectables.

protected Collection<InjectableProvider<?>> createDefaultInjectables() {
    Collection<InjectableProvider<?>> singletons = new ArrayList<>();
    Database database = getDatabase();
    singletons.add(new DatabaseProvider(database));
    singletons.add(new DatabaseActions.Provider(databaseActions));
    singletons.add(new GraphDatabaseServiceProvider(database));
    singletons.add(new NeoServerProvider(this));
    singletons.add(providerForSingleton(new ConfigAdapter(getConfig()), Configuration.class));
    singletons.add(providerForSingleton(getConfig(), Config.class));
    singletons.add(new WebServerProvider(getWebServer()));
    PluginInvocatorProvider pluginInvocatorProvider = new PluginInvocatorProvider(this);
    singletons.add(pluginInvocatorProvider);
    RepresentationFormatRepository repository = new RepresentationFormatRepository(this);
    singletons.add(new InputFormatProvider(repository));
    singletons.add(new OutputFormatProvider(repository));
    singletons.add(new CypherExecutorProvider(cypherExecutor));
    singletons.add(providerForSingleton(transactionFacade, TransactionFacade.class));
    singletons.add(providerFromSupplier(authManagerSupplier, AuthManager.class));
    singletons.add(providerFromSupplier(userManagerSupplier, UserManagerSupplier.class));
    singletons.add(new TransactionFilter(database));
    singletons.add(new LoggingProvider(logProvider));
    singletons.add(providerForSingleton(logProvider.getLog(NeoServer.class), Log.class));
    singletons.add(providerForSingleton(resolveDependency(UsageData.class), UsageData.class));
    return singletons;
}
Also used : DatabaseProvider(org.neo4j.server.database.DatabaseProvider) PluginInvocatorProvider(org.neo4j.server.plugins.PluginInvocatorProvider) TransactionFilter(org.neo4j.server.rest.transactional.TransactionFilter) CypherExecutorProvider(org.neo4j.server.database.CypherExecutorProvider) Configuration(org.apache.commons.configuration.Configuration) UsageData(org.neo4j.udc.UsageData) Config(org.neo4j.kernel.configuration.Config) ArrayList(java.util.ArrayList) UserManagerSupplier(org.neo4j.kernel.api.security.UserManagerSupplier) DatabaseActions(org.neo4j.server.rest.web.DatabaseActions) Database(org.neo4j.server.database.Database) InjectableProvider(org.neo4j.server.database.InjectableProvider) OutputFormatProvider(org.neo4j.server.rest.repr.OutputFormatProvider) InputFormatProvider(org.neo4j.server.rest.repr.InputFormatProvider) ConfigAdapter(org.neo4j.server.plugins.ConfigAdapter) AuthManager(org.neo4j.kernel.api.security.AuthManager) Log(org.neo4j.logging.Log) AsyncRequestLog(org.neo4j.server.web.AsyncRequestLog) TransactionFacade(org.neo4j.server.rest.transactional.TransactionFacade) GraphDatabaseServiceProvider(org.neo4j.server.database.GraphDatabaseServiceProvider) RepresentationFormatRepository(org.neo4j.server.rest.repr.RepresentationFormatRepository) WebServerProvider(org.neo4j.server.web.WebServerProvider)

Aggregations

ConfigAdapter (org.neo4j.server.plugins.ConfigAdapter)3 Config (org.neo4j.kernel.configuration.Config)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Configuration (org.apache.commons.configuration.Configuration)1 BeforeClass (org.junit.BeforeClass)1 AuthManager (org.neo4j.kernel.api.security.AuthManager)1 UserManagerSupplier (org.neo4j.kernel.api.security.UserManagerSupplier)1 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)1 Log (org.neo4j.logging.Log)1 CypherExecutorProvider (org.neo4j.server.database.CypherExecutorProvider)1 Database (org.neo4j.server.database.Database)1 DatabaseProvider (org.neo4j.server.database.DatabaseProvider)1 GraphDatabaseServiceProvider (org.neo4j.server.database.GraphDatabaseServiceProvider)1 InjectableProvider (org.neo4j.server.database.InjectableProvider)1 WrappedDatabase (org.neo4j.server.database.WrappedDatabase)1 Injectable (org.neo4j.server.plugins.Injectable)1 PluginInvocatorProvider (org.neo4j.server.plugins.PluginInvocatorProvider)1 PluginLifecycle (org.neo4j.server.plugins.PluginLifecycle)1 SPIPluginLifecycle (org.neo4j.server.plugins.SPIPluginLifecycle)1