Interface SessionIdGenerator

  • All Known Implementing Classes:
    JavaUuidSessionIdGenerator, RandomSessionIdGenerator

    public interface SessionIdGenerator
    Interface allowing pluggable session ID generation strategies to be used with various SessionDAO implementations.


    SessionIdGenerators are usually only used when ID generation is separate from creating the Session record in the EIS data store. Some EIS data stores, such as relational databases, can generate the id at the same time the record is created, such as when using auto-generated primary keys. In these cases, a SessionIdGenerator does not need to be configured.

    However, if you want to customize how session IDs are created before persisting the Session record into the data store, you can implement this interface and typically inject it into an AbstractSessionDAO instance.

    See Also:
    JavaUuidSessionIdGenerator, RandomSessionIdGenerator
    • Method Detail

      • generateId

        Serializable generateId​(Session session)
        Generates a new ID to be applied to the specified Session instance.
        session - the Session instance to which the ID will be applied.
        the id to assign to the specified Session instance before adding a record to the EIS data store.