com.antelmann.genealogy.db
Class GIDFactory
java.lang.Object
com.antelmann.db.SessionIdGenerator
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
|
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 |
GIDFactory
public GIDFactory(Database<Connection> db)
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