org.neo4j.tooling.wrap
Class WrappedGraphDatabase

java.lang.Object
  extended by org.neo4j.kernel.AbstractGraphDatabase
      extended by org.neo4j.tooling.wrap.WrappedGraphDatabase
All Implemented Interfaces:
GraphDatabaseService

public abstract class WrappedGraphDatabase
extends AbstractGraphDatabase


Field Summary
protected  GraphDatabaseService graphdb
           
 
Fields inherited from class org.neo4j.kernel.AbstractGraphDatabase
caches
 
Constructor Summary
WrappedGraphDatabase(GraphDatabaseService graphdb)
           
 
Method Summary
protected  WrappedIndex.WrappedNodeIndex automaticNodeIndex(ReadableIndex<Node> index)
           
protected  WrappedIndex.WrappedRelationshipIndex automaticRelationshipIndex(ReadableRelationshipIndex index)
           
 Transaction beginTx()
          Starts a new transaction and associates it with the current thread.
protected  void close()
           
 Node createNode()
          Creates a new node.
protected  org.neo4j.kernel.impl.util.StringLogger createStringLogger()
           
 boolean equals(Object obj)
           
 Iterable<Node> getAllNodes()
          Returns all nodes in the graph.
 Config getConfig()
           
 KernelData getKernelData()
           
<T> Collection<T>
getManagementBeans(Class<T> type)
           
 Node getNodeById(long id)
          Looks up a node by id.
 Node getReferenceNode()
          Returns the reference node, which is a "starting point" in the node space.
 Relationship getRelationshipById(long id)
          Looks up a relationship by id.
 Iterable<RelationshipType> getRelationshipTypes()
          Returns all relationship types currently in the underlying store.
 int hashCode()
           
 IndexManager index()
          Returns the IndexManager paired with this graph database service and is the entry point for managing indexes coupled with this database.
protected  Lock lock(Lock lock)
           
protected abstract  WrappedNode<? extends WrappedGraphDatabase> node(Node node, boolean created)
           
protected  WrappedIndex.WrappedNodeIndex nodeIndex(Index<Node> index, String indexName)
           
protected  void onBeginTransaction()
           
protected  void onFailureTransaction()
           
protected  void onFinishTransaction()
           
protected  void onNodeCreate()
           
protected  void onShutdown()
           
protected  void onSuccessTransaction()
           
 KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
          Registers handler as a handler for kernel events which are generated from different places in the lifecycle of the kernel.
<T> TransactionEventHandler<T>
registerTransactionEventHandler(TransactionEventHandler<T> handler)
          Registers handler as a handler for transaction events which are generated from different places in the lifecycle of each transaction.
protected abstract  WrappedRelationship<? extends WrappedGraphDatabase> relationship(Relationship relationship, boolean created)
           
protected  WrappedIndex.WrappedRelationshipIndex relationshipIndex(RelationshipIndex index, String indexName)
           
 String toString()
           
 TransactionBuilder tx()
          Returns a new builder where some aspects of the behavior can be configured.
 KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
          Unregisters handler from the list of kernel event handlers.
<T> TransactionEventHandler<T>
unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
          Unregisters handler from the list of transaction event handlers.
 
Methods inherited from class org.neo4j.kernel.AbstractGraphDatabase
createCaches, getManagementBean, getMessageLog, getSingleManagementBean, getStoreDir, isEphemeral, shutdown
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

graphdb

protected final GraphDatabaseService graphdb
Constructor Detail

WrappedGraphDatabase

public WrappedGraphDatabase(GraphDatabaseService graphdb)
Method Detail

createStringLogger

protected org.neo4j.kernel.impl.util.StringLogger createStringLogger()
Overrides:
createStringLogger in class AbstractGraphDatabase

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

toString

public final String toString()
Overrides:
toString in class AbstractGraphDatabase

node

protected abstract WrappedNode<? extends WrappedGraphDatabase> node(Node node,
                                                                    boolean created)

relationship

protected abstract WrappedRelationship<? extends WrappedGraphDatabase> relationship(Relationship relationship,
                                                                                    boolean created)

lock

protected Lock lock(Lock lock)

nodeIndex

protected WrappedIndex.WrappedNodeIndex nodeIndex(Index<Node> index,
                                                  String indexName)

relationshipIndex

protected WrappedIndex.WrappedRelationshipIndex relationshipIndex(RelationshipIndex index,
                                                                  String indexName)

automaticNodeIndex

protected WrappedIndex.WrappedNodeIndex automaticNodeIndex(ReadableIndex<Node> index)

automaticRelationshipIndex

protected WrappedIndex.WrappedRelationshipIndex automaticRelationshipIndex(ReadableRelationshipIndex index)

onBeginTransaction

protected void onBeginTransaction()
                           throws TransactionNotAllowedException
Throws:
TransactionNotAllowedException

onSuccessTransaction

protected void onSuccessTransaction()

onFailureTransaction

protected void onFailureTransaction()

onFinishTransaction

protected void onFinishTransaction()

onNodeCreate

protected void onNodeCreate()

onShutdown

protected void onShutdown()

beginTx

public final Transaction beginTx()
Description copied from interface: GraphDatabaseService
Starts a new transaction and associates it with the current thread.

Specified by:
beginTx in interface GraphDatabaseService
Overrides:
beginTx in class AbstractGraphDatabase
Returns:
a new transaction instance

createNode

public final Node createNode()
Description copied from interface: GraphDatabaseService
Creates a new node.

Returns:
the created node.

getNodeById

public final Node getNodeById(long id)
Description copied from interface: GraphDatabaseService
Looks up a node by id.

Parameters:
id - the id of the node
Returns:
the node with id id if found

getRelationshipById

public final Relationship getRelationshipById(long id)
Description copied from interface: GraphDatabaseService
Looks up a relationship by id.

Parameters:
id - the id of the relationship
Returns:
the relationship with id id if found

getReferenceNode

public final Node getReferenceNode()
Description copied from interface: GraphDatabaseService
Returns the reference node, which is a "starting point" in the node space. Usually, a client attaches relationships to this node that leads into various parts of the node space. For more information about common node space organizational patterns, see the design guide at wiki.neo4j.org/content/Design_Guide.

Returns:
the reference node

getAllNodes

public final Iterable<Node> getAllNodes()
Description copied from interface: GraphDatabaseService
Returns all nodes in the graph.

Specified by:
getAllNodes in interface GraphDatabaseService
Overrides:
getAllNodes in class AbstractGraphDatabase
Returns:
all nodes in the graph.

getRelationshipTypes

public final Iterable<RelationshipType> getRelationshipTypes()
Description copied from interface: GraphDatabaseService
Returns all relationship types currently in the underlying store. Relationship types are added to the underlying store the first time they are used in a successfully commited node.createRelationshipTo(...). Note that this method is guaranteed to return all known relationship types, but it does not guarantee that it won't return more than that (e.g. it can return "historic" relationship types that no longer have any relationships in the node space).

Specified by:
getRelationshipTypes in interface GraphDatabaseService
Overrides:
getRelationshipTypes in class AbstractGraphDatabase
Returns:
all relationship types in the underlying store

close

protected final void close()
Specified by:
close in class AbstractGraphDatabase

registerTransactionEventHandler

public <T> TransactionEventHandler<T> registerTransactionEventHandler(TransactionEventHandler<T> handler)
Description copied from interface: GraphDatabaseService
Registers handler as a handler for transaction events which are generated from different places in the lifecycle of each transaction. To guarantee that the handler gets all events properly it shouldn't be registered when the application is running (i.e. in the middle of one or more transactions). If the specified handler instance has already been registered this method will do nothing.

Type Parameters:
T - the type of state object used in the handler, see more documentation about it at TransactionEventHandler.
Parameters:
handler - the handler to receive events about different states in transaction lifecycles.
Returns:
the handler passed in as the argument.

unregisterTransactionEventHandler

public <T> TransactionEventHandler<T> unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
Description copied from interface: GraphDatabaseService
Unregisters handler from the list of transaction event handlers. If handler hasn't been registered with GraphDatabaseService.registerTransactionEventHandler(TransactionEventHandler) prior to calling this method an IllegalStateException will be thrown. After a successful call to this method the handler will no longer receive any transaction events.

Type Parameters:
T - the type of state object used in the handler, see more documentation about it at TransactionEventHandler.
Parameters:
handler - the handler to receive events about different states in transaction lifecycles.
Returns:
the handler passed in as the argument.

registerKernelEventHandler

public KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
Description copied from interface: GraphDatabaseService
Registers handler as a handler for kernel events which are generated from different places in the lifecycle of the kernel. To guarantee proper behaviour the handler should be registered right after the graph database has been started. If the specified handler instance has already been registered this method will do nothing.

Parameters:
handler - the handler to receive events about different states in the kernel lifecycle.
Returns:
the handler passed in as the argument.

unregisterKernelEventHandler

public KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
Description copied from interface: GraphDatabaseService
Unregisters handler from the list of kernel event handlers. If handler hasn't been registered with GraphDatabaseService.registerKernelEventHandler(KernelEventHandler) prior to calling this method an IllegalStateException will be thrown. After a successful call to this method the handler will no longer receive any kernel events.

Parameters:
handler - the handler to receive events about different states in the kernel lifecycle.
Returns:
the handler passed in as the argument.

index

public IndexManager index()
Description copied from interface: GraphDatabaseService
Returns the IndexManager paired with this graph database service and is the entry point for managing indexes coupled with this database.

Returns:
the IndexManager for this database.

tx

public TransactionBuilder tx()
Description copied from class: AbstractGraphDatabase
Returns a new builder where some aspects of the behavior can be configured. The transaction will ultimately begin when calling TransactionBuilder.begin().

Specified by:
tx in class AbstractGraphDatabase
Returns:
a builder for configuring transaction behavior and ultimately begin a transaction.

getConfig

public Config getConfig()
Specified by:
getConfig in class AbstractGraphDatabase

getManagementBeans

public <T> Collection<T> getManagementBeans(Class<T> type)
Specified by:
getManagementBeans in class AbstractGraphDatabase

getKernelData

public KernelData getKernelData()
Specified by:
getKernelData in class AbstractGraphDatabase


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.