RemoteIndexService (Neo4j Apoc 1.1 API)
Keywords: org.neo4j.remote.RemoteIndexService class

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

## org.neo4j.remote
Class RemoteIndexService

    java.lang.Object
      org.neo4j.remote.RemoteIndexService

All Implemented Interfaces:
  IndexService

    public final class RemoteIndexService

extends Object
implements IndexService

An implementation of `IndexService` for the client side of `RemoteGraphDatabase`. This requires that `IndexService`s are registered on the server using `BasicGraphDatabaseServer.registerIndexService(String, IndexService)`.

Author:
  Tobias Ivarsson

Constructor Summary
`RemoteIndexService(GraphDatabaseService graphDb, String name)` Create a new client for an `IndexService`.

Method Summary
`IndexHits<Node>` | `getNodes(String key, Object value)` Returns all nodes indexed with `key` and `value`.
`Node` | `getSingleNode(String key, Object value)` Returns a single node indexed with associated with `key` and `value`.
`void` | `index(Node node, String key, Object value)` Index `node` with `key` and `value`.
`void` | `removeIndex(Node node, String key)` Dissociates a node from all indexed values for the given `key`.
`void` | `removeIndex(Node node, String key, Object value)` Dissociates a key-value pair from `node`.
`void` | `removeIndex(String key)` Dissociates all key-value pairs which `key` is part of, i.e.
`void` | `shutdown()` Shuts down the index service.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RemoteIndexService

    public RemoteIndexService(GraphDatabaseService graphDb,
                              String name)

  Create a new client for an `IndexService`.

  Parameters:
    `graphDb` - The `RemoteGraphDatabase` that owns the index.
    `name` - the token that the `IndexService` was registered under on the server (in `BasicGraphDatabaseServer.registerIndexService(String, IndexService)` ).

Method Detail

### shutdown

    public void shutdown()

  Description copied from interface: `IndexService`
  Shuts down the index service. After this method has been invoked any following method invocation on this instance is invalid.

  Specified by:
    `shutdown` in interface `IndexService`

### getNodes

    public IndexHits<Node> getNodes(String key,
                                    Object value)

  Description copied from interface: `IndexService`
  Returns all nodes indexed with `key` and `value`.

  Specified by:
    `getNodes` in interface `IndexService`
  Parameters:
    `key` - the key for index
    `value` - the value for index
  Returns:
    nodes that have been indexed with key and value

### getSingleNode

    public Node getSingleNode(String key,
                              Object value)

  Description copied from interface: `IndexService`
  Returns a single node indexed with associated with `key` and `value`. If no such node exist `null` is returned. If more then one node is found a runtime exception is thrown.

  Specified by:
    `getSingleNode` in interface `IndexService`
  Parameters:
    `key` - the key for index
    `value` - the value for index
  Returns:
    node that has been indexed with key and value or `null`

### index

    public void index(Node node,
                      String key,
                      Object value)

  Description copied from interface: `IndexService`
  Index `node` with `key` and `value`. A node can be associated with any number of key-value pairs.

  Note about updating an index: If you've indexed a value from a property on a `Node` and that value gets updated, you'll have to remove the old value in addition to indexing the new value, else both values (the new and the old) will be indexed for that node.

  When deleting a `Node`, application should remove the index entries for the node as well, to keep the index consistent with the node space.

  Specified by:
    `index` in interface `IndexService`
  Parameters:
    `node` - node to index
    `key` - the key in the key-value pair to associate with `node`.
    `value` - the value in the key-value pair to associate with `node`.

### removeIndex

    public void removeIndex(Node node,
                            String key,
                            Object value)

  Description copied from interface: `IndexService`
  Dissociates a key-value pair from `node`. If no such association exist this method silently returns.

  Specified by:
    `removeIndex` in interface `IndexService`
  Parameters:
    `node` - the node to dissociate from the key-value pair.
    `key` - the key in the key-value pair.
    `value` - the value in the key-value pair.

### removeIndex

    public void removeIndex(Node node,
                            String key)

  Description copied from interface: `IndexService`
  Dissociates a node from all indexed values for the given `key`. If no such association exists this method silently returns. Implementations may choose to not implement this method and should in such a case throw `UnsupportedOperationException`.

  Specified by:
    `removeIndex` in interface `IndexService`
  Parameters:
    `node` - the node to dissociate from all indexed values for the given `key`.
    `key` - the key in the key-value pairs to remove.

### removeIndex

    public void removeIndex(String key)

  Description copied from interface: `IndexService`
  Dissociates all key-value pairs which `key` is part of, i.e. clearing the an entire index `key` is cleared. Implementations may choose to not implement this method and should in such a case throw `UnsupportedOperationException`.

  Specified by:
    `removeIndex` in interface `IndexService`
  Parameters:
    `key` - the index to clear.

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

Copyright © 2010 Neo4j. All Rights Reserved.