Examples of SessionIdGenerator


Examples of io.undertow.server.session.SessionIdGenerator


    @Test
    public void testLotsOfPutsAndGets() {

        SessionIdGenerator generator = new SecureRandomSessionIdGenerator();
        final Map<String, String> reference = new HashMap<>();
        final SecureHashMap<String, String> map = new SecureHashMap<>();
        for (int i = 0; i < 10000; ++i) {
            String key = generator.createSessionId();
            String value = generator.createSessionId();
            map.put(key, value);
            reference.put(key, value);
        }
        for (Map.Entry<String, String> entry : reference.entrySet()) {
            Assert.assertEquals(entry.getValue(), map.get(entry.getKey()));
View Full Code Here

Examples of io.undertow.server.session.SessionIdGenerator


    @Test
    public void testLotsOfPutsAndGets() {

        SessionIdGenerator generator = new SecureRandomSessionIdGenerator();
        final Map<String, String> reference = new HashMap<String, String>();
        final SecureHashMap<String, String> map = new SecureHashMap<String, String>();
        for (int i = 0; i < 10000; ++i) {
            String key = generator.createSessionId();
            String value = generator.createSessionId();
            map.put(key, value);
            reference.put(key, value);
        }
        for (Map.Entry<String, String> entry : reference.entrySet()) {
            Assert.assertEquals(entry.getValue(), map.get(entry.getKey()));
View Full Code Here

Examples of org.apache.catalina.SessionIdGenerator

        while (sessionExpirationTiming.size() < TIMING_STATS_CACHE_SIZE) {
            sessionExpirationTiming.add(null);
        }

        /* Create sessionIdGenerator if not explicitly configured */
        SessionIdGenerator sessionIdGenerator = getSessionIdGenerator();
        if (sessionIdGenerator == null) {
            sessionIdGenerator = new StandardSessionIdGenerator();
            setSessionIdGenerator(sessionIdGenerator);
        }

        if (sessionIdLength != SESSION_ID_LENGTH_UNSET) {
            sessionIdGenerator.setSessionIdLength(sessionIdLength);
        }
        sessionIdGenerator.setJvmRoute(getJvmRoute());
        if (sessionIdGenerator instanceof SessionIdGeneratorBase) {
            SessionIdGeneratorBase sig = (SessionIdGeneratorBase)sessionIdGenerator;
            sig.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
            sig.setSecureRandomClass(getSecureRandomClass());
            sig.setSecureRandomProvider(getSecureRandomProvider());
        }

        // Force initialization of the random number generator
        if (log.isDebugEnabled())
            log.debug("Force random number initialization starting");
        sessionIdGenerator.generateSessionId();
        if (log.isDebugEnabled())
            log.debug("Force random number initialization completed");
    }
View Full Code Here

Examples of org.apache.catalina.SessionIdGenerator

        while (sessionExpirationTiming.size() < TIMING_STATS_CACHE_SIZE) {
            sessionExpirationTiming.add(null);
        }

        /* Create sessionIdGenerator if not explicitly configured */
        SessionIdGenerator sessionIdGenerator = getSessionIdGenerator();
        if (sessionIdGenerator == null) {
            sessionIdGenerator = new StandardSessionIdGenerator();
            setSessionIdGenerator(sessionIdGenerator);
        }

        if (sessionIdLength != SESSION_ID_LENGTH_UNSET) {
            sessionIdGenerator.setSessionIdLength(sessionIdLength);
        }
        sessionIdGenerator.setJvmRoute(getJvmRoute());
        if (sessionIdGenerator instanceof SessionIdGeneratorBase) {
            SessionIdGeneratorBase sig = (SessionIdGeneratorBase)sessionIdGenerator;
            sig.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
            sig.setSecureRandomClass(getSecureRandomClass());
            sig.setSecureRandomProvider(getSecureRandomProvider());
        }

        if (sessionIdGenerator instanceof Lifecycle) {
            ((Lifecycle) sessionIdGenerator).start();
        } else {
            // Force initialization of the random number generator
            if (log.isDebugEnabled())
                log.debug("Force random number initialization starting");
            sessionIdGenerator.generateSessionId();
            if (log.isDebugEnabled())
                log.debug("Force random number initialization completed");
        }
    }
View Full Code Here

Examples of org.apache.catalina.SessionIdGenerator

        copy.setSecureRandomClass(getSecureRandomClass());
        copy.setSecureRandomProvider(getSecureRandomProvider());
        copy.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
        if (getSessionIdGenerator() != null) {
            try {
                SessionIdGenerator copyIdGenerator = sessionIdGeneratorClass.newInstance();
                copyIdGenerator.setSessionIdLength(getSessionIdGenerator().getSessionIdLength());
                copyIdGenerator.setJvmRoute(getSessionIdGenerator().getJvmRoute());
                copy.setSessionIdGenerator(copyIdGenerator);
            } catch (InstantiationException | IllegalAccessException e) {
             // Ignore
            }
        }
View Full Code Here

Examples of org.apache.catalina.SessionIdGenerator

            // Store nested <Store> element
            Store store = manager.getStore();
            storeElement(aWriter, indent, store);

            // Store nested <SessionIdGenerator> element
            SessionIdGenerator sessionIdGenerator = manager.getSessionIdGenerator();
            if (sessionIdGenerator != null) {
                storeElement(aWriter, indent, sessionIdGenerator);
            }

        }
View Full Code Here

Examples of org.apache.catalina.SessionIdGenerator

            StoreDescription parentDesc) throws Exception {
        if (aManager instanceof Manager) {
            Manager manager = (Manager) aManager;
            // Store nested <SessionIdGenerator> element
            System.out.println("Checking SessionIdGenerator for store .....");
            SessionIdGenerator sessionIdGenerator = manager.getSessionIdGenerator();
            if (sessionIdGenerator != null) {
                storeElement(aWriter, indent, sessionIdGenerator);
            }
        }
    }
View Full Code Here

Examples of org.apache.catalina.util.SessionIdGenerator

            } else {
                log.debug("No SingleSignOn Valve is present");
            }
        }

        sessionIdGenerator = new SessionIdGenerator();
        sessionIdGenerator.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
        sessionIdGenerator.setSecureRandomClass(getSecureRandomClass());
        sessionIdGenerator.setSecureRandomProvider(getSecureRandomProvider());

        super.startInternal();
View Full Code Here

Examples of org.apache.catalina.util.SessionIdGenerator

                log.debug("Found SingleSignOn Valve at " + sso);
            else
                log.debug("No SingleSignOn Valve is present");
        }

        sessionIdGenerator = new SessionIdGenerator();
        sessionIdGenerator.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
        sessionIdGenerator.setSecureRandomClass(getSecureRandomClass());
        sessionIdGenerator.setSecureRandomProvider(getSecureRandomProvider());

        super.startInternal();
View Full Code Here

Examples of org.apache.catalina.util.SessionIdGenerator

                log.debug("Found SingleSignOn Valve at " + sso);
            else
                log.debug("No SingleSignOn Valve is present");
        }

        sessionIdGenerator = new SessionIdGenerator();
        sessionIdGenerator.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
        sessionIdGenerator.setSecureRandomClass(getSecureRandomClass());
        sessionIdGenerator.setSecureRandomProvider(getSecureRandomProvider());

        super.startInternal();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.