deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.io.datastore.idgenerator
Class IdGenerator

java.lang.Object
  extended by org.deegree.io.datastore.idgenerator.IdGenerator
Direct Known Subclasses:
DBMaxIdGenerator, DBSeqIdGenerator, ParentIDGenerator, UUIDGenerator

public abstract class IdGenerator
extends Object

Abstract base class for generators that are used to create primary keys (especially FeatureIds).

Version:
$Revision: 9342 $, $Date: 2007-12-27 13:32:57 +0100 (Do, 27 Dez 2007) $
Author:
Markus Schneider , last edited by: $Author: apoth $

Field Summary
protected  MappedFeatureType ft
           
protected  Properties params
           
static String TYPE_UUID
          Default generator type based on UUIDs.
 
Constructor Summary
protected IdGenerator(Properties params)
          Creates a new IdGenerator instance.
 
Method Summary
static IdGenerator getInstance(String type, Properties params)
          Returns a concrete IdGenerator instance which is identified by the given type code.
abstract  Object getNewId(DatastoreTransaction ta)
          Returns a new primary key.
abstract  FeatureId getNewId(MappedFeatureType ft, DatastoreTransaction ta)
          Returns a new id for a feature of the given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_UUID

public static String TYPE_UUID
Default generator type based on UUIDs.


params

protected Properties params

ft

protected MappedFeatureType ft
Constructor Detail

IdGenerator

protected IdGenerator(Properties params)
Creates a new IdGenerator instance.

Parameters:
params - configuration parameters
Method Detail

getNewId

public abstract Object getNewId(DatastoreTransaction ta)
                         throws IdGenerationException
Returns a new primary key.

Parameters:
ta - datastore transaction (context)
Returns:
a new primary key.
Throws:
IdGenerationException - if the generation of the id could not be performed

getNewId

public abstract FeatureId getNewId(MappedFeatureType ft,
                                   DatastoreTransaction ta)
                            throws IdGenerationException
Returns a new id for a feature of the given type.

Parameters:
ft - feature type
ta - datastore transaction (context)
Returns:
a new feature id.
Throws:
IdGenerationException

getInstance

public static final IdGenerator getInstance(String type,
                                            Properties params)
Returns a concrete IdGenerator instance which is identified by the given type code.

Parameters:
type - type code
params - initialization parameters for the IdGenerator
Returns:
concrete IdGenerator instance

deegree 2.2 (2008/12/22 11:33 build-3038-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net