public synchronized void deleteUser(User user) throws PermissionDeniedException { if(user == null) return; if(user.getName().equals("admin") || user.getName().equals("guest")) throw new PermissionDeniedException("user " + user.getName() + " is required by the system. It cannot be removed."); user = (User)users.remove(user.getUID()); if(user != null) LOG.debug("user " + user.getName() + " removed"); else LOG.debug("user "+ user.getName() + " not found"); DBBroker broker = null; try { broker = pool.get(); save(broker); } catch (EXistException e) { e.printStackTrace(); } finally { pool.release(broker); }
public synchronized void deleteUser(String name) throws PermissionDeniedException { deleteUser(getUser(name));
	public synchronized void deleteUser(User user) throws PermissionDeniedException {		if(user == null)			return;		if(user.getName().equals("admin") || user.getName().equals("guest"))			throw new PermissionDeniedException("user " + user.getName() +				" is required by the system. It cannot be removed.");		user = (User)users.remove(user.getUID());		if(user != null)			LOG.debug("user " + user.getName() + " removed");		else			LOG.debug("user "+ user.getName() + " not found");		DBBroker broker = null;		try {			broker = pool.get();			save(broker);		} catch (EXistException e) {			e.printStackTrace();		} finally {			pool.release(broker);		}	}