class urn_perun_user_attribute_def_virt_institutionsCountries extends UserVirtualAttributeCollectedFromUserExtSource<DnsMapCtx> {

	@Override
	public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException {
		List<AuditEvent> messages = super.resolveVirtualAttributeValueChange(sess, message);
		// react to auditlog message about changing dnsStateMapping

		if (message instanceof AttributeSetForKey
			&& ((AttributeSetForKey) message).getAttribute().getFriendlyName().equals(DNS_STATE_MAPPING_ATTR.getFriendlyName())) {

			messages.addAll(resolveEvent(sess, ((AttributeSetForKey) message).getKey()));
		} else if (message instanceof AttributeRemovedForKey
			&& ((AttributeRemovedForKey) message).getAttribute().getFriendlyName().equals(DNS_STATE_MAPPING_ATTR.getFriendlyName())) {

			messages.addAll(resolveEvent(sess, ((AttributeRemovedForKey) message).getKey()));
		}
		return messages;
	}

}