use of org.apache.jackrabbit.spi.commons.privilege.ParseException in project jackrabbit by apache.
the class PrivilegeRegistry method registerCustomDefinitions.
//---------------------------------------------< privilege registration >---
/**
* Register the specified custom privilege definitions.
*
* @param stubs
* @throws RepositoryException If an error occurs.
*/
private void registerCustomDefinitions(Map<Name, PrivilegeDefinition> stubs) throws RepositoryException {
if (customPrivilegesStore == null) {
throw new UnsupportedOperationException("No privilege store defined.");
}
synchronized (registeredPrivileges) {
Map<Name, Definition> definitions = createCustomDefinitions(stubs);
try {
// write the new custom privilege to the store and upon successful
// update of the file system resource add finally it to the map of
// registered privileges.
customPrivilegesStore.append(definitions);
cacheDefinitions(definitions);
} catch (IOException e) {
throw new RepositoryException("Failed to register custom privilegess.", e);
} catch (FileSystemException e) {
throw new RepositoryException("Failed to register custom privileges.", e);
} catch (ParseException e) {
throw new RepositoryException("Failed to register custom privileges.", e);
}
}
for (Listener l : listeners.keySet()) {
l.privilegesRegistered(stubs.keySet());
}
}
Aggregations