@Test public void testListPrivilegesURI() { CommonPrivilege uri1Select = create(new KeyValue("Server", "server1"), new KeyValue("uri", "hdfs: CommonPrivilege uri2Select = create(new KeyValue("Server", "server1"), new KeyValue("uri", "hdfs: TreePrivilegeCache cache = new TreePrivilegeCache(Sets.newHashSet(uri1Select.toString(), uri2Select.toString()), null); assertEquals(2, cache.listPrivileges(null, null, null, new Server("server1")).size()); }
@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();  }