/** * Returns a CachePoolInfo describing this CachePool based on the permissions * of the calling user. Unprivileged users will see only minimal descriptive * information about the pool. * * @param pc Permission checker to be used to validate the user's permissions, * or null * @return CachePoolEntry describing this CachePool */ public CachePoolEntry getEntry(FSPermissionChecker pc) { boolean hasPermission = true; if (pc != null) { try { pc.checkPermission(this, FsAction.READ); } catch (AccessControlException e) { hasPermission = false; } } return new CachePoolEntry(getInfo(hasPermission), hasPermission ? getStats() : new CachePoolStats.Builder().build()); }
/** * Returns a CachePoolInfo describing this CachePool based on the permissions * of the calling user. Unprivileged users will see only minimal descriptive * information about the pool. * * @param pc Permission checker to be used to validate the user's permissions, * or null * @return CachePoolEntry describing this CachePool */ public CachePoolEntry getEntry(FSPermissionChecker pc) { boolean hasPermission = true; if (pc != null) { try { pc.checkPermission(this, FsAction.READ); } catch (AccessControlException e) { hasPermission = false; } } return new CachePoolEntry(getInfo(hasPermission), hasPermission ? getStats() : new CachePoolStats.Builder().build()); }
/** * Returns a CachePoolInfo describing this CachePool based on the permissions * of the calling user. Unprivileged users will see only minimal descriptive * information about the pool. * * @param pc Permission checker to be used to validate the user's permissions, * or null * @return CachePoolEntry describing this CachePool */ public CachePoolEntry getEntry(FSPermissionChecker pc) { boolean hasPermission = true; if (pc != null) { try { pc.checkPermission(this, FsAction.READ); } catch (AccessControlException e) { hasPermission = false; } } return new CachePoolEntry(getInfo(hasPermission), hasPermission ? getStats() : new CachePoolStats.Builder().build()); }