Package org.apache.shiro.session.mgt.eis
Class RandomSessionIdGenerator
- java.lang.Object
-
- org.apache.shiro.session.mgt.eis.RandomSessionIdGenerator
-
- All Implemented Interfaces:
SessionIdGenerator
public class RandomSessionIdGenerator extends Object implements SessionIdGenerator
Generates session IDs by using aRandominstance to generate random IDs. The defaultRandomimplementation is aSecureRandomwith theSHA1PRNGalgorithm.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description RandomSessionIdGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SerializablegenerateId(Session session)Returns the String value of the configuredRandom'snextLong()invocation.RandomgetRandom()voidsetRandom(Random random)
-
-
-
Method Detail
-
getRandom
public Random getRandom()
-
setRandom
public void setRandom(Random random)
-
generateId
public Serializable generateId(Session session)
Returns the String value of the configuredRandom'snextLong()invocation.- Specified by:
generateIdin interfaceSessionIdGenerator- Parameters:
session- theSessioninstance to which the ID will be applied.- Returns:
- the String value of the configured
Random'sRandom.nextLong()invocation.
-
-