Class SessionIdGeneratorBase

    • Field Detail

      • DEFAULT_SECURE_RANDOM_ALGORITHM

        public static final java.lang.String DEFAULT_SECURE_RANDOM_ALGORITHM
    • Constructor Detail

      • SessionIdGeneratorBase

        public SessionIdGeneratorBase()
    • Method Detail

      • getSecureRandomClass

        public java.lang.String getSecureRandomClass()
        Get the class name of the SecureRandom implementation used to generate session IDs.
        Returns:
        The fully qualified class name. null indicates that the JRE provided SecureRandom implementation will be used
      • setSecureRandomClass

        public void setSecureRandomClass​(java.lang.String secureRandomClass)
        Specify a non-default SecureRandom implementation to use. The implementation must be self-seeding and have a zero-argument constructor. If not specified, an instance of SecureRandom will be generated.
        Parameters:
        secureRandomClass - The fully-qualified class name
      • getSecureRandomAlgorithm

        public java.lang.String getSecureRandomAlgorithm()
        Get the name of the algorithm used to create the SecureRandom instances which generate new session IDs.
        Returns:
        The name of the algorithm. null or the empty string means that platform default will be used
      • setSecureRandomAlgorithm

        public void setSecureRandomAlgorithm​(java.lang.String secureRandomAlgorithm)
        Specify a non-default algorithm to use to create instances of SecureRandom which are used to generate session IDs. If no algorithm is specified, SHA1PRNG will be used. If SHA1PRNG is not available, the platform default will be used. To use the platform default (which may be SHA1PRNG), specify null or the empty string. If an invalid algorithm and/or provider is specified the SecureRandom instances will be created using the defaults for this SessionIdGenerator implementation. If that fails, the SecureRandom instances will be created using platform defaults.
        Parameters:
        secureRandomAlgorithm - The name of the algorithm
      • getSecureRandomProvider

        public java.lang.String getSecureRandomProvider()
        Get the name of the provider used to create the SecureRandom instances which generate new session IDs.
        Returns:
        The name of the provider. null or the empty string means that platform default will be used
      • setSecureRandomProvider

        public void setSecureRandomProvider​(java.lang.String secureRandomProvider)
        Specify a non-default provider to use to create instances of SecureRandom which are used to generate session IDs. If no provider is specified, the platform default is used. To use the platform default specify null or the empty string. If an invalid algorithm and/or provider is specified the SecureRandom instances will be created using the defaults for this SessionIdGenerator implementation. If that fails, the SecureRandom instances will be created using platform defaults.
        Parameters:
        secureRandomProvider - The name of the provider
      • getJvmRoute

        public java.lang.String getJvmRoute()
        Return the node identifier associated with this node which will be included in the generated session ID.
        Specified by:
        getJvmRoute in interface SessionIdGenerator
        Returns:
        the node identifier associated with this node which will be included in the generated session ID.
      • setJvmRoute

        public void setJvmRoute​(java.lang.String jvmRoute)
        Specify the node identifier associated with this node which will be included in the generated session ID.
        Specified by:
        setJvmRoute in interface SessionIdGenerator
        Parameters:
        jvmRoute - The node identifier
      • getSessionIdLength

        public int getSessionIdLength()
        Return the number of bytes for a session ID
        Specified by:
        getSessionIdLength in interface SessionIdGenerator
        Returns:
        the number of bytes for a session ID
      • setSessionIdLength

        public void setSessionIdLength​(int sessionIdLength)
        Specify the number of bytes for a session ID
        Specified by:
        setSessionIdLength in interface SessionIdGenerator
        Parameters:
        sessionIdLength - Number of bytes
      • generateSessionId

        public java.lang.String generateSessionId()
        Generate and return a new session identifier.
        Specified by:
        generateSessionId in interface SessionIdGenerator
        Returns:
        the newly generated session id
      • getRandomBytes

        protected void getRandomBytes​(byte[] bytes)