class urn_perun_entityless_attribute_def_def_namespace_minUID extends EntitylessAttributesModuleAbstract implements EntitylessAttributesModuleImplApi {

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

}