// groups = new Int2ObjectHashMap<Group>(65);
// users = new Int2ObjectHashMap<User>(65);
this.pool = pool;
final TransactionManager transaction = pool.getTransactionManager();
Txn txn = null;
Collection systemCollection = null;
try {
systemCollection = broker.getCollection(XmldbURI.SYSTEM_COLLECTION_URI);
if(systemCollection == null) {
txn = transaction.beginTransaction();
systemCollection = broker.getOrCreateCollection(txn, XmldbURI.SYSTEM_COLLECTION_URI);
if (systemCollection == null)
{return;}
systemCollection.setPermissions(Permission.DEFAULT_SYSTEM_COLLECTION_PERM);
broker.saveCollection(txn, systemCollection);
transaction.commit(txn);
}
} catch (final Exception e) {
transaction.abort(txn);
e.printStackTrace();
LOG.debug("loading acl failed: " + e.getMessage());
} finally {
transaction.close(txn);
}
try {
collection = broker.getCollection(SECURITY_COLLECTION_URI);
if (collection == null) {
txn = transaction.beginTransaction();
collection = broker.getOrCreateCollection(txn, SECURITY_COLLECTION_URI);
if (collection == null){
return;
}
//if db corrupted it can lead to unrunnable issue
//throw new ConfigurationException("Collection '/db/system/security' can't be created.");
collection.setPermissions(Permission.DEFAULT_SYSTEM_SECURITY_COLLECTION_PERM);
broker.saveCollection(txn, collection);
transaction.commit(txn);
}
} catch (final Exception e) {
transaction.abort(txn);
e.printStackTrace();
LOG.debug("loading configuration failed: " + e.getMessage());
} finally {
transaction.close(txn);
}
final Configuration _config_ = Configurator.parse(this, broker, collection, CONFIG_FILE_URI);
configuration = Configurator.configure(this, _config_);