Holger's
Java API

com.antelmann.genealogy.db
Class GIDFactory

java.lang.Object
  extended by com.antelmann.db.SessionIdGenerator
      extended by com.antelmann.genealogy.db.GIDFactory
All Implemented Interfaces:
IDFactory, Converter<Integer,String>

public class GIDFactory
extends SessionIdGenerator

Since:
31.12.2014, 21:46:14
Author:
holger

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.util.Converter
Converter.Adapter<T1,T2>
 
Constructor Summary
GIDFactory(Database<Connection> db)
           
 
Method Summary
protected  String generateSessionPrefix()
          this method is to access the database to generate a new session prefix on every call and also store it into the database, so that it is guaranteed that no other call ever re-uses this prefix again.
 
Methods inherited from class com.antelmann.db.SessionIdGenerator
convert, convertBack, generateNewID, generateNewID, generateSQLSessionPrefix, getCounter, getDatabase, getRadix, getSessionPrefix, initNewSession, setRadix, setSessionDataManually
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GIDFactory

public GIDFactory(Database<Connection> db)
Method Detail

generateSessionPrefix

protected String generateSessionPrefix()
                                throws DatabaseException
Description copied from class: SessionIdGenerator
this method is to access the database to generate a new session prefix on every call and also store it into the database, so that it is guaranteed that no other call ever re-uses this prefix again. Note that this method must not manage the transaction, as this method is called by initNewSession(), which begins and commits its own transaction; i.e. this method can be savely assumed to run within a synchronized transaction.

Specified by:
generateSessionPrefix in class SessionIdGenerator
Returns:
a new unique session-ID from the database to be used as a prefix for this session
Throws:
DatabaseException
See Also:
SessionIdGenerator.initNewSession()


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads