NeoService
Keywords: org.neo4j.api.core.NeoService interface

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.neo4j.api.core
Interface NeoService

All Known Implementing Classes:
  EmbeddedNeo

    public interface NeoService

The main access point to a running Neo instance. The only implementation today is the `EmbeddedNeo` class, which is used to embed Neo intra-VM in an application. Typically, you would create an `EmbeddedNeo` once and from then on access it through the `NeoService` interface. For more information, see the class documentation of `EmbeddedNeo`.

Method Summary
`RelationshipType` | `createAndRegisterRelationshipType(java.lang.String name)`
`Node` | `createNode()` Creates a `Node`.
`boolean` | `enableRemoteShell()` Enables remote shell access to this Neo instance, if the Neo4j `shell` project is available on the classpath.
`boolean` | `enableRemoteShell(java.util.Map<java.lang.String,java.io.Serializable> initialProperties)` Enables remote shell access to this Neo instance, if the Neo4j `shell` project is available on the classpath.
`Node` | `getNodeById(long id)` Looks up a node by id.
`Node` | `getReferenceNode()` Returns the reference node.
`RelationshipType` | `getRelationshipType(java.lang.String name)`
`java.lang.Iterable<RelationshipType>` | `getRelationshipTypes()`
`boolean` | `hasRelationshipType(java.lang.String name)`
`void` | `registerEnumRelationshipTypes(java.lang.Class<? extends RelationshipType> relationshipTypes)`
`RelationshipType` | `registerRelationshipType(java.lang.String name)`
`void` | `registerRelationshipTypes(java.lang.Iterable<RelationshipType> types)`
`void` | `registerRelationshipTypes(RelationshipType[] types)`
`void` | `shutdown()` Shuts down Neo.

Method Detail

### createNode

    Node createNode()

  Creates a `Node`.

  Returns:
    the created node.

### getNodeById

    Node getNodeById(long id)

  Looks up a node by id.

  Parameters:
    `id` - the id of the node
  Returns:
    the node with id `id` if found
  Throws:
    `java.lang.RuntimeException` - if not found

### getReferenceNode

    Node getReferenceNode()

  Returns the reference node.

  Returns:
    the reference node
  Throws:
    `java.lang.RuntimeException` - if unable to get the reference node

### shutdown

    void shutdown()

  Shuts down Neo. After this method has been invoked, it's invalid to invoke any methods in the Neo API.

### enableRemoteShell

    boolean enableRemoteShell()

  Enables remote shell access to this Neo instance, if the Neo4j `shell` project is available on the classpath. This method passed no configuration parameters and is identical to invoking `enableRemoteShell( null )`.

  Returns:
    `true` if the shell has been enabled, `false` otherwise (`false` usually indicates that the `shell` jar dependency is not on the classpath)

### enableRemoteShell

    boolean enableRemoteShell(java.util.Map<java.lang.String,java.io.Serializable> initialProperties)

  Enables remote shell access to this Neo instance, if the Neo4j `shell` project 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`

  Parameters:
    `initialProperties` - a set of properties that will be used to configure the remote shell, or `null` if the default properties should be used
  Returns:
    `true` if the shell has been enabled, `false` otherwise (`false` usually indicates that the `shell` jar dependency is not on the classpath)
  Throws:
    `java.lang.ClassCastException` - if the shell library is available, but one (or more) of the configuration properties have an unexpected type
    `java.lang.IllegalStateException` - if the shell library is available, but the remote shell can't be enabled anyway

### registerEnumRelationshipTypes

    void registerEnumRelationshipTypes(java.lang.Class<? extends RelationshipType> relationshipTypes)

### getRelationshipTypes

    java.lang.Iterable<RelationshipType> getRelationshipTypes()

### getRelationshipType

    RelationshipType getRelationshipType(java.lang.String name)

### hasRelationshipType

    boolean hasRelationshipType(java.lang.String name)

### createAndRegisterRelationshipType

    RelationshipType createAndRegisterRelationshipType(java.lang.String name)

### registerRelationshipType

    RelationshipType registerRelationshipType(java.lang.String name)

### registerRelationshipTypes

    void registerRelationshipTypes(java.lang.Iterable<RelationshipType> types)

### registerRelationshipTypes

    void registerRelationshipTypes(RelationshipType[] types)

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD