Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2002-2016 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package org.neo4j.graphdb;
import java.util.Map;
import org.neo4j.graphdb.event.KernelEventHandler;
import org.neo4j.graphdb.event.TransactionEventHandler;
import org.neo4j.graphdb.index.IndexManager;
import org.neo4j.graphdb.schema.Schema;
import org.neo4j.graphdb.traversal.BidirectionalTraversalDescription;
import org.neo4j.graphdb.traversal.TraversalDescription;
/**
* The main access point to a running Neo4j instance. The most common way to instantiate a {@link GraphDatabaseService}
* is as follows:
*
* GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( "var/graphDb" );
* // ... use Neo4j
* graphDb.{@link #shutdown() shutdown()};
*
*
* GraphDatabaseService provides operations to {@link #createNode() create
* nodes}, {@link #getNodeById(long) get nodes given an id} and ultimately {@link #shutdown()
* shutdown Neo4j}.
*
* Please note that all operations on the graph must be invoked in a
* {@link Transaction transactional context}. Failure to do so will result in a
* {@link NotInTransactionException} being thrown.
*/
public interface GraphDatabaseService
{
/**
* Creates a new node.
*
* @return the created node.
*/
Node createNode();
/**
* Creates a new node and adds the provided labels to it.
*
* @param labels {@link Label labels} to add to the created node.
* @return the created node.
*/
Node createNode( Label... labels );
/**
* Looks up a node by id. Please note: Neo4j reuses its internal ids when
* nodes and relationships are deleted, which means it's bad practice to
* refer to them this way. Instead, use application generated ids.
*
* @param id the id of the node
* @return the node with id id if found
* @throws NotFoundException if not found
*/
Node getNodeById( long id );
/**
* Looks up a relationship by id. Please note: Neo4j reuses its internal ids
* when nodes and relationships are deleted, which means it's bad practice
* to refer to them this way. Instead, use application generated ids.
*
* @param id the id of the relationship
* @return the relationship with id id if found
* @throws NotFoundException if not found
*/
Relationship getRelationshipById( long id );
/**
* Returns all nodes in the graph.
*
* @return all nodes in the graph.
*/
ResourceIterable getAllNodes();
/**
* Returns all relationships in the graph.
*
* @return all relationships in the graph.
*/
ResourceIterable getAllRelationships();
/**
* Returns all nodes having the label, and the wanted property value.
* If an online index is found, it will be used to look up the requested
* nodes.
*
* If no indexes exist for the label/property combination, the database will
* scan all labeled nodes looking for the property value.
*
* Note that equality for values do not follow the rules of Java. This means that the number 42 is equals to all
* other 42 numbers, indifferently of if they are encoded as Integer, Long, Float, Short, Byte or Double.
*
* Same rules follow Character and String - the Character 'A' is equal to the String 'A'.
*
* Finally - arrays also follow these rules. An int[] {1,2,3} is equal to a double[] {1.0, 2.0, 3.0}
*
* Please ensure that the returned {@link ResourceIterator} is closed correctly and as soon as possible
* inside your transaction to avoid potential blocking of write operations.
*
* @param label consider nodes with this label
* @param key required property key
* @param value required property value
* @return an iterator containing all matching nodes. See {@link ResourceIterator} for responsibilities.
*/
ResourceIterator findNodes( Label label, String key, Object value );
/**
* Equivalent to {@link #findNodes(Label, String, Object)}, however it must find no more than one
* {@link Node node} or it will throw an exception.
*
* @param label consider nodes with this label
* @param key required property key
* @param value required property value
* @return the matching node or null if none could be found
* @throws MultipleFoundException if more than one matching {@link Node node} is found
*/
Node findNode( Label label, String key, Object value );
/**
* Returns all {@link Node nodes} with a specific {@link Label label}.
*
* Please take care that the returned {@link ResourceIterator} is closed correctly and as soon as possible
* inside your transaction to avoid potential blocking of write operations.
*
* @param label the {@link Label} to return nodes for.
* @return an iterator containing all nodes matching the label. See {@link ResourceIterator} for responsibilities.
*/
ResourceIterator findNodes( Label label );
/**
* Returns all labels currently in the underlying store. Labels are added to the store the first time
* they are used. This method guarantees that it will return all labels currently in use.
*
* Please take care that the returned {@link ResourceIterable} is closed correctly and as soon as possible
* inside your transaction to avoid potential blocking of write operations.
*
* @return all labels in the underlying store.
*/
ResourceIterable