|
|||||||||
| 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:
There's a NeoService neo = new EmbeddedNeo( "var/neo" );
// ... use neo
neo.shutdown();
legacy constructor which
was used in earlier versions to define valid relationship types. Since version 1.0-b6, relationship types
are dynamically created so it's now been marked
deprecated. The same goes for all the relationship type management
operations. Expect them to be removed in future releases.
For more information, see NeoService.
| Constructor Summary | |
|---|---|
EmbeddedNeo(Class<? extends RelationshipType> validRelationshipTypesEnum,
String storeDir)
Deprecated. Not required now that relationship types are created dynamically. Will be removed in next release. |
|
EmbeddedNeo(String storeDir)
Creates an embedded NeoService with a store located in
storeDir, which will be created if it doesn't already exist. |
|
| Method Summary | |
|---|---|
RelationshipType |
createAndRegisterRelationshipType(String name)
Deprecated. Not required now that relationship types are created dynamically. Will be removed in next release. |
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. |
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. |
RelationshipType |
getRelationshipType(String name)
Deprecated. Might not be needed now that relationship types are created dynamically. |
Iterable<RelationshipType> |
getRelationshipTypes()
Deprecated. Might not be needed now that relationship types are created dynamically. |
boolean |
hasRelationshipType(String name)
Deprecated. Not required now that relationship types are created dynamically. Will be removed in next release. |
void |
registerEnumRelationshipTypes(Class<? extends RelationshipType> relationshipTypes)
Deprecated. Not required now that relationship types are created dynamically. Will be removed in next release. |
RelationshipType |
registerRelationshipType(String name)
Deprecated. Not required now that relationship types are created dynamically. Will be removed in next release. |
void |
registerRelationshipTypes(Iterable<RelationshipType> types)
Deprecated. Not required now that relationship types are created dynamically. Will be removed in next release. |
void |
registerRelationshipTypes(RelationshipType[] types)
Deprecated. Not required now that relationship types are created dynamically. Will be removed in next release. |
void |
shutdown()
Shuts down Neo. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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(Class<? extends RelationshipType> validRelationshipTypesEnum,
String storeDir)
created dynamically. Will be removed in next release.
NeoService that uses the store located in
storeDir. This constructor is kept for backwards
compatibility. It accepted an enum which defined a valid set of
relationship types. Relationship types are now dynamically created, so this constructor is deprecated. Invoking it
is identical to invoking EmbeddedNeo(storeDir).
validRelationshipTypesEnum - an enum class containing your
relationship types, as described in the documentation of
RelationshipTypestoreDir - the store directory for the neo db files
NullPointerException - if validRelationshipTypesEnum is
null
IllegalArgumentException - if validRelationshipTypesEnum is not an
enum that implements RelationshipType| Method Detail |
|---|
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 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 RelationshipType getRelationshipType(String name)
created dynamically.
null. A new relationship type is
added to the underlying store the first time a relationship with the
new type is created.
name - the name of the relationship type
null
if there's no such relationship type in the underlying storepublic boolean hasRelationshipType(String name)
created dynamically. Will be removed in next release.
public void registerEnumRelationshipTypes(Class<? extends RelationshipType> relationshipTypes)
created dynamically. Will be removed in next release.
public RelationshipType createAndRegisterRelationshipType(String name)
created dynamically. Will be removed in next release.
public RelationshipType registerRelationshipType(String name)
created dynamically. Will be removed in next release.
public void registerRelationshipTypes(Iterable<RelationshipType> types)
created dynamically. Will be removed in next release.
public void registerRelationshipTypes(RelationshipType[] types)
created dynamically. Will be removed in next release.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||