}
@Override
public boolean updateGroup(final String name, final Vector<String> managers, final Map<String, String> metadata) throws EXistException, PermissionDeniedException {
final SecurityManager manager = factory.getBrokerPool().getSecurityManager();
if(manager.hasGroup(name)) {
final GroupAider group = new GroupAider(name);
for(final String groupManager : managers) {
group.addManager(new UserAider(groupManager));
}
if(metadata != null) {
for(final String key : metadata.keySet()) {
if(AXSchemaType.valueOfNamespace(key) != null) {
group.setMetadataValue(AXSchemaType.valueOfNamespace(key), metadata.get(key));
} else if(EXistSchemaType.valueOfNamespace(key) != null) {
group.setMetadataValue(EXistSchemaType.valueOfNamespace(key), metadata.get(key));
}
}
}
try {
executeWithBroker(new BrokerOperation<Void>() {
@Override
public Void withBroker(final DBBroker broker) throws EXistException, URISyntaxException, PermissionDeniedException {
manager.updateGroup(group);
return null;
}
});
return true;
} catch (final URISyntaxException use) {