Search in sources :

Example 1 with CollectionConfigurationException

use of org.exist.collections.CollectionConfigurationException in project exist by eXist-db.

the class RpcConnection method configureCollection.

private boolean configureCollection(final XmldbURI collUri, final String configuration) throws EXistException, PermissionDeniedException {
    withDb((broker, transaction) -> {
        final Collection colRef = this.<Collection>readCollection(broker, transaction, collUri).apply((collection, broker1, transaction1) -> collection);
        final CollectionConfigurationManager mgr = factory.getBrokerPool().getConfigurationManager();
        try {
            mgr.addConfiguration(transaction, broker, colRef, configuration);
        } catch (final CollectionConfigurationException e) {
            throw new EXistException(e.getMessage());
        }
        return null;
    });
    LOG.info("Configured '{}'", collUri);
    return true;
}
Also used : CollectionConfigurationException(org.exist.collections.CollectionConfigurationException) Collection(org.exist.collections.Collection) CollectionConfigurationManager(org.exist.collections.CollectionConfigurationManager) EXistException(org.exist.EXistException)

Aggregations

EXistException (org.exist.EXistException)1 Collection (org.exist.collections.Collection)1 CollectionConfigurationException (org.exist.collections.CollectionConfigurationException)1 CollectionConfigurationManager (org.exist.collections.CollectionConfigurationManager)1