org.neo4j.kernel.impl.persistence
Class IdGenerator

java.lang.Object
  extended by org.neo4j.kernel.impl.persistence.IdGenerator
All Implemented Interfaces:
EntityIdGenerator

public class IdGenerator
extends Object
implements EntityIdGenerator

The IdGenerator is responsible for generating unique ids for entities in the kernel. The IdGenerator is configured via the IdGeneratorModule.

The IdGenerator must be loaded after its designated persistence source during startup.


Constructor Summary
IdGenerator()
           
 
Method Summary
 void configure(PersistenceSource source)
          Configures the IdGenerator.
 long getHighestPossibleIdInUse(Class<?> clazz)
           
 long getNumberOfIdsInUse(Class<?> clazz)
           
 long nextId(Class<?> clazz)
          Returns the next unique ID for the entity type represented by clazz.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdGenerator

public IdGenerator()
Method Detail

nextId

public long nextId(Class<?> clazz)
Returns the next unique ID for the entity type represented by clazz.

Specified by:
nextId in interface EntityIdGenerator
Returns:
the next ID for clazz's entity type

getHighestPossibleIdInUse

public long getHighestPossibleIdInUse(Class<?> clazz)
Specified by:
getHighestPossibleIdInUse in interface EntityIdGenerator

getNumberOfIdsInUse

public long getNumberOfIdsInUse(Class<?> clazz)
Specified by:
getNumberOfIdsInUse in interface EntityIdGenerator

configure

public void configure(PersistenceSource source)
Configures the IdGenerator. WARNING: This method should only be invoked once from IdGeneratorModule.start().

Specified by:
configure in interface EntityIdGenerator
Parameters:
source - the persistence source used for id generation


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