Package org.neo4j.kernel

Examples of org.neo4j.kernel.GraphDatabaseAPI


  /**
   * Start the web server.
   */
  public void start() {
    GraphDatabaseAPI databaseAPI = graphStore.getDatabaseService();
    this.server = new WrappingNeoServer(databaseAPI);
    this.server.start();
  }
View Full Code Here


    /**
     * Start the web server.
     */
    public void start() {
        GraphDatabaseAPI databaseAPI = graphStore.getDatabaseAPI();
        this.server = new WrappingNeoServerBootstrapper(databaseAPI);
        this.server.start();
    }
View Full Code Here

     * Sets the up.
     */
    @Before
    public void setUp() {
        txManager = Mockito.mock(TxManager.class);
        GraphDatabaseAPI graphDatabase = Mockito.mock(GraphDatabaseAPI.class);
        DependencyResolver dependencyResolver = Mockito.mock(DependencyResolver.class);
        Mockito.stub(graphDatabase.getDependencyResolver()).toReturn(dependencyResolver);
        Mockito.stub(dependencyResolver.resolveDependency(TxManager.class)).toReturn(txManager);

        timingStrategy = AdaptiveTimingStrategy
                .defaultConfiguration()
                .withBusyThreshold(10)
View Full Code Here

            tx.close();
        }
    }

    private static void removeNodes(GraphDatabaseService graphDatabaseService, boolean includeReferenceNode) {
        GraphDatabaseAPI api = (GraphDatabaseAPI) graphDatabaseService;
        NodeManager nodeManager = api.getDependencyResolver().resolveDependency(NodeManager.class);
        final GlobalGraphOperations globalGraphOperations = GlobalGraphOperations.at(graphDatabaseService);
        for (Node node : globalGraphOperations.getAllNodes()) {
            for (Relationship rel : node.getRelationships(Direction.OUTGOING)) {
                try {
                    if (nodeManager.isDeleted(rel)) continue;
View Full Code Here

    protected File exportFile;

    @Override
    protected void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
        EmbeddedGraphStore graphStore = (EmbeddedGraphStore) store;
        GraphDatabaseAPI databaseService = graphStore.getDatabaseService();
        File file = BaseProjectResolver.getOutputFile(baseProject, exportFile, EXPORT_FILE);
        getLog().info("Exporting database to '" + file.getAbsolutePath() + "'");
        store.beginTransaction();
        SubGraph graph = DatabaseSubGraph.from(databaseService);
        try {
View Full Code Here

        .newGraphDatabase();
    this.installShutdownHook(graphDb);
    return graphDb;
  }
  public GraphDatabaseService connectHAWrapped(String dir, Map<String, String> haConfig, Map<String, Object> serverProperties) {
    GraphDatabaseAPI graphDb = (GraphDatabaseAPI) this.connectHA(dir, haConfig);

    ServerConfigurator config = new ServerConfigurator( graphDb );
    Iterator<String> iterator = serverProperties.keySet().iterator();
    while(iterator.hasNext()) {
      String key = iterator.next();
View Full Code Here

    new WrappingNeoServerBootstrapper( graphDb, config ).start();

    return graphDb;
  }
  public GraphDatabaseService connectWrapped(String dir, Map<String, String> properties, Map<String, Object> serverProperties) {
    GraphDatabaseAPI graphDb = (GraphDatabaseAPI) this.connect(dir, properties);

    ServerConfigurator config = new ServerConfigurator( graphDb );
    Iterator<String> iterator = serverProperties.keySet().iterator();
    while(iterator.hasNext()) {
      String key = iterator.next();
View Full Code Here

        return null;
    }

    private long execute(CountingReader reader, int batchSize, String relType, boolean diskSpillCache, boolean readLabels, Output out) throws XMLStreamException, IOException {
        try {
            GraphDatabaseAPI db = getServer().getDb();
            ProgressReporter reporter = new ProgressReporter(reader, out);
            XmlGraphMLReader graphMLReader = new XmlGraphMLReader(db)
                    .batchSize(batchSize).relType(relType)
                    .nodeLabels(readLabels)
                    .reporter(reporter);
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.GraphDatabaseAPI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.