/** * Clear all write accessors. */ public void clearWriteAccessors() { getRegistrySecurity().resetDigestACLs(); }
/** * Get the aggregate set of ACLs the client should use * to create directories * @return the ACL list */ public List<ACL> getClientAcls() { return getRegistrySecurity().getClientACLs(); }
@Override public String toString() { return aclsToString(acls); } }
@Override public boolean mknode(String path, boolean createParents) throws IOException { validatePath(path); return zkMkPath(path, CreateMode.PERSISTENT, createParents, getClientAcls()); }
@Override public ACL run() throws Exception { return registrySecurity.createSaslACLFromCurrentUser(0); } });
@Override public List<String> list(String path) throws IOException { validatePath(path); return zkList(path); }
@Override public void delete(String path, boolean recursive) throws IOException { validatePath(path); zkDelete(path, recursive, null); }
/** * Create a Digest ID from an id:pass pair * @param id ID * @param password password * @return an ID * @throws IOException */ public Id toDigestId(String id, String password) throws IOException { return toDigestId(digest(id, password)); }
/** * Flag to indicate whether or not the registry is secure. * Valid once the service is inited. * * @return service security policy */ public boolean isSecure() { return registrySecurity.isSecureRegistry(); }
/** * Generate a base-64 encoded digest of the idPasswordPair pair * @param id ID * @param password pass * @return a string that can be used for authentication * @throws IOException */ public String digest(String id, String password) throws IOException { return digest(id + ":" + password); }
/** * Verify a path exists. * * @param path path of operation * @throws PathNotFoundException if the path is absent * @throws IOException */ public String zkPathMustExist(String path) throws IOException { zkStat(path); return path; }
/** * Create an IOE when an operation fails * @param path path of operation * @param operation operation attempted * @param exception caught the exception caught * @return an IOE to throw that contains the path and operation details. */ protected IOException operationFailure(String path, String operation, Exception exception) { return operationFailure(path, operation, exception, null); }
/** * Return a path dumper instance which can do a full dump * of the registry tree in its <code>toString()</code> * operation. * * @param verbose verbose flag - includes more details (such as ACLs) * @return a class to dump the registry */ public ZKPathDumper dumpPath(boolean verbose) { return new ZKPathDumper(curator, registryRoot, verbose); }
/** * Clear all write accessors */ public void clearWriteAccessors() { getRegistrySecurity().resetDigestACLs(); }
/** * Get the aggregate set of ACLs the client should use * to create directories * @return the ACL list */ public List<ACL> getClientAcls() { return getRegistrySecurity().getClientACLs(); }
@Override public ACL run() throws Exception { return registrySecurity.createSaslACLFromCurrentUser(0); } });
@Override public String toString() { return aclsToString(acls); } }
/** * Flag to indicate whether or not the registry is secure. * Valid once the service is inited. * @return service security policy */ public boolean isSecure() { return registrySecurity.isSecureRegistry(); }
/** * Generate a base-64 encoded digest of the idPasswordPair pair * @param id ID * @param password pass * @return a string that can be used for authentication * @throws IOException */ public String digest(String id, String password) throws IOException { return digest(id + ":" + password); }
/** * Verify a path exists * @param path path of operation * @throws PathNotFoundException if the path is absent * @throws IOException */ public String zkPathMustExist(String path) throws IOException { zkStat(path); return path; }