Package org.acegisecurity.providers.dao

Examples of org.acegisecurity.providers.dao.UserCache


     * Flush user from any caches maintained by security system.
     */
    public static void flushAuthenticationUserCache(String userName) {                               
        ApplicationContext ctx =
            WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
        UserCache userCache = (UserCache)ctx.getBean("userCache");
        if (userCache != null) {
            userCache.removeUserFromCache(userName);
        }
    }
View Full Code Here


        context.setAuthentication(token);
        SecurityContextHolder.setContext(context);
       
        UserManager userManager = (UserManager) makeInterceptedTarget();
       
        UserCache cache = (UserCache) ctx.getBean("userCache");
        User user = new User("cacheduser");
        user.setVersion(new Integer(1));
        user.getRoles().add(new Role(Constants.USER_ROLE));
        cache.putUserInCache(user);
       
        assertNotNull(cache.getUserFromCache(user.getUsername().toLowerCase()));
       
        userDao.expects(once()).method("saveUser");
        userManager.saveUser(user);
        assertNull(cache.getUserFromCache(user.getUsername()));
    }
View Full Code Here

        context.setAuthentication(token);
        SecurityContextHolder.setContext(context);
       
        UserManager userManager = makeInterceptedTarget();
       
        UserCache cache = (UserCache) ctx.getBean("userCache");
        User user = new User("cacheduser");
        user.setVersion(new Integer(1));
        user.getRoles().add(new Role(Constants.USER_ROLE));
        cache.putUserInCache(user);
       
        assertNotNull(cache.getUserFromCache(user.getUsername().toLowerCase()));
       
        userDao.expects(once()).method("saveUser");
        userManager.saveUser(user);
        assertNull(cache.getUserFromCache(user.getUsername()));
    }
View Full Code Here

TOP

Related Classes of org.acegisecurity.providers.dao.UserCache

Copyright © 2018 www.massapicom. 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.