com.gisgraphy.domain.repository
Class IdGenerator

java.lang.Object
  extended by com.gisgraphy.domain.repository.IdGenerator
All Implemented Interfaces:
IIdGenerator

@Service
public class IdGenerator
extends Object
implements IIdGenerator

Convenience class to generate if (for openstreetmap, geonames) when they are not provided, in case of custom add. this can be used in multithreading

Author:
David Masclet

Field Summary
static long FEATUREID_INCREMENT_NO_CONFLICT
          shift value to allow the addition of geonames features after import
static long OPENSTREETMAP_GID_NO_CONFLICT
          shift value to allow the addition of openstreetmap features after import
 
Constructor Summary
IdGenerator()
           
 
Method Summary
 long getFeatureId()
           
 long getGid()
           
 long getNextFeatureId()
           
 long getNextGId()
           
 void setGisFeatureDao(IGisFeatureDao gisFeatureDao)
           
 void setOpenStreetMapDao(IOpenStreetMapDao openStreetMapDao)
           
 void sync()
          synchronise the generator with the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATUREID_INCREMENT_NO_CONFLICT

public static final long FEATUREID_INCREMENT_NO_CONFLICT
shift value to allow the addition of geonames features after import

See Also:
Constant Field Values

OPENSTREETMAP_GID_NO_CONFLICT

public static final long OPENSTREETMAP_GID_NO_CONFLICT
shift value to allow the addition of openstreetmap features after import

See Also:
Constant Field Values
Constructor Detail

IdGenerator

public IdGenerator()
Method Detail

getNextFeatureId

public long getNextFeatureId()
Specified by:
getNextFeatureId in interface IIdGenerator

getNextGId

public long getNextGId()
Specified by:
getNextGId in interface IIdGenerator

getFeatureId

public long getFeatureId()
Specified by:
getFeatureId in interface IIdGenerator

getGid

public long getGid()
Specified by:
getGid in interface IIdGenerator

sync

@PostConstruct
public void sync()
Description copied from interface: IIdGenerator
synchronise the generator with the database

Specified by:
sync in interface IIdGenerator

setGisFeatureDao

public void setGisFeatureDao(IGisFeatureDao gisFeatureDao)
Parameters:
gisFeatureDao - the gisFeatureDao to set

setOpenStreetMapDao

public void setOpenStreetMapDao(IOpenStreetMapDao openStreetMapDao)
Parameters:
openStreetMapDao - the openStreetMapDao to set


Copyright © 2012. All Rights Reserved.