class urn_perun_facility_attribute_def_def_uid_namespace extends FacilityAttributesModuleAbstract implements FacilityAttributesModuleImplApi {

	@Override
	public void checkAttributeSemantics(PerunSessionImpl session, Facility facility, Attribute attribute) throws WrongReferenceAttributeValueException {
		if(attribute.getValue() == null) throw new WrongReferenceAttributeValueException(attribute, null, facility, null, "Missing uid namespace for facility.");

		String userFacilityUidNamespaceAttributeName =
			AttributesManager.NS_USER_ATTR_DEF + ":" + attribute.getFriendlyName() + ":" + attribute.getValue();

		try {
			session.getPerunBl().getAttributesManagerBl().getAttributeDefinition(session, userFacilityUidNamespaceAttributeName);
		} catch (AttributeNotExistsException e) {
			throw new WrongReferenceAttributeValueException("Attribute " + userFacilityUidNamespaceAttributeName + " doesn't exists");
		}
	}

}