class urn_perun_user_attribute_def_def_login_namespace_eduroam_vsup extends urn_perun_user_attribute_def_def_login_namespace {

	@Override
	public void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute) throws WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
		// check is the same as VŠUP login
		try {
			Attribute a = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, VSUP_NAMESPACE);
			if (!Objects.equals(attribute.getValue(),a.getValue())) {
				throw new WrongReferenceAttributeValueException(attribute, a, user, null, user, null, "Eduroam login must match VŠUP login "+a.getValue());
			}
		} catch (AttributeNotExistsException ex) {
			throw new ConsistencyErrorException("Login namespace attribute for VŠUP must exists.", ex);
		}

		// check uniqueness
		super.checkAttributeSemantics(sess, user, attribute);

	}

}