class urn_perun_resource_attribute_def_def_defaultHomeMountPoint extends ResourceAttributesModuleAbstract implements ResourceAttributesModuleImplApi {

	@Override
	public void checkAttributeSemantics(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws WrongReferenceAttributeValueException, WrongAttributeAssignmentException {

		if (attribute.getValue() == null) {
			throw new WrongReferenceAttributeValueException(attribute, null, resource, null, "Attribute value cannot be null.");
		}

		Attribute resourceAttribute;
		try {
			resourceAttribute = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, resource, A_R_homeMountPoints);
		} catch (AttributeNotExistsException ex) {
			throw new InternalErrorException(ex);
		}

		if(resourceAttribute.getValue() == null) throw new WrongReferenceAttributeValueException(attribute, resourceAttribute, resource, null, resource, null, "HomeMountPoints attribute cannot be null.");

		List<?> homeMntPoints = resourceAttribute.valueAsList();
		if (!homeMntPoints.contains(attribute.getValue())) {
			throw new WrongReferenceAttributeValueException(attribute, resourceAttribute, resource, null, resource, null, "Attribute value ins't defined in underlying resource. Attribute name=" + A_R_homeMountPoints);
		}
	}

}