|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.neo4j.api.core.EmbeddedNeo
public final class EmbeddedNeo
An implementation of NeoService that is used to embed Neo in an
application. You typically instantiate it by invoking the
single argument constructor that takes a path to
a directory where Neo will store its data files, as such:
For more information, see
NeoService neo = new EmbeddedNeo( "var/neo" );
// ... use neo
neo.shutdown();
NeoService.
| Field Summary | |
|---|---|
static String |
DEFAULT_SHELL_NAME
|
static int |
DEFAULT_SHELL_PORT
|
| Constructor Summary | |
|---|---|
EmbeddedNeo(String storeDir)
Creates an embedded NeoService with a store located in
storeDir, which will be created if it doesn't already
exist. |
|
EmbeddedNeo(String storeDir,
Map<String,String> params)
A non-standard way of creating an embedded NeoService
with a set of configuration parameters. |
|
| Method Summary | |
|---|---|
Transaction |
beginTx()
Starts a new transaction. |
Node |
createNode()
Creates a new node. |
boolean |
enableRemoteShell()
Enables remote shell access (with default configuration) to this Neo instance, if the Neo4j shell component is available on the
classpath. |
boolean |
enableRemoteShell(Map<String,Serializable> initialProperties)
Enables remote shell access to this Neo instance, if the Neo4j shell component is available on the classpath. |
NeoJvmInstance.Config |
getConfig()
Returns a non-standard configuration object. |
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()
Deprecated. Might not be needed now that relationship types are created dynamically. |
static Map<String,String> |
loadConfigurations(String file)
A non-standard Convenience method that loads a standard property file and converts it into a generic Map. |
void |
shutdown()
Shuts down Neo. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_SHELL_PORT
public static final String DEFAULT_SHELL_NAME
| Constructor Detail |
|---|
public EmbeddedNeo(String storeDir)
NeoService with a store located in
storeDir, which will be created if it doesn't already
exist.
storeDir - the store directory for the neo db files
public EmbeddedNeo(String storeDir,
Map<String,String> params)
NeoService
with a set of configuration parameters. Will most likely be removed in
future releases.
storeDir - the store directory for the db filesparams - configuration parameters| Method Detail |
|---|
public static Map<String,String> loadConfigurations(String file)
Map. Will most
likely be removed in future releases.
file - the property file to load
public Node createNode()
NeoService
createNode in interface NeoServicepublic Node getNodeById(long id)
NeoService
getNodeById in interface NeoServiceid - the id of the node
id if foundpublic Relationship getRelationshipById(long id)
NeoService
getRelationshipById in interface NeoServiceid - the id of the relationship
id if foundpublic Node getReferenceNode()
NeoService
getReferenceNode in interface NeoServicepublic void shutdown()
NeoService
shutdown in interface NeoServicepublic boolean enableRemoteShell()
NeoServiceshell component is available on the
classpath. This method is identical to invoking
enableRemoteShell( null ).
enableRemoteShell in interface NeoServicetrue if the shell has been enabled,
false otherwise (false usually indicates that
the shell jar dependency is not on the classpath)public boolean enableRemoteShell(Map<String,Serializable> initialProperties)
NeoServiceshell component is available on the classpath. This will
publish a shell access interface on an RMI registry on localhost (with
configurable port and RMI binding name). It can be accessed by a
client that implements org.neo4j.util.shell.ShellClient
from the Neo4J shell project. Typically, the
neoshell binary package is used (see
neo4j.org/download).
The shell is parameterized by a map of properties passed in to this method. Currently, two properties are used:
port, an Integer describing the port of the RMI
registry where the Neo shell will be bound, defaults to 1337
name, the String under which the Neo shell will
be bound in the RMI registry, defaults to neoshell
enableRemoteShell in interface NeoServiceinitialProperties - a set of properties that will be used to
configure the remote shell, or null if the default
properties should be used
true if the shell has been enabled,
false otherwise (false usually indicates that
the shell jar dependency is not on the classpath)public Iterable<RelationshipType> getRelationshipTypes()
created dynamically.
Node.createRelationshipTo(org.neo4j.api.core.Node, org.neo4j.api.core.RelationshipType).
public Transaction beginTx()
NeoService
beginTx in interface NeoServicepublic NeoJvmInstance.Config getConfig()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||