* @throws AccessControlException
*/
private void checkValidPolicy(String nodePath, AccessControlPolicy policy)
throws AccessControlException {
if (policy == null || !(policy instanceof ACLTemplate)) {
throw new AccessControlException("Attempt to set/remove invalid policy " + policy);
}
ACLTemplate acl = (ACLTemplate) policy;
if (!nodePath.equals(acl.getPath())) {
throw new AccessControlException("Policy " + policy + " is not applicable or does not apply to the node at " + nodePath);
}
}