class urn_perun_entityless_attribute_def_def_namespace_maxUID extends EntitylessAttributesModuleAbstract implements EntitylessAttributesModuleImplApi {

	@Override
	public void checkAttributeSemantics(PerunSessionImpl perunSession, String key, Attribute attribute) throws WrongReferenceAttributeValueException, WrongAttributeAssignmentException {
		Integer maxUID = attribute.valueAsInteger();
		if (maxUID == null) return;
		try {
			Attribute minUIDAttr = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, key, A_E_namespaceMinUID);
			Integer minUID = minUIDAttr.valueAsInteger();
			if(minUID != null) {
				if(maxUID < minUID) throw new WrongReferenceAttributeValueException(attribute, minUIDAttr, key, null, key, null, "Attribute value must be more than minUID. MinUID = " + minUID + ", and maxUID try to set = " + maxUID);
			}
		} catch (AttributeNotExistsException ex) {
			throw new ConsistencyErrorException("Attribute namespace-minUID is supposed to exist.",ex);
		}
	}

}