@Test @Ignore("This test should be run manually.") public void testListPrivilegesPerf() { Set<String> privileges = generatePrivilegeStrings(1000, 10); TreePrivilegeCache cache = new TreePrivilegeCache(privileges, null); List<Authorizable[]> authorizables = generateAuthoriables(12000, 10); long start = System.currentTimeMillis(); for (Authorizable[] authorizableHierarchy : authorizables) { Set<String> priStrings = cache.listPrivileges(null, null, null, authorizableHierarchy); for (String priString : priStrings) { CommonPrivilege currPri = create(priString); currPri.getParts(); } } long end = System.currentTimeMillis(); System.out.println("TreePrivilegeCache - total time on list string: " + (end - start) + " ms"); }
@Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { return cachedPrivileges; }
TreePrivilegeCache implements FilteredPrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { return cachedPrivileges; } }
TreePrivilegeCache implements FilteredPrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { return cachedPrivileges; } TreePrivilegeCache(Set<String> cachedPrivileges, PrivilegeFactory inPrivilegeFactory); }
TreePrivilegeCache implements FilteredPrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { return cachedPrivileges; } TreePrivilegeCache(Set<String> cachedPrivileges, PrivilegeFactory inPrivilegeFactory); @Override Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet); @Override Set<String> listPrivileges(Set<String> groups, Set<String> users, ActiveRoleSet roleSet); @Override Set<String> listPrivileges(Set<String> groups, Set<String> users, ActiveRoleSet roleSet,
    Authorizable... authorizationhierarchy); @Override Set<Privilege> listPrivilegeObjects(Set<String> groups, Set<String> users,
    ActiveRoleSet roleSet, Authorizable... authorizationhierarchy); @Override void close(); }
TreePrivilegeCache implements FilteredPrivilegeCache { @Override public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) { return cachedPrivileges; } TreePrivilegeCache(Set<String> cachedPrivileges, PrivilegeFactory inPrivilegeFactory); @Override Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet); @Override Set<String> listPrivileges(Set<String> groups, Set<String> users, ActiveRoleSet roleSet); @Override Set<String> listPrivileges(Set<String> groups, Set<String> users, ActiveRoleSet roleSet,
    Authorizable... authorizationhierarchy); @Override Set<Privilege> listPrivilegeObjects(Set<String> groups, Set<String> users,
    ActiveRoleSet roleSet, Authorizable... authorizationhierarchy); @Override void close();  }