org.apache.shiro.session.mgt.eis
Class RandomSessionIdGenerator

java.lang.Object
  extended by org.apache.shiro.session.mgt.eis.RandomSessionIdGenerator
All Implemented Interfaces:
SessionIdGenerator

public class RandomSessionIdGenerator
extends Object
implements SessionIdGenerator

Generates session IDs by using a Random instance to generate random IDs. The default Random implementation is a SecureRandom with the SHA1PRNG algorithm.

Since:
1.0

Constructor Summary
RandomSessionIdGenerator()
           
 
Method Summary
 Serializable generateId(Session session)
          Returns the String value of the configured Random's nextLong() invocation.
 Random getRandom()
           
 void setRandom(Random random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomSessionIdGenerator

public RandomSessionIdGenerator()
Method Detail

getRandom

public Random getRandom()

setRandom

public void setRandom(Random random)

generateId

public Serializable generateId(Session session)
Returns the String value of the configured Random's nextLong() invocation.

Specified by:
generateId in interface SessionIdGenerator
Parameters:
session - the Session instance to which the ID will be applied.
Returns:
the String value of the configured Random's Random.nextLong() invocation.


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.