class urn_perun_member_resource_attribute_def_virt_isBanned extends MemberResourceVirtualAttributesModuleAbstract implements MemberResourceVirtualAttributesModuleImplApi {

	@Override
	public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws AttributeNotExistsException, WrongAttributeAssignmentException {
		List<AuditEvent> resolvingMessages = new ArrayList<>();
		if (message == null) return resolvingMessages;

		if (message instanceof BanSetForResource) {
			return resolveBanChangedForResource(perunSession, ((BanSetForResource) message).getMemberId(), ((BanSetForResource) message).getResourceId());

		} else if (message instanceof BanRemovedForResource) {
			return resolveBanChangedForResource(perunSession, ((BanRemovedForResource) message).getMemberId(), ((BanRemovedForResource) message).getResourceId());

		} else if (message instanceof BanUpdatedForResource) {
			return resolveBanChangedForResource(perunSession, ((BanUpdatedForResource) message).getMemberId(), ((BanUpdatedForResource) message).getResourceId());

		} else if (message instanceof BanSetForFacility) {
			return resolveBanChangedForFacility(perunSession, ((BanSetForFacility) message).getUserId(), ((BanSetForFacility) message).getFacilityId());

		} else if (message instanceof BanRemovedForFacility) {
			return resolveBanChangedForFacility(perunSession, ((BanRemovedForFacility) message).getUserId(), ((BanRemovedForFacility) message).getFacilityId());

		} else if (message instanceof BanUpdatedForFacility) {
			return resolveBanChangedForFacility(perunSession, ((BanUpdatedForFacility) message).getUserId(), ((BanUpdatedForFacility) message).getFacilityId());
		}

		return resolvingMessages;
	}

}