@Override
	public synchronized Map<String, Map<String, String>> validate(
			String password) {

		Long passwordFlags = passwordPolicy.getFlags();

		Map<String, Map<String, String>> problems = new HashMap<String, Map<String, String>>();

		Set<String> filterIDs = filters.keySet();

		if (password.length() > passwordPolicy.getMaxPwLength()) {
			Map<String, String> prob = new HashMap<String, String>();
			prob.put("maxPwLength",
					Integer.toString(passwordPolicy.getMaxPwLength()));
			prob.put("maxPwLength.explain", Integer.toString(password.length()));
			problems.put("PasswordPolicy", prob);
		}

		if (password.length() < passwordPolicy.getMinPwLength()) {
			Map<String, String> prob = new HashMap<String, String>();
			prob.put("minPwLength",
					Integer.toString(passwordPolicy.getMinPwLength()));
			prob.put("minPwLength.explain", Integer.toString(password.length()));
			problems.put("PasswordPolicy", prob);
		}

		for (Iterator<String> iter = filterIDs.iterator(); iter.hasNext();) {
			String filterId = (String) iter.next();
			IPasswordFilter filter = filters.get(filterId);

			Map<String, String> checked = filter
					.filter(passwordFlags, password);

			if (checked.size() > 0)
				problems.put(filterId, checked);
		}

		List<IPasswordFilter> ppFilters = passwordPolicy.getFilters();
		for (IPasswordFilter ppFilter : ppFilters) {
			Map<String, String> checked = ppFilter.filter(passwordFlags,
					password);

			if (checked.size() > 0)
				problems.put(ppFilter.getId(), checked);
		}

		return problems;
	}