deegree 2.5 (2011/06/29 09:44 build-8-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 java.lang.Object

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

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Field Summary
protected  MappedFeatureType ft
          MappedFeatureType that this generator is bound to.
protected  java.util.Properties params
          Configuration properties.
static java.lang.String TYPE_UUID
          Default generator type based on UUIDs.
 
Constructor Summary
protected IdGenerator(java.util.Properties params)
          Creates a new IdGenerator instance.
 
Method Summary
static IdGenerator getInstance(java.lang.String type, java.util.Properties params)
          Returns a concrete IdGenerator instance which is identified by the given type code.
abstract  java.lang.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 java.lang.String TYPE_UUID
Default generator type based on UUIDs.


params

protected java.util.Properties params
Configuration properties.


ft

protected MappedFeatureType ft
MappedFeatureType that this generator is bound to.

Constructor Detail

IdGenerator

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

Parameters:
params - configuration parameters
Method Detail

getNewId

public abstract java.lang.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(java.lang.String type,
                                            java.util.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.5 (2011/06/29 09:44 build-8-official)

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