org.neo4j.graphdb.schema
Interface Schema

All Known Implementing Classes:
SchemaImpl

public interface Schema

Interface for managing the schema of your graph database. This currently includes the new indexing support, added in Neo4j 2.0, please see the Neo4j manual for details.


Nested Class Summary
static class Schema.IndexState
          The states that an index can be in.
 
Method Summary
 void awaitIndexOnline(IndexDefinition index, long duration, TimeUnit unit)
          Wait until an index comes online
 ResourceIterable<IndexDefinition> getIndexes()
           
 ResourceIterable<IndexDefinition> getIndexes(Label label)
           
 Schema.IndexState getIndexState(IndexDefinition index)
          Poll the database for the state of a given index.
 IndexCreator indexCreator(Label label)
          Returns an IndexCreator where details about the index to create can be specified.
 

Method Detail

indexCreator

IndexCreator indexCreator(Label label)
Returns an IndexCreator where details about the index to create can be specified. When all details have been entered create must be called for it to actually be created. Creating an index enables indexing for nodes with the specified label. The index will have the details supplied to the returned index creator. All existing and all future nodes matching the index definition will be indexed, speeding up future operations.

Returns:
an IndexCreator capable of providing details for, as well as creating an index for the given label.

getIndexes

ResourceIterable<IndexDefinition> getIndexes(Label label)
Parameters:
label - the Label to get indexes for.
Returns:
all indexes attached to the given label.

getIndexes

ResourceIterable<IndexDefinition> getIndexes()
Returns:
all indexes in this database.

getIndexState

Schema.IndexState getIndexState(IndexDefinition index)
Poll the database for the state of a given index. This can be used to track when, during creation of a new index, an index is done populating itself and comes online to serve requests.

Parameters:
index - the index that we want to poll state for
Returns:
the current Schema.IndexState of the index

awaitIndexOnline

void awaitIndexOnline(IndexDefinition index,
                      long duration,
                      TimeUnit unit)
Wait until an index comes online

Parameters:
index - the index that we want to wait for
duration - duration to wait for the index to come online
unit - TimeUnit of duration
Throws:
IllegalStateException - if the index did not enter the ONLINE state within the given duration or if the index entered the FAILED state


Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.