|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface NeoService
The main access point to a running Neo instance. The only current
implementation is the EmbeddedNeo class, which is used to
embed Neo in an application. Typically, you would create an
EmbeddedNeo instance as follows:
NeoService provides operations to NeoService neo = new EmbeddedNeo( "var/neo" );
// ... use neo
neo.shutdown();
enable the shell,
create nodes, get nodes
given an id, get the reference node and
ultimately shutdown Neo.
Please note that all operations that read or write to the node space must be
invoked in a transactional context.
| Method Summary | |
|---|---|
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. |
void |
shutdown()
Shuts down Neo. |
| Method Detail |
|---|
Node createNode()
Node getNodeById(long id)
id - the id of the node
id if found
RuntimeException - if not foundNode getReferenceNode()
RuntimeException - if unable to get the reference nodevoid shutdown()
boolean enableRemoteShell()
shell component is available on the
classpath. This method is identical to invoking
enableRemoteShell( null ).
true if the shell has been enabled,
false otherwise (false usually indicates that
the shell jar dependency is not on the classpath)boolean enableRemoteShell(Map<String,Serializable> initialProperties)
shell 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
initialProperties - 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)
ClassCastException - if the shell library is available, but one
(or more) of the configuration properties have an unexpected type
IllegalStateException - if the shell library is available, but
the remote shell can't be enabled anyway
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||