public List<ACL> getACL(DataNode node) { synchronized (node) { return aclCache.convertLong(node.acl); } }
public List<ACL> getACL(DataNode node) { synchronized (node) { return aclCache.convertLong(node.acl); } }
public List<ACL> getACL(String path, Stat stat) throws KeeperException.NoNodeException { DataNode n = nodes.get(path); if (n == null) { throw new KeeperException.NoNodeException(); } synchronized (n) { n.copyStat(stat); return new ArrayList<ACL>(aclCache.convertLong(n.acl)); } }
@SuppressWarnings("unchecked") public List<ACL> getACL(String path, Stat stat) throws KeeperException.NoNodeException { DataNode n = nodes.get(path); if (n == null) { throw new KeeperException.NoNodeException(); } synchronized (n) { n.copyStat(stat); return new ArrayList<ACL>(aclCache.convertLong(n.acl)); } }
@Test public void testBidirectionality() { List<ACL> testACL = createACL("myid"); ReferenceCountedACLCache cache = new ReferenceCountedACLCache(); Long aclId = cache.convertAcls(testACL); assertEquals(testACL, cache.convertLong(aclId)); }