本文整理了Java中com.twitter.distributedlog.acl.ZKAccessControl.getAccessControlEntry()
方法的一些代码示例,展示了ZKAccessControl.getAccessControlEntry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKAccessControl.getAccessControlEntry()
方法的具体详情如下:
包路径:com.twitter.distributedlog.acl.ZKAccessControl
类名称:ZKAccessControl
方法名:getAccessControlEntry
暂无
代码示例来源:origin: twitter/distributedlog
protected AccessControlEntry getAccessControlEntry(String stream) {
ZKAccessControl entry = streamEntries.get(stream);
entry = null == entry ? defaultAccessControl : entry;
return entry.getAccessControlEntry();
}
代码示例来源:origin: twitter/distributedlog
ZKAccessControl accessControl = streamEntries.remove(s);
if (null != accessControl) {
logger.info("Removed Access Control Entry for stream {} : {}", s, accessControl.getAccessControlEntry());
代码示例来源:origin: twitter/distributedlog
@Test(timeout = 60000)
public void testEmptyZKAccessControl() throws Exception {
String zkPath = "/empty-access-control";
zkc.get().create(zkPath, new byte[0], zkc.getDefaultACL(), CreateMode.PERSISTENT);
ZKAccessControl readZKAC = Await.result(ZKAccessControl.read(zkc, zkPath, null));
assertEquals(zkPath, readZKAC.zkPath);
assertEquals(ZKAccessControl.DEFAULT_ACCESS_CONTROL_ENTRY, readZKAC.getAccessControlEntry());
assertTrue(ZKAccessControl.DEFAULT_ACCESS_CONTROL_ENTRY == readZKAC.getAccessControlEntry());
}
代码示例来源:origin: twitter/distributedlog
@Override
protected int runCmd() throws Exception {
BKDLConfig bkdlConfig = BKDLConfig.resolveDLConfig(getZooKeeperClient(), getUri());
if (null == bkdlConfig.getACLRootPath()) {
// acl isn't enabled for this namespace.
System.err.println("ACL isn't enabled for namespace " + getUri());
return -1;
}
String zkPath = getZKPath(getUri().getPath() + "/" + bkdlConfig.getACLRootPath());
ZKAccessControl accessControl = getZKAccessControl(getZooKeeperClient(), zkPath);
AccessControlEntry acl = accessControl.getAccessControlEntry();
acl.setDenyWrite(denyWrite);
acl.setDenyTruncate(denyTruncate);
acl.setDenyDelete(denyDelete);
acl.setDenyAcquire(denyAcquire);
acl.setDenyRelease(denyRelease);
setZKAccessControl(getZooKeeperClient(), accessControl);
return 0;
}
内容来源于网络,如有侵权,请联系作者删除!