Search in sources :

Example 1 with ParseException

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());
    }
}
Also used : FileSystemException(org.apache.jackrabbit.core.fs.FileSystemException) PrivilegeEventListener(org.apache.jackrabbit.core.cluster.PrivilegeEventListener) PrivilegeDefinition(org.apache.jackrabbit.spi.PrivilegeDefinition) RepositoryException(javax.jcr.RepositoryException) IOException(java.io.IOException) ParseException(org.apache.jackrabbit.spi.commons.privilege.ParseException) Name(org.apache.jackrabbit.spi.Name)

Aggregations

IOException (java.io.IOException)1 RepositoryException (javax.jcr.RepositoryException)1 PrivilegeEventListener (org.apache.jackrabbit.core.cluster.PrivilegeEventListener)1 FileSystemException (org.apache.jackrabbit.core.fs.FileSystemException)1 Name (org.apache.jackrabbit.spi.Name)1 PrivilegeDefinition (org.apache.jackrabbit.spi.PrivilegeDefinition)1 ParseException (org.apache.jackrabbit.spi.commons.privilege.ParseException)1